You are on page 1of 2

LAB ACTIVITY - PRELIM

ACTIVITY1
•Problem Solving(Complete this activity using [1]- if else statement and [2]-switch
case statement):
•1)Your Professor is busy grading other students in her CS Department. She needs your help
to grade her students in the Programming section that she teaches by creating a program
in Java. Determine the grades of her students by following the rules below:
•1) Grade her student ‘A’ if their average score is between 90 and 100.
•2) Grade her student ‘B’ if their average score is between 80 and 89.
•3) Grade her student ‘C’ if their average score is between 75 and 79.
•4) Grade her student ‘F’ if their average score is below 74.

•Input Instruction:
•1) Take input of the student’s Java Programming score.
•2) Take input of the student’s C Programming score.
•3) Take input of the student’s Database Handling score.
•Output Instruction:
•Get the average of the three subjects and grade the student.
•Sample 1:
•Input:
•Java Score:
•78
•C Score:
•87
•Database Handling score:
•77
•Output:
•B
•Explanation:
•The average of the student is 80.666, so the student’s grade is B.
Do you want to continue : YES / NO
If user will submit YES the program will redirect. If user will submit NO then program will
terminated.

ACTIVITY 2 :
Write a java Program to perform the following Arithmetic Operations :
1)Addition, 2)Subtraction, 3)Multiplication, 4)Division, 5)Modulus, 6)Increment, 6)Decrement
NOTE : User will submit two values
•Output Instruction:

Variable values:
x = 13
y=9
result = 0.0

Arithmetic Operation:
Addition: x + y = 22.0
Subtraction: x - y = 4.0
Multiplication: x * y = 117.0
Division: x / y = 1.0
Modulus: x % y = 4.0
Increment: x++ = 14.0
Decrement: x-- = 12.0

You might also like