Question: Collapse Lesson 3 B - Lab 7 - Change, Please - Data File Input Java Module - Lesson 3 B - Lab 7 - Change,

Collapse
Lesson 3B- Lab 7- Change, Please - Data File Input
Java Module - Lesson 3B - Lab 7- Change, Please
Write a program to "make change" for a double input value, such as 388.97(38897 pennies), to the smallest possible number of bills and coins. Do NOT use half-dollars or two-dollar bills. You must use / and % to mathematically accomplish this task. Run your program a second time to convert the input value 412.42. Make your program run with two sets of data, indented and formatted exactly as shown below.
Hint: Input the money value into a double, multiply the value by 100, cast it into an integer that represents the value in pennies, and then mathematically use / and % in combination (see Lesson 2C) to calculate each denomination.
Data File Input("1ab3B7. in"):
388.97412.42
 Collapse Lesson 3B- Lab 7- Change, Please - Data File Input

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!