Cmpe30022 Assignment3
Cmpe30022 Assignment3
CMPE 30022
ASSIGNMENT NO.
3
SELECTION STATEMENTS
Submitted by:
IREANNE N. OMEGA
Submitted to:
Julius S. Cansino
Date Submitted:
December 31,202
Exercise 5.1
Write a program that will compute for the student’s average grade and will
display the Status of the student.
● The user will input the following:
○ Name (String)
○ Math (int)/(float)
○ Science (int) (float)
○ English (int) (float)
● Display the average grade in 2 decimal places
● if the average grade >= 75, display
Congratulations!
You passed the semester
else display
You failed the semester
SOURCE CODE:
OUTPUT RUN:
Exercise 5.2
Create a program using ladderized-if statement to display student’s
remarks based on the average grade. Combined/Compound condition (using
logical operator such as AND/OR) is not allowed.
SOURCE CODE:
OUTPUT RUN:
Enter average grade: 96
Excellent
Enter average grade: 90
Outstanding
Sample Run:
Enter Name: Christian
Enter Math: 96
Enter Science: 90
Enter English: 89
Average Grade: 91.67
Congratulations!
You passed the semester
SOURCE CODE:
OUTPUT RUN:
Exercise 5.4
Write a program that will check the employees’ years in service and
office.
● The user will input number of years in service and the
following offices: IT, ACCT, HR.
● Check the following conditions given on the table.
● The program should display the amount
Years in Service
Office
More than or equal to 10 years Below 10 years
IT 10000 5000
7500
HR 15000
SOURCE CODE:
OUTPUT RUN:
Enter years in service: 15
Enter office: IT
Amount given: 10000
Sample Run:
Enter number1: 5
Enter number2: 7
Enter number3: 3
Lowest: 3
Highest: 7
Sum: 10
SOURCE CODE:
OUTPUT RUN: