At Westonci.ca, we connect you with experts who provide detailed answers to your most pressing questions. Start exploring now! Explore comprehensive solutions to your questions from knowledgeable professionals across various fields on our platform. Join our Q&A platform to connect with experts dedicated to providing accurate answers to your questions in various fields.

Question 5-Compulsory
5. Consider the following pseudocode design for determining the speed
of a person traveling in a residential area. The more the speed limit is
exceeded, the greater the fine applicable. Answer the questions that
follow:
LINE 1 START
LINE 2
LINE 3
LINE 4
LINE 5
LINE 6
LINE 7
LINE 8
LINE 9
LINE 10
LINE 11
LINE 12
LINE 13
LINE 14
LINE 15
LINE 16
LINE 17
LINE 18
END IF
LINE 19 PRINT "Your fine is: ", fine
LINE 20 PRINT "Have a nice day!"
LINE 21 STOP
DECLARE speed AS INTEGER
PRINT "Enter traveling speed:
READ speed
IF speed 50 then
fine = 2000
ELSE
IF speed 80 then
fine = 4000
ELSE
IF speed 120 then
fine = 7000
ELSE
fine = 0
PRINT "No fine."
END IF
END IF
(a) With the aid of a trace table, write the output that would be displayed
for the variable fine after tracing through the above pseudocode (the
NESTED-IF design) if the user entered the following data for
speed?
Speed
50
90
140
35
(b) Based on your evaluation, is the pseudocode above correct or incorrect?
Justify your answer, and state how, if at all, the pseudocode should be
corrected.


Sagot :

Thanks for using our service. We're always here to provide accurate and up-to-date answers to all your queries. We hope you found this helpful. Feel free to come back anytime for more accurate answers and updated information. We're dedicated to helping you find the answers you need at Westonci.ca. Don't hesitate to return for more.