A school club sells craft kits for $3.00 each and charges one $2.00 handling fee per order. There are no taxes or discounts. The approved calculation multiplies the kit count by the unit price, then adds the handling fee.
A developer writes this Python code. The variable count already contains a positive integer supplied by the user.
subtotal = count + 3.00 total = subtotal * 2.00 print(total)
Trace the code and proposed corrections. Give each requested amount in dollars, to two decimal places:
Unlock full course notes by signing up
Complete a booking-program test record
A museum booking program must charge CAD 6.00 per booking plus CAD 1.25 per visitor. The fixed fee applies even when the visitor count is zero. All visitor counts shown are permitted inputs.
Complete the test record with the expected charge in CAD and the status Pass or Fail. Enter each expected charge as a decimal with two decimal places (for example, 9.50), with no currency symbols, and judge each status by comparing the expected and actual charges.
Choose a revealing threshold test
An online shop requires a CAD 4.00 delivery fee for order subtotals below CAD 40.00 and no delivery fee for subtotals of CAD 40.00 or more. A program instead charges the fee whenever the subtotal is less than or equal to CAD 40.00.
Valid subtotals are nonnegative multiples of CAD 0.01. What is the smallest valid subtotal at which the program disagrees with the requirement? Answer in CAD, to two decimal places.
Diagnose failures during program development
During program development, a student records three failures. Complete each diagnosis using syntax error, runtime error, or logic error. Use each label once.
A Python stock program contains if stock > 0 without the required colon. Python rejects the file before executing any statement. This is a ________.
A running calculator attempts to divide by zero and stops with an error message. This is a ________.
Assess the evidence after a repair
A bicycle-rental program accepts whole-number durations from 1 to 6 hours. The required charge is CAD 5.00 for up to 2 hours, plus CAD 2.00 for each hour beyond 2.
Before an edit, the 1-hour and 2-hour tests passed, but the 3-hour test produced CAD 11.00 instead of CAD 7.00. A developer changes the calculation used for durations above 2 hours. After the edit, only the 3-hour case is rerun, and it passes.
Which statements describe sound next actions or conclusions? Select all that apply.