Skip to content

Topics Covered: If Statement, If-else Statement, Nested - If Statement, Switch Statement, While Loop, For Loop, Enhanced For Loop, Do While loop, Break and Continue, Flow Control Statements

Notifications You must be signed in to change notification settings

Cyberster/Wipro-Training-Java-Fundamentals---Assignments-for-Flow-Control-Statements

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Wipro TalentNext PBL

Topics Covered

Command Line Argument

No. Hands-on Assignment Topics Covered Status 1

Write a program to check if a given number is Positive, Negative, or Zero.

If Statement 	

2

Write a program to check if a given number is odd or even.

If Statement 	

3

Write a program to check if the program has received command line arguments or not. If the program has not received the values then print "No Values", else print all the values in a single line separated by ,(comma). Eg1) java Example O/P: No values Eg2) java Example Mumbai Bangalore O/P: Mumbai,Bangalore [Note: You can use length property of an array to check its length

If Statement 	

4

Initialize two character variables in a program and display the characters in alphabetical order. Eg1) if first character is s and second is e O/P: e,s Eg2) if first character is a and second is e O/P:a,e

If Statement 	

5

Intialize a character variable in a program and if the value is alphabet then print "Alphabet" if it’s a number then print "Digit" and for other characters print "Special Character"

If Statement 	

6

Write a program to accept gender ("Male" or "Female") and age (1-120) from command line arguments and print the percentage of interest based on the given conditions. Interest == 8.2% Gender ==> Female Age ==>1 to 58 Interest == 7.6% Gender ==> Female Age ==>59 -120 Interest == 9.2% Gender ==> Male Age ==>1-60 Interest == 8.3% Gender ==> Male Age ==>61-120

If Statement 	

7

Write a program to convert from upper case to lower case and vice versa of an alphabet and print the old character and new character as shown in example (Ex: a->A, M->m).

If Statement 	

8

Write a program to print the color name, based on color code. If color code in not valid then print "Invalid Code". R->Red, B->Blue, G->Green, O->Orange, Y->Yellow, W->White.

Switch Statement 	

9

Write a program to print month in words, based on input month in numbers Example1:

 C:\>java Sample 12

 O/P Expected : December

Example2:

 C:\>java Sample 

 O/P Expected : Please enter the month in numbers

Example3:

 C:\>java Sample 15

 O/P Expected : Invalid month

Switch Statement 	

10

Write a program to print numbers from 1 to 10 in a single row with one tab space.

For Loop 	

11

Write a program to print even numbers between 23 and 57, each number should be printed in a separate row.

For Loop 	

12

Write a program to check if a given number is prime or not

For Loop 	

13

Write a program to print prime numbers between 10 and 99.

For Loop 	

14

Write a Java program to find if the given number is prime or not.

Example1:

 C:\>java Sample 

 O/P Expected : Please enter an integer number 

Example2:

 C:\>java Sample 1

 O/P Expected : 1 is neither prime nor composite

Example3:

 C:\>java Sample 0

 O/P Expected : 0 is neither prime nor composite

Example4:

 C:\>java Sample 10

 O/P Expected : 10 is not a prime number

Example5:

 C:\>java Sample 7

 O/P Expected : 7 is a prime number

For Loop 	

15

Write a program to add all the values in a given number and print. Ex: 1234->10

For Loop 	

16

Write a program to print * in Floyds format (using for and while loop) *


Example1:

 C:\>java Sample 

 O/P Expected : Please enter an integer number

Example1:

 C:\>java Sample 3

 O/P Expected :
               *
               *  * 
               *  *  *

For Loop 	

17

Write a program to reverse a given number and print Eg1) I/P: 1234 O/P:4321 Eg2) I/P:1004 O/P:4001

While Loop 	

18

Write a Java program to find if the given number is palindrome or not

Example1:

 C:\>java Sample 110011

 O/P Expected : 110011 is a palindrome

Example2:

 C:\>java Sample 1234

 O/P Expected : 1234 is not a palindrome

While Loop 	

19

Write a program to print first 5 values which are divisible by 2, 3, and 5.

While Loop 	

20

Write a program that displays a menu with options 1. Add 2. Sub Based on the options chosen, read 2 numbers and perform the relevant operation. After performing the operation, the program should ask the user if he wants to continue. If the user presses y or Y, then the program should continue displaying the menu else the program should terminate. [ Note: Use Scanner class, you can take help from the trainer regarding the same ]

Do While

About

Topics Covered: If Statement, If-else Statement, Nested - If Statement, Switch Statement, While Loop, For Loop, Enhanced For Loop, Do While loop, Break and Continue, Flow Control Statements

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages