View
 

Lab 4: Making Change (AP)

Page history last edited by Mr. Kretsch 7 months, 3 weeks ago

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

  1. Create a project called Change

  2. Import the files from R:\Ap Java\Projects\Lab 4 Change.

  3. Edit the file Change.java

  4. Change the revised comment to include your own name

Assignment

  1. Follow the brief instructions in the comments of the program.

Extra Credit 

  1. Omit printing the number of coins if the value is 0

Wrap-up

  1. Print the source code

  2. 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

 
 
 
 
 
 
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3 of 3

Comments (0)

You don't have permission to comment on this page.