1.
Grading Program
Requires:
variables, data types, and numerical operators
basic input/output
logic (if statements, switch statements)
Write a program that allows the user to enter the grade scored in a java class (0-100). If the
user scored a 100 then notify the user that they got a perfect score. It should also print the
student grade based on the following scales 0-59 F 60-69 D 70-79 C 80-89 B 90-100 A
a. It should print an error “nun numeric value not allowed” if the user enters a character.
b. It should print an error “A student grade cannot be Negative” if the user enters a
negative value.
c. It should print an error “A student grade cannot exceed maximum” if the grade is
greater than 100.
2. Cola Machine
Requires:
variables, data types, and numerical operators
basic input/output
logic (if statements, switch statements)
Write a program that presents the user w/ a choice of your 5 favorite beverages (Coke, Water,
Sprite, Ambo water, Pepsi). Then to allow the user choose a beverage by entering a number
1-5. Output which beverage they chose.
a. Write the program using switch statement
b. Write the program using if, else condition
3. Generate Prime Nos
Requires:
variables, data types, and numerical operators
basic input/output
logic (if statements, switch statements)
loops (for, while, do-while)
Write a program that ask a user a no. Then the program will generate prime no’s up to a
number that is given by the user.
4. Bracketing Search
Requires:
variables, data types, and numerical operators
basic input/output
logic (if statements, switch statements)
loops (for, while, do-while)
psudo random numbers
Write a program that calculates a random number 1 through 100. The program then asks the
user guesses too high or too low then the program should output "too high" or "too low"
accordingly.
The program the user to guess the number.
It must let the user continue to guess until the user correctly guesses the number.
a. Modify the program to output how many guesses it took the user to correctly guess the
right number.