Machine Problem 2
Machine Problem 2
1. Any customer whose total purchase is at least 2000 will be given a 5% percent
discount. Write a program that reads in the customer purchase and outputs the
amount to be paid.
2. Write a program that reads the age of a person and then output the message “
YOU are old enough to drive”, if his or her age is at least 18 years old.
Otherwise, display the number of years to wait before being able to drive.
3. Due to poor result of an examination, your professor decided to increase each
student by 1 point. Input the grade and print the new grade. If the original grade
exceeds 100, then it remains as such.
4. A college student who is registered for 21 units or more is considered as full
time student. The tuition fee for full time is 7000. A part time student is charged
300 per unit for tuition. Given the number of units a student is registering,
calculate and print his tuition fee on the basis of the given criteria.
5. Accept two integers and determine of the values are equal, if the values are
equal print” EQUAL NUMBERS” , otherwise print the higher number.
6. Input three integers and identify if there are equal numbers. If there are equal
numbers print the equal numbers, otherwise print the average of the numbers.
7. An employee’s weekly working hours is 40. If an employee exceeds 40 hours, it
is considered overtime. Create a program that will accept the number of hours
worked by employee and his / her hourly rate and print the gross pay and
overtime pay rendered, if there’s no OT pay to print, print only the gross pay. To
compute for the gross pay of an employee, multiply the number of hours worked
by his/her hourly rate plus his/her OT pay. OT hours are time rendered by
employee over 40 hours. The overtime hours rendered should be computed by
using 1.50% of his hourly rate.
8. Design and develop a simple program for the Air Force to label an aircraft as
military of civilian. The program is to be given the plane’s observed speed in
km/h (kilometer per hour). The speed will serve as its input. For planes traveling
in excess of 1100 km/h, you should display them as “ It’s a civilian aircraft”,
between 500 km/h to 1100 km/h, display them as “ It’s a military aircraft!” and
for planes traveling at more slower speed – less than 500 km/h, you should
display them as an “ It’s a BIRD!”.
9. Write a program that reads in the sales expenses of the Short Distance
Telephone Company for the past year and then calculate the profit and the next
tax based on the ff. table
Page 1 of 6
CCDI – ONLINE LEARNING MANAGEMENT SYSTEM
12. Design and develop a simple application program that adds, subtract, multiply
and divide two input number: SAMPLE OUTPUT
Page 2 of 6
CCDI – ONLINE LEARNING MANAGEMENT SYSTEM
15. Input three unique numbers and print the difference of the highest and lowest
numbers.
16. Write a program that examines the value of a variable called TEMP. Then
display the following messages, depending on the value assigned to TEMP.
TEMPERATURE MESSA
Less than 0 ICE
Between 0 and 100 WATER
Exceeds 100 STEAM
17. The national Earthquake Information Center has the ff. criteria to determine the
earthquake’s damage. Here are the given Richter scale criteria and their
corresponding characterization. The Richter scale serves as the input data and
the characterization as output information.
19. Write a program that computes and assess the TF of the students in one
semester, based on the given mode of payment below:
Page 3 of 6
CCDI – ONLINE LEARNING MANAGEMENT SYSTEM
The target user must use the key in selecting or choosing the mode of payment.
The first input data is the TF, and the second input data is the mode of payment
SAMPLE INPUT / OUTPUT DIALOGUE:
Enter Tuition Fee : 20000
(Press 1 for Cash, 2 for Two installment , 3 for Three Installment)
Enter mode of payment : 2
Your Total Tuition Fee is : 21000
20. Write a program that accepts an input grade in percentile form and output its
grade equivalent based on the given range of percentile and grade equivalent
table below:
RANGE GRADE
98-100 1.00
95-97 1.25
92-94 1.50
89-91 1.75
85-88 2.00
82-84 2.25
80-81 2.50
77-79 2.75
75-76 3.00
Below 75 OUT OF RANGE
21. Write a program to accept a grade and then display the equivalent grade on a
class card based on the given range of grades.
Page 4 of 6
CCDI – ONLINE LEARNING MANAGEMENT SYSTEM
77-79 2.75
75-76 3.00
70-74 4.00
Below 70 5.00
This program is also designed to compute for the total grades based on the prelim
grades, midterm grades and final grades. Total grade is equal to 30% of prelims, 30% of
midterm and 40% of finals.
22. Create a program that will compute for the student and print its equivalent point.
The formula for computing the grade is :
75 3.00 Passed
23. Implement the ff. decision table using a nested if statement. Assume that the
grade point average is within the range 0.0 through 4.0
Page 5 of 6
CCDI – ONLINE LEARNING MANAGEMENT SYSTEM
24. Implement the ff. decision table using a multiple – alternative if statement.
Assume that the wind speed is given as in integer.
25. Write a switch statement that assigns to the variable lumens the expected
brightness of a standard light bulb whose wattage has been stored in watts. Use
this table:
WATTS BRIGHTNESS
15 125
25 215
40 500
60 880
75 1000
100 1675
Assign -1 to lumens if the value of watts is not in the table
Page 6 of 6