You are on page 1of 4

`

1. Create a program that gives the user to display the sum of the first and
second numbers, difference of the sum and the third number, product of
the difference and the fourth number, and the quotient of the product
and the fifth number. Display their output.
Sample Input:
Enter the first number: 10
Enter the second number: 20
Enter the third number: 10
Enter the fourth number: 10
Enter the fifth number: 5
Sample Output:
The sum is 30
The difference is 20
The product is 200
The quotient is 40

2. Create a program that generates the grade of the three grading


systems. Display the output.
Prelim =30%
Midterm = 30%
Final = 40%
TOTAL = 100%
Sample Input:
Enter the Prelim Grade: 90
Enter the Midterm Grade: 90
Enter the Final Grade : 85
The general average of three numbers is 88.00

3. Write a program that takes as input the purchase price of an item(P), its
expected number of years in service (Y) and its expected salvage
value(S). Then output the early depreciation for the Item(D). Use the
formula: D= (P-S)/Y;

Computer Programming 1 Date Developed:


ACLC COLLEGE OF SORSOGON
EDWARDO G. REYES, MIT October 2021

Page 1 of 4
`

Sample Input:
Enter the purchase price of an item: 100
Enter the number of years in service: 10
Enter the expected salvage value :10
Sample Output:
The early depreciation for the Item is 9.00

4. Write a program that will Input the name , position of the employee ,
Input the rate per hour, hours worked. Compute the Gross pay for an
employee.
Enter the name: Edward
Enter the rate per hour: 100
Enter the hours worked: 40
Sample Output:
Edward, Your salary is 4000

5. Write a program that convert the input Fahrenheit degree into its
equivalent Celsius degree. Use the formula C= 5/9 (F -32)
Sample input:
Enter the temperature in Fahrenheit is: 100.4
Sample Output:
The equivalent temperature in Celsius is 38

6. Write a program that convert the input Celsius degree into its
equivalent Fahrenheit degree. Use the formula F= (9/5) * C + 32

Sample input:
Enter the temperature in celsius: 38

Sample Output:

Computer Programming 1 Date Developed:


ACLC COLLEGE OF SORSOGON
EDWARDO G. REYES, MIT October 2021

Page 2 of 4
`

The equivalent temperature in Fahrenheit is 100.4

7. Write a program to calculate the area of a circle and display the result.
Use the formula

Area= pir2 where pi is approximately equal to 3.1416

Sample Input:
Enter the value of radius: 1

Sample output:
The area is 3.1416

8. Write a program that converts the input dollar to its peso exchange rate
equivalent. Assume that the present exchange rate is 51.50 pesos
against the dollar. Then display the peso equivalent exchange rate
Sample Input:
Enter the dollar: 1
Sample output:
The equivalent in peso is 51.5

9. Write a program that converts an input inch(es) into its equivalent


centimeters. Take note that one inch is equivalent to 2.54 cms.
Sample input:
Enter the inch(es): 1
Sample output:
The equivalent in cm(s) is 2.54

10. A movie in a local theater is in great demand. To help a local


charity, the theater owner has decided to donate a portion of the gross
amount generated from the movie to the charity. This example designs
and implements a program that prompts the user to input the movie

Computer Programming 1 Date Developed:


ACLC COLLEGE OF SORSOGON
EDWARDO G. REYES, MIT October 2021

Page 3 of 4
`

name, adult ticket price, child ticket price, number of adult tickets sold,
number of child tickets sold, and percentage of the gross amount to be
donated to the charity. The output of the program is as follows:
** The input to the program consists of the movie name, adult ticket
price, child ticket price, number of adult tickets sold, number of child
tickets sold and percentage of the gross amount to be donated to the
charity.
Sample Input:
Enter the movie name : Darna
Enter the price of an adult ticket: 4.50
Enter the price of a child ticket : 3.00
Enter the number of adult tickets sold : 800
Enter the number of child tickets sold : 1850
Enter the percentage of donation : 10

Sample Output:
Movie Name : Darna
Number of ticket sold : 2650
Gross amount : 9150.00
Amount donated : 915.00

Net Sale : 8235.00

Computer Programming 1 Date Developed:


ACLC COLLEGE OF SORSOGON
EDWARDO G. REYES, MIT October 2021

Page 4 of 4

You might also like