0% found this document useful (0 votes)
8 views1 page

ENGR 147 Computer Programming Lab 3 v2

The document outlines the requirements for Lab 3 of the ENGR 147 Computer Programming course, which includes adding a validation loop to a previous program and creating a new program to calculate the dollar amount of nickels and dimes. It specifies the use of while loops for input validation and the inclusion of comments in the code. Students are instructed to upload their source code and example outputs to Moodle.

Uploaded by

arora.aariv26
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 views1 page

ENGR 147 Computer Programming Lab 3 v2

The document outlines the requirements for Lab 3 of the ENGR 147 Computer Programming course, which includes adding a validation loop to a previous program and creating a new program to calculate the dollar amount of nickels and dimes. It specifies the use of while loops for input validation and the inclusion of comments in the code. Students are instructed to upload their source code and example outputs to Moodle.

Uploaded by

arora.aariv26
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/ 1

ENGR 147 Computer Programming

Lab 3
27 September 2024

1. Add a validation loop to the program from last week’s lab so that only time values between
0 and 70 inclusive are accepted. Upload to Moodle the source course (.py) and an example
output as shown below.
Sample dialogue

2. Write a program that calculates the dollar amount of a certain number of nickels and dimes.
- Use a while loop with a “keep_going” variable
- Prompt the user to enter the number of nickels.
- Use a second while loop to validate the input, ensuring the number of nickels input is
greater than zero.
- Prompt the user to enter the number of dimes.
- Use a third while loop to validate the input, ensuring the number of dimes input is
greater than zero.
- You can use the following formula to calculate the dollar amount:

- Print a message showing the number of nickels and dimes and the dollar amount, as
shown below. Use an f-string.
- Prompt the user to “keep going”
- Add comments at the start of the program briefly explaining what it does, before the
input statements, before the validation while loops, and before the calculations.
- Upload to Moodle the source code (.py) and an example output as shown below.
Sample dialogue

You might also like