0% found this document useful (0 votes)
22 views6 pages

Machine Problem 2

idl
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views6 pages

Machine Problem 2

idl
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

CCDI – ONLINE LEARNING MANAGEMENT SYSTEM

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

PROFIT TAX RATE


0 – 10000 0

Introduction to Programming Date Developed:


COMPUTER COMMUNICATION DEVELOPMENT INSTITUTE
June 2020 Rizal St., Sorsogon City, 4700
EDWARDO G. REYES, MIT
 (56) 421-55-75 E-mail: [email protected]

Page 1 of 6
CCDI – ONLINE LEARNING MANAGEMENT SYSTEM

10001 – 30000 100 + 3% OF THE PROFIT


30001 – 50000 200 + 5% OF THE PROFIT
OVER 50000 300 + 7% OF THE PROFIT
10. Create a program that will compute the real estate tax, given the following
formulas :
a) If value of real estate is less than 250,001.00 tax is 5% of the real estate value
b) If value of real estate is b/w 250,001.00 to 500,000.00, tax is 10% of the real
estate value
c) If more than 500,000 tax is 15% of the real estate value
11. In 2001, Bureau of Internal Revenue proposed an overhaul of the Income Tax
Law. They proposed the ff. schedule:

INCOME TAX RATE


0 to 5000 0
5001 to 10000 100 + 3% of income over 5000
10001 to 25000 200 + 6% of income over 10000
25001 to 50000 300 + 9% of income over 25000
Over 50000 500 + 15% of income over 50000

12. Design and develop a simple application program that adds, subtract, multiply
and divide two input number: SAMPLE OUTPUT

1. ADD TWO NUMBERS


2. SUBTRACT TWO NUMBERS
3. MULTIPPLY TWO NUMBERS
4. DIVIDE TWO NUMBER

ENTER YOUR CHOICE : 1


Enter the first number : 10
Enter the second number : 10
The Sum is 20
13. Input three unique numbers and print the lowest number
14. Input three unique numbers and arrange the numbers in lowest to highest order.

Introduction to Programming Date Developed:


COMPUTER COMMUNICATION DEVELOPMENT INSTITUTE
June 2020 Rizal St., Sorsogon City, 4700
EDWARDO G. REYES, MIT
 (56) 421-55-75 E-mail: [email protected]

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.

RITCHER NUMBER CHARACTERIZATION


Less than 5 LITTLE OR NO DAMAGE
5.0 to 5.5 SOME DAMAGE
5.5 to 6.5 SERIOUS DAMAGE
6.5 to 7.5 DISASTER
HIGHER CATASTROPHE
18. Write a program that determines the class of the Ship depending on its class ID
(identifier). Here are the criteria. The class ID serves as the input and the Ship
class as the output information.

CLASS ID SHIP CLASS


B or b Battleship
C or c Cruiser
D or d Destroyer
F or f Frigate

19. Write a program that computes and assess the TF of the students in one
semester, based on the given mode of payment below:

PLAN KEY Discount or Interest

Introduction to Programming Date Developed:


COMPUTER COMMUNICATION DEVELOPMENT INSTITUTE
June 2020 Rizal St., Sorsogon City, 4700
EDWARDO G. REYES, MIT
 (56) 421-55-75 E-mail: [email protected]

Page 3 of 6
CCDI – ONLINE LEARNING MANAGEMENT SYSTEM

1. CASH 10% discount


2. Two Installment 5% interest
3. Three Installment 10% interest

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.

GRADE CLASS CARD 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

Introduction to Programming Date Developed:


COMPUTER COMMUNICATION DEVELOPMENT INSTITUTE
June 2020 Rizal St., Sorsogon City, 4700
EDWARDO G. REYES, MIT
 (56) 421-55-75 E-mail: [email protected]

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 :

GRADE = Assign (10%) + Seatwork (20%) + Quiz (30%) + Exam (40%)

General Average Equivalent Grade Remarks

100-97 1.00 Excellent

96-94 1.25 Excellent

93-91 1.50 Very Good

90-88 1.75 Very Good

87-85 2.00 Good

84-82 2.25 Good

81-79 2.50 Satisfactory

76-78 2.75 Fair

75 3.00 Passed

Below 75 5.00 Failed

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

GRADE POINT AVERAGE TRANSCRIPT MESSAGE

0.0 – 0.99 Failed semester – registration suspended


1.0 – 1.99 On probation for next semester

Introduction to Programming Date Developed:


COMPUTER COMMUNICATION DEVELOPMENT INSTITUTE
June 2020 Rizal St., Sorsogon City, 4700
EDWARDO G. REYES, MIT
 (56) 421-55-75 E-mail: [email protected]

Page 5 of 6
CCDI – ONLINE LEARNING MANAGEMENT SYSTEM

2.0 – 2.99 ( no message )


3.0 – 3.49 Dean’s list for semester
3.5 – 4.00 Highest honors for semester

24. Implement the ff. decision table using a multiple – alternative if statement.
Assume that the wind speed is given as in integer.

Wind Speed Category

Below 25 not a strong wind


25 – 38 strong wind
39-54 gale
55-72 whole gale
Above 72 hurricane

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

Introduction to Programming Date Developed:


COMPUTER COMMUNICATION DEVELOPMENT INSTITUTE
June 2020 Rizal St., Sorsogon City, 4700
EDWARDO G. REYES, MIT
 (56) 421-55-75 E-mail: [email protected]

Page 6 of 6

You might also like