An online store uses the Python program below to work out what a customer owes. Orders of 50 dollars or more ship free; smaller orders pay a flat shipping charge.
total = float(input("Order total: ")) if total >= 50: shipping = 0.00 else: shipping = 7.99 amount_due = total + shipping print(amount_due)
A customer enters 42.50. Put the events of this run in the order the computer carries them out.
1.
Compute amount_due as the sum of total and shipping.
2.
Skip the assignment shipping = 0.00 in the if branch.
3.
Assign 7.99 to shipping in the else branch.
4.
Evaluate the condition total >= 50 and get False.
5.
Print the value of amount_due.
6.
Read the input and store 42.5 in total.
Unlock full course notes by signing up
Following the shared continuation
A ticket system runs the following Python code. Select every true statement about which instructions execute and what the system displays.
Finding an erased decision result
An event venue charges 12 dollars for every registered attendee above its included capacity. The programmer writes the Python code below. Calculate the invoice produced by the original code, then the invoice after deleting only the unindented extra_attendees = 0 line immediately before the invoice calculation. Give both amounts in dollars to two decimal places.
A branch that changes the tested value
A teacher adjusts quiz scores with the Python program below. Students who scored 50 or more receive 10 bonus points, and everyone else receives 25 bonus points.
Give the number printed for each of the three inputs below, as a whole number.
Input 40