Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
21 views

Algoritms

The document provides 10 problems to write algorithms to solve: 1) Calculate and print the sum of two numbers 2) Calculate and print the number of hours in a month 3) Read item info and print name, price, quantity, and amount due 4) Read an integer N, perform math operations, and print answer 5) Calculate and print the average of three student scores

Uploaded by

Oumotia
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Algoritms

The document provides 10 problems to write algorithms to solve: 1) Calculate and print the sum of two numbers 2) Calculate and print the number of hours in a month 3) Read item info and print name, price, quantity, and amount due 4) Read an integer N, perform math operations, and print answer 5) Calculate and print the average of three student scores

Uploaded by

Oumotia
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

EXERCISE 3

Write algorithms to solve the following problems:-

1. Calculate and print the sum of two numbers.


2. Calculate and print the number of hours in a month.
3. Read the name and price of an item and the quantity purchased.
Print the name, price, quantity and amount due.
4. Read an Integer N, multiply N by 2, subtract I from the result and add 10.
Print the answer.
5. Calculate and print the average of three scores for a student.
6. Input the name, rate and hours worked for an employee. Print the name and
gross pay.
7. VAT of 15% is added to the price of an item. Read the item and the price.
Print the name of the item, the amount of VAT and the price after VAT is
added.
8. Read the name of a horse, the position it came in a race and the prize money
received. The trainer is paid 5% of the prize money. Print the name of the
horse, the position it came, the prize money and the amount paid to the
trainer.
9. Fees are charged to attend the cinema.as follows:-
(a). Balcony $8.00
(b). House $7.00
Read the number of persons sitting in the House and the number sitting
in the Balcony. Print the revenue received.

10. Write an algorithm to calculate the cost of importing a car.


First a tax of 2% of the original cost of the car is added to the cost
of the car to give a landing cost. Then, if the car is 5 years or less a
transportation tax of 15% of the original cost of the car is charged.
If the car is older than 5 years, the transportation tax is 20%. The
final cost of importing the car us calculated by adding the
transportation tax to the landing cost.

You might also like