Design an algorithm to solve the problem using pseudocode:
(Average sales in grams) Assume a vendor sells 6 kilograms of grocery in 15 hours and 30 minutes and 30 seconds. Write a program that displays the average sale in grams per hour (Note that 1 kilogram is 1000 grams).
1 Convert kilograms to grams by multiplying on 1000
2 Convert hours to minutes by multiplying on 60, save value as T
3 Add minutes to T
4 Convert T from minutes to seconds by multiplying on 60
5 Add seconds to T
6 Divide grams by T
7 Print the result
Comments
Leave a comment