Menu
C. Circle
R. Rectangle
S. Square
T. Triangle
Select [CRST] only:
Methods: main - calls method menu
menu - displays the menu selection
allows the user to select an area to perform
circle - input the value of the radius
compute the area of the circle
rectangle - input the value of the length and width
compute the area of the rectangle
square - input the value of the side
compute the area of the square
triangle - input the value of the base and height
compute the area of the triangle
result - displays the result of the selected area
Test Data: Area input value output
C r = 5 78.54
R l = 5, w = 3 15.0
S s = 4 16.0
T b = 3, h = 5 7.5
5. Methods: main - input student name, prelim exam score
quiz - input 5 quiz scores
average quiz - compute the average quiz
prelim grade - compute the prelim grade
remarks - based on the prelim grade, determine if 'Passed' or 'Failed'
output - display student name, prelim grade, remarks
where: prelim grade = 60% of the average quiz + 40% of prelim exam score
table: prelim grade remarks
0 - 74 Failed
75 - 100 Passed
Test Data1: Input: name = Ana
prelim exam score = 100
5 quiz scores = 100, 100, 100, 100, 100
Output: name = Ana
prelim grade = 100.0
remarks = Passed
Test Data2: Input: name = Ben
prelim exam score = 50
5 quiz scores = 50, 50, 50, 50, 50
Output: name = Ben
prelim grade = 50.0
remarks = Failed
prelim exam score = 90
5 quiz scores = 90, 100, 50, 70, 80
Output: name = Cherry
prelim grade = 82.8
remarks = Passed
6. input: employee name, employee code, number of days worked
output: employee name, gross pay, sss, tax, total deduction, net pay
where: gross pay = rate per day * number of days worked
sss = 10% of gross pay
tax = 15% of gross pay
total deduction = sss + tax
net pay = gross pay - total deduction
table: employee code rate per day
C 500.0
P 520.0
R 550.0
methods: main - calls method employee
employee - accepts all input requirements
rate - determines the rate per day
gross pay - computes the gross pay
sss - computes the sss
tax - computes the tax
total deduction - computes the total deduction
net pay - computes the net pay
output - displays all output requirements
Test Data1: input: employee name = David
employee code = C
number of days worked = 10
output: employee name = David
gross pay = 5000.0
sss = 500.0
tax = 750.0
total deduction = 1250.0
net pay = 3750.0
Test Data2: input: employee name = Emma
employee code = P
number of days worked = 12
output: employee name = Emma
gross pay = 6240.0
sss = 624.0
tax = 936.0
total deduction = 1560.0
net pay = 4680.0
Test Data3: input: employee name = France
employee code = R
number of days worked = 12
output: employee name = France
gross pay = 6600.0
sss = 660.0
tax = 990.0
total deduction = 1650.0
net pay = 4950.0
Walang komento:
Mag-post ng isang Komento