Exercisesconditional
Exercisesconditional
1. Write a JAVA program that will input a number and evaluate if the number is
“Positive”, “Negative” or “Zero”. If the number is positive display the message
“POSITIVE NUMBER”, if negative “NEGATIVE NUMBER, and if zero display the
message “ZERO”.
2. Write a JAVA program that will input a student’s final grade from 50-100. Evaluate
the Final grade and display the Point Equivalent based on the table below. Indicate
also the remarks if it is “Passed” or “Failed”.
4. Write a JAVA program that will input five scores of a student in five quizzes. Output
the sum and average of five scores. Determine and display the highest and lowest
score.
5. Write a JAVA program that will input a password and test if the password is correct
and display the message “Password Accepted” otherwise, display “Invalid
Password”.
(Note: Password is “UCC” or “ucc”)
6. Write a JAVA program that will input a year code and output year level.
8. Write a JAVA program that will input a course code and output its equivalent course;
Input => Course Code Output => Course
A or a “Accounting”
B or b “Banking and Finance”
C or c “Computer Science”
D or d “Dentistry”
E or e “Engineering”
else “Invalid Course Code”
Note: Using if..else statement.
10.Write a JAVA program that will input Employee Name, Rate per hour and Number of
hours worked and will compute the daily wage of an employee. If the number of hours
worked exceeds eight hours add 30% to each excess hours as overtime rate.
Formula: Daily Wage = Rate per hour * No. of hours worked + OT pay