Exercise Set 1
Last updated
Last updated
You are to create a python program that reads three user inputted data:
User's first name (Example: "Marshall")
User's last name (Example: "Park")
User's birth year (Example: 2020)
With the given data, the program will greet the user, state their age, and determine if the user is old enough to drink in Ontario, Canada.
Sample execution of the program:
Solution Code (Link)
Write a program that inputs the number of tiles and then prints out the maximum side length. You may assume that the number of tiles is less than ten thousand.
(Please click on the given link for an in-depth question explanation)
CCC is a Canadian Computing Competition held by University of Waterloo.
Solution Code (Link)
You are to create a program that determines how many paint cans we’d need.
Each plank of the fence requires one paint can.
Your supplier only sells paint cans by the dozen (12) for $14.95.
There are 3 fenced sections, and their length will be denoted by a series of ‘F’ for each fence plank.
Output how many cans you’d need, how many paint cans you have leftover, and how much it would cost.
Solution Code (Link)
The program takes 2 user inputs:
start
→ the amount of money we had before selling cookies
String of b
or c
num_cookies
→ a string of character ‘c’s to denote the number of cookies sold
Example: cccccc
→ 6 cookies!
num_big
→ a string of character ‘b’s to denote the number of big cookies sold
Example: bbb
→ 3 big cookies!
The program should output:
Number of total cookies sold
Profit (which is calculated as profit = sales - cost of cookie)
Cost of Normal Cookie per cookie → $1.25
Cost of Big cookie per cookie → $2.00
To make a normal cookie → $0.50
To make a big cookie → $0.75
Total amount of money after selling cookies
Solution Code (Link)