Bus Fare Discounts and Errors

Bus Fare Discounts and Errors

Assessment

Interactive Video

Computers

6th - 10th Grade

Hard

Created by

Olivia Brooks

FREE Resource

The video tutorial guides viewers through designing a program to calculate bus fares using Boolean expressions and if statements. It covers implementing logic for kids under five to ride free and seniors to receive a discount. The tutorial also addresses handling input errors, future-proofing code, and printing fare types. Finally, it introduces the next feature of deducting fares from user balances.

Read more

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the standard bus fare before any discounts?

$3.25

$4.25

$4.75

$5.00

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which age group qualifies for a free bus ride?

All ages

60 and above

Under 5

5 and above

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What error occurs if the age input is not cast to an integer?

Syntax Error

Type Error

Value Error

Index Error

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the condition to qualify as a senior for a bus fare discount?

Age under 60

Age 60 and over

Age exactly 60

Age over 60

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How much is the discount for seniors on their bus fare?

$2.00

$0.50

$1.50

$1.00

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Why is it better to subtract a dollar from the bus fare rather than setting it directly to $3.25?

It is more readable

It is more future-proof

It is less error-prone

It is faster

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What variable is introduced to remember the type of fare?

fareType

fareCategory

fareClass

fareLabel

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?