Home /
Expert Answers /
Computer Science /
nbsp-nbsp-question-5-10-marks-a-refer-to-figure-1-convert-the-flowchart-to-an-algorithm-pa677
(Solved):
QUESTION 5 [10 Marks] a. Refer to Figure 1, convert the flowchart to an algorithm ...
QUESTION 5 [10 Marks] a. Refer to Figure 1, convert the flowchart to an algorithm. start read vehicle read category vehicle-1 vehicle-2 vehicle--3 end category='a' category"b" true print "Motorcycle" category-'a' category 'b' Figure 1 true true print "Automobile:" print "FamilyCar™ print "Automobile:" print "SportsCar" true print "Bus:" print "SchoolBus" true print "Bus:" print "Luxury Bus" (7 marks)
b. Money in a bank triples every 10 years. Write a pseudocode of a function total_invest() which takes two parameters or arguments, deposit and year, and return the total value of the investment after the year given. Assume the year is after at least 10 years and use any repetition technique in the loop. Sample input: deposit = 100 and year = 10 Sample output: 300 Sample input: deposit = 100 and year = 35 Sample output: 2700 (3 marks)
a) Algorithm: prompt user for two integer values. save them as vehicle and category. check to see if vehicle == 1 if it is check if category == 'a'. if it is , then print " Automo