TORONTO KIDS COMPUTER CLUB | Friday 19:00 Philip Python Homework 05.03.
16251

# Friday 19:00 Philip Python Homework 05.03.

## 07 May Friday 19:00 Philip Python Homework 05.03.

Question 1.

A store is having a sale. They’re giving 10 percent off purchases of \$10 or lower, and 20 percent off purchases of greater than \$10. Write a program that asks the purchase price and displays the discount (10% or 20%) and the final
price.

Question 2.

A soccer team is looking for girls from ages 10 to 12 to play on their team. Write a program to ask the user’s age and if male or female (using “m” or “f”). Display a message indicating whether the person is eligible to play on the team.

Question 3.

You’re on a long car trip and arrive at a gas station. It’s 200 km to the next station. Write a program to figure out if you need to buy gas here, or if you can wait for the next station.

The program should ask these questions, Input Sample:

How big is your tank, in liters?
How full is your tank (in percent—for example, half full = 50)?
How many km per liter does your car get?

The output should look something like this:

Output Sample 1:

Size of tank: 60
percent full: 40
km per liter: 10
You can go another 240 km
The next gas station is 200 km away
You can wait for the next station.

Output Sample 2:

Size of tank: 40
percent full: 30
km per liter: 10
You can go another 120 km
The next gas station is 200 km away