Lab 4: Making Change: Name: __________________
Objective:
Integer division and modulo operations
Instructions
You will write a program that reads monetary value from the user. Your program will then calculate how many dollars, quarters, dimes, nickels, and pennies make up the amount. For example, if the user enters "2.33", your program will print, "2 dollars, 1 quarter, 0 dimes, 1 nickel, 3 pennies."
- Note that the user will be entering a decimal value
- You do not have to print the values on the same line, nor do you have to differentiate between singular and plural.
- The Objective gives s clue as to how to solve this problem.
Getting Started
-
Create a project called Change
-
Import the files from R:\Ap Java\Projects\Lab 4 Change.
-
Edit the file Change.java
-
Change the revised comment to include your own name
Assignment
-
Follow the brief instructions in the comments of the program.
Extra Credit
- Omit printing the number of coins if the value is 0
Wrap-up
-
Print the source code
-
Turn in the printout with your grading sheet.
Project Grade
|
|
Points
|
Extra
|
Correct
|
Incorrect
|
Notes |
|
Input
|
2
|
|
|
|
|
|
Change calculation
|
6
|
|
|
|
|
|
Omit 0 amount of coins
|
+2
|
|
|
|
|
|
|
|
|
|
|
|
|
Total
|
10
|
|
|
|
|
Notes
-
Comments (0)
You don't have permission to comment on this page.