Sunteți pe pagina 1din 7

Write a Java program to get a number from the user and print whether it is positive

or negative.

Write a Java program to solve quadratic equations (use if, else if and else)

Take three numbers from the user and print the greatest number.

Write a Java program that reads a floating-point number and prints "zero"
if the number is zero. Otherwise, print "positive" or "negative".

Write a Java program that keeps a number from user and generates an integer
between 1 and 7 and displays the name of weekday.

Write a Java program that takes the user to provide a single character from the alphabet.
Print Vowel of Consonant, depending on the user input. If the user input is not a
letter (between a and z or A and Z), or is a string of length > 1, print an error message

Write a program in Java to display the first 10 natural numbers

Write a program in Java to input 5 numbers from user and find their sum and average.

Write a program in Java to display the cube of the number up to given integer

Write a program in Java to display the multiplication table of a given integer


Write a program in Java to display the n terms of odd natural number and their sum.

Write a program in Java to display the pattern like right angle triangle with number

Write a program in Java to make such a pattern like right angle triangle with number
which will repeat a number in a row. The pattern is as follows :

Write a program in Java to make such a pattern like right angle triangle with number
increased by 1.The pattern like :

Write a java program to get the length of a given string and display

Write a Java program to concatenate a given string to the end of another string and
Display.
Write a Java program to get the character at the given index within the String
HELLO WORLD. Display the result.

Create java a program that will determine if a number is power of 2 in Java

Write a program in Java to reverse any String.

Write a program in Java to print Fibonacci series up to given number?

Sample:
Enter number of terms: 10
Fibonacci Numbers: 1 1 2 3 5 8 13 21 34 55

Write a program called Product1ToN to compute the product of integers 1 to 10. Write down the
product obtained and display the results.

Write a program called SquareBoard that displays the following nn (n=5) pattern.

Create a program that will display the following pattern:

Create a program that will display the following pattern:


Create a program that will display the following pattern:

Create a program that will display the following pattern:

Create a program that will display the following pattern:

Write a program that reads in three whole numbers and outputs the average of the three
numbers

Write a program for a colleges admissions office. Create a variable to store a students
numeric high school grade point average and an admission test score. Print the message
Accept if the student has any of the following.
a. A grade point average of 3.0 or above and an admission test score of at least 60.
b. A grade point average below 3.0 and an admission test score of at least 80.
c. If the student does not meet either of the qualification criteria, print Reject. The
class name is ADMISSION.
Write a program that stores an hourly pay rate and hours worked. Compute gross pay (hours
times rate), withholding tax, and net pay (gross pay minus withholding tax). Withholding tax is
computed as a percentage of gross pay based on the following:
d. GROSS PAY WITHHOLDING PERCENTAGE
e. Up to and including 300.00 10
f. 300.01 and up 12
g. The class name is payroll.

WAP that compares the number of college credits you have earned with the number of
college credits earned by a classmate or friend. Display an appropriate message to indicate
whether your classmate earned more, fewer, o the same number of credits as you. Display
the number of college credits whether the if statement is true or not.

WAP that declares variables to hold your initials. Display the three initials with period following
each one, as in H.C.M.D.

WAP that will accept for your tuition fee and book fee. Compute and display the sum.

WAP that prompt the user to accept time in seconds. Compute and display time in HH:MM:SS.

WAP that will let you compute for shapes area . Let the user accept for a character, If the
user input a prompt for the needed data and compute for the area of rectangle, if b
area of triangle, c for circle and d for trapezoid. Used the below formula.
a. Rectangle ---- Area = Length X Width
b. Triangle---- Area = 1/2 of the base X the height
c. Circle --- A = pr2 p = 3.14

d. Trapezoid ----
WAP that accepts a String. Count and display the number of vowels and consonants.

WAP that will let you accept N times integer number . compute and display the average of all
odd numbers and , sum of all even numbers.

WAP that let the user to accept your secret number. Your program will prompt your
classmate to guess the number and display an appropriate number.

Write a program that uses any kind of loop structure.


a. Prompt them to input two integers: FirstNum and SecondNum. (FirstNum must be
less than SecondNum).
b. Output all odd numbers between FirstNum and SecondNum inclusive.
c. Output the sum of all even positive numbers between FirstNum and SecondNum.

Write an application that asks the user to enter an IQ score. Determine If the score is the
number less than 0 or greater than 200, issue an error message, otherwise, issue an Above
Average, Average , Below Average message for scores over, at, or under 100
respectively.

WAP that will ask for a number. Use the number as your range starting from 0, display the
square of each number in another line after each.
WAP that will accept your grades from prelims to. Compute and display your average where
in prelim to prefinals takes 20 % each and 40% for finals.
WAP that will ask the user to enter 10 times number. Determine all negative and positive
numbers.
Create a Flowchart that declares variable to hold number of eggs of a chicken. Your
flowchart will display the number of eggs inputted by the user in dozens. Example: 50 eggs is 4
full dozen and 2 left over. Convert your flowchart to Java program. Class Name EGG
Create a flowchart that asks the user to enter an integer variable. Compute the square and
cube of the inputted number and display. Convert your flowchart into Java program. Class
name SQRCUBE
Create a program that displays the result of a sales transaction. The calculation requires three
numbers. The first number represents the product price. The second number is the sales person
commission. These two numbers should be added together. The third value represents a
customer discount; subtract the third number from the result of addition. Convert your
flowchart into Java program. Class Name SALE

S-ar putea să vă placă și