0% found this document useful (0 votes)
8 views2 pages

Assignment 3 - Floor Division and Modulus Problems

The document outlines an assignment for Computer Science 110 that requires students to create two Python programs from three options: a Distance Units Converter, a Time Converter, and a Coin Counter. Each program must include pseudocode, prompt user input, and utilize modulus and division for calculations. Students are also encouraged to test their programs with various inputs and consider enhancements for user experience.

Uploaded by

Sergio Lombeida
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

Assignment 3 - Floor Division and Modulus Problems

The document outlines an assignment for Computer Science 110 that requires students to create two Python programs from three options: a Distance Units Converter, a Time Converter, and a Coin Counter. Each program must include pseudocode, prompt user input, and utilize modulus and division for calculations. Students are also encouraged to test their programs with various inputs and consider enhancements for user experience.

Uploaded by

Sergio Lombeida
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Computer Science 110

Assignment 3 - (Floor and Modulus Problems)


Instructions

Big Idea 1 – Students will develop and use computational thinking skills
SI 1.1 Break down large, complex problems into smaller, manageable tasks.
Big Idea 2 - Students will develop coding skills
SI 2.1 Create organized plans to solve problems

For this activity, you are required to create TWO of the following application. Design the
pseudocode for your program before you begin.

Option 1: Distance Units Converter


Write a Python program that converts a given distance in centimeters into kilometers,
meters, and centimeters.

Instructions:

• Design the pseudocode for your program.


• The program will prompt the user to input a distance in centimeters.
• It will calculate how many full kilometers, meters, and centimeters make up that
distance.
• Use modulus and division to determine how much distance remains after
converting to larger units.

Code Output Example:

Enter the distance in centimeters: 150345

Kilometers: 1
Meters: 503
Centimeters: 45

Option 2: Time Converter


Write a Python program that converts a given number of seconds into hours, minutes, and
seconds.

Instructions:

• Design the pseudocode for your program.


• The program will prompt the user to input an amount of time in seconds (a positive
integer).
• It will calculate how many full hours, minutes, and seconds are in that amount of
time.
• Use modulus and integer division to determine the remaining seconds after dividing
by minutes and hours.

Hint: How many seconds are in an hour?

Code Output Example:

Enter the time in seconds: 3675

Hours: 1
Minutes: 1
Seconds: 15
Option 3: Coin Counter
You are tasked with writing a Python program that makes change in coins needed for the user. The
program will take an amount in cents as input and calculate how many quarters, dimes, nickels,
and pennies are needed to make up that amount. This program simulates how a cashier might
calculate change for a customer but limits the output to the fewest coins possible for each
denomination.

Instructions:
• Design the pseudocode for your program.
• The program will prompt the user to input an amount in cents (a positive integer).
• The program will calculate the number of quarters (25 cents), dimes (10 cents), nickels (5
cents), and pennies (1 cent) needed to make that amount.
• Output the result to the user in a clear format.

Submission Instructions:
Make sure to test your program with at least five different inputs, including edge cases like 0 and 1
cent.
Submit your Python code file (.py).

Extension activities
How can you format it so that its currency is correctly outputted? $0.00

Could you extend your program to accept decimal formats?

Code Output Example:

Enter the amount in dollars and cents: 24.67


$20 bills: 1
$10 bills: 0
$5 bills: 0
Toonies:2
Loonies:1
Quarters: 2
Dimes: 1
Nickels: 1
Pennies: 2 (or technically 0 as it is out of circulation)

Examples of enrichment ideas for applications:

Consider what components could be added to your application to improve the user experience and
flow.

• More detailed prompts to the user


• More explicit instruction for operation.
• Description feedback is given to the user, so they understand what the results they are
getting are.
• Can you expand the functionality to include additional features?

You might also like