Jape Joint
The Jape Joint is a small goat-only comedy club. It has 40 small stalls that can hold up to three goats. Small stall tickets are $39.95 each. It also has 20 big stalls that can hold up to six. Tickets are $99.95 for the bigs.
Write a program to compute sales, and warn the user if stalls are oversold. Here's some I/O. Assume users don't make mistakes.
- Jape Joint Sales
- ==== ===== =====
- Big stalls sold? 1
- Small stalls sold? 1
- Big stall sales: $ 99.95
- Small stall sales: $ 39.95
- Total: $ 139.9
Some more:
- Jape Joint Sales
- ==== ===== =====
- Big stalls sold? 21
- Warning: big stalls oversold!
- Small stalls sold? 41
- Warning: small stalls oversold!
- Big stall sales: $ 2098.95
- Small stall sales: $ 1637.95
- Total: $ 3736.9
Upload a zip of your project folder. The usual coding standards apply.
Goat bento boxes
Cthulhu runs Best Bento Boxes, supplying bento boxes to goat parties, meetings, whatevs. Write a program to work out a price for an event.
There are three sizes:
- Great Goat Gobble Box: $32.95 each
- Medium Mandy's Munch Box: $26.95 each
- Sue's Small Snack Pack: $17.95
There's a delivery fee:
- 10 or fewer boxes: $39.95
- 11 to 20 boxes: $59.95
- More than 20 boxes: Free delivery
Here's some I/O. Assume users make no mistakes.
- Best Bento Boxes
- ==== ===== =====
- How many of each type do you need?
- Great Goat Gobble Box: 1
- Medium Mandy's Munch Box: 1
- Sue's Small Snack Pack: 1
- Boxes: $ 77.85
- Delivery: $ 39.95
- Total price: $ 117.8
More:
- Best Bento Boxes
- ==== ===== =====
- How many of each type do you need?
- Great Goat Gobble Box: 10
- Medium Mandy's Munch Box: 10
- Sue's Small Snack Pack: 10
- Boxes: $ 778.5
- Delivery: $ 0
- Total price: $ 778.5
Round the total to two decimal places. (Leaving off cents if it's zero is OK.)
Upload a zip of your project folder. The usual coding standards apply.
Bouc Bus
Philippe Fallop, by Teagan
Philippe Fallop runs Bouc Bus, a French goat bus company. Write a program to price a bus trip, based on the number of goats, and the length of the trip.
Philippe has three buses:
- La petite carotte, seats up to 10 goats. Bus fee is €250, plus €4.80 per kilometer.
- La moyenne oignon, seats up to 40 goats. 🚌 fee is €375, plus €7.50 per kilometer.
- La grosse patate, seats up to 80 goats. 🚍 fee is €525, plus €9.20 per kilometer.
- La infini racine de yucca, seats as many goats as you want. 🚎 fee is €39,345,231, plus €1,332 per kilometer.
Here's some sample I/O:
- Bouc Bus
- - - - -
- How many goats on the trip? 1
- How far is the trip (kilometers)? 1
- Bus: La petite carotte
- Bus fee: 250
- Distance fee: 4.8
- - - - - - - - - - - - -
- Total: 254.8
More:
- Bouc Bus
- - - - -
- How many goats on the trip? 15
- How far is the trip (kilometers)? 120
- Bus: La moyenne oignon
- Bus fee: 375
- Distance fee: 900.0
- - - - - - - - - - - - -
- Total: 1275.0
One more. When La infini racine de yucca is used, output a warning, as seen below.
- Bouc Bus
- - - - -
- How many goats on the trip? 1000
- How far is the trip (kilometers)? 1233
- Bus: La infini racine de yucca
- Bus fee: 39345231
- Distance fee: 1642356.0
- - - - - - - - - - - - -
- Total: 40987587.0
- WARNING! Time distortion is not covered by insurance.
Other things:
- Assume users make no input errors. That's later in the course.
- Add comments for IPO.
- Remember the warning when selecting La infini racine de yucca.
Upload your solution here, not to Moodle. The usual coding standards apply.
Wellermen
There once was a ship that put to sea
The name of the ship
Was the Billy o' Tea
The winds blew hard
Her bow dipped down
O blow, my bully boys, blow
Huuh!
Soon may the Wellerman come
To bring us sugar and tea and rum
One day, when the tonguin' is done
We'll take our leave and go.
Make a program to take orders for the Weller Brothers, a whaling supply company in New Zealand. We'll only have the most important supplies: sugar, tea, and rum. We'll make the measurement units easier to deal with as well. Because, sanity. They used units like bushels in those days. You wouldn't believe the twisted currency system.
There are bulk discounts.
- Sugar is $1.8 per kilo for less than 10 kilos, $1.6 for less than 50, and $1.4 for 50 or more.
- Tea is $5.2 per kilo for less than 5 kilos, $5.1 for less than 10, and $4.8 for 10 or more.
- Rum is $6.7 per liter for less than 20 liters, $6.4 for less than 50, and $6.2 for 50 or more.
Output the price for each item, and the total.
Also, output "You're gonna need more rum, mate!" if the number of liters of rum is less than the sum of the number of kilos of tea and sugar. E.g., if rum is 20, tea is 12, and sugar is 10, output the message. If rum is 25, tea is 12, and sugar is 10, do not output the message.
I/O sample:
- Weller Bros Order Form
- - - - - - - - - - - -
- How many kilos of sugar? 1
- How many kilos of tea? 1
- How many liters of rum? 1
- Sugar total: 1.8
- Tea total: 5.2
- Rum price: 6.7
- Total price: 13.7
- You're gonna need more rum, mate!
Another:
- Weller Bros Order Form
- - - - - - - - - - - -
- How many kilos of sugar? 10
- How many kilos of tea? 10
- How many liters of rum? 20
- Sugar total: 16.0
- Tea total: 48.0
- Rum price: 128.0
- Total price: 192.0
Notes:
- Assume all user input is correct. Validation is the next part of the course.
- Users might input fractional amounts, like 3.8 kilos.
- Output the blank lines, the underline, and the prompts exactly.
- Add IPO comments.
- Hint: I had a variable named
sugar_price_per_kilo
. You don't have to.
Upload your solution here, not to Moodle. The usual coding standards apply.