6. Ulsing only the instructions shown in Figure 1-12, write two versions of an a
ID: 3743287 • Letter: 6
Question
6. Ulsing only the instructions shown in Figure 1-12, write two versions of an algorith that displays the total amount each customer owes for concert tickets. Be sure to the instructions appropriately. indent 8. ealeuilate the amount owed oy multiplying the number of tiokets oy 45 display the amount owed display the message You cavn purchase up to 4 tickets only. end if end repeat enter the number of tickets if (the number of tickeets is greater than 4) if (the number of tickets is less than or equal to 4) repeat for (each customer) Figure 1-12Explanation / Answer
Algorithm that displays the total amount each customer owes for concert tickets
Version 1:
repeat for (each customer)
enter the number of tickets
if (the number of tickets is greater than 4)
display the message "You can purchase up to 4 tickets only"
else
calculate the amount owed by multiplying the number of tickets by $35
display the amount owed
end if
end repeat
Version 2 :
repeat for (each customer)
enter the number of tickets
if (the number of tickets is less than or equal to 4)
calculate the amount owed by multiplying the number of tickets by $35
display the amount owed
else
display the message "You can purchase up to 4 tickets only"
end if
end repeat
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.