Professional Documents
Culture Documents
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
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;
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:
Page 2 of 4
`
7. Write a program to calculate the area of a circle and display the result.
Use the formula
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
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
Page 4 of 4