Question: no advance Java like creating sub or superclass or any statements like if for just basic as said in description of the project. Write an

 no advance Java like creating sub or superclass or any statements
like if for just basic as said in description of the project.
no advance Java like creating sub or superclass or any statements like if for just basic as said in description of the project.

Write an application that reads a monetary amount, and then determines the fewest number of each bill and coin needed to represent that amount, starting with the highest (assuming $10 bill is the maximum size needed). Here is a sample run (When user enters 47.63, the corresponding outputs are displayed): Enter monetary amount: 47.63 That's equivalent to: 4 ten dollar bills 1 five dollar bills 2 one dollar bills 2 quarters 1 dimes O nickels 3 pennies Hint: Declare variables at the beginning of a method. In general, all input values, all output values, and important values of processing must be stored. The following list shows variables needed for this project. originalAmount - the original amount, such as 47.63 amountinPennies - the amount in pennies, such as 4763 remainBalance - the current balance after each bill or coin, such as 763 tenDollar- the number of $10 fiveDollar - the number of $S one Dollar - the number of $1 quarter - the number of $0.25 dime - the number of $0.10 nickel- the number of $0.05 penny -the number of $0.01 Division in computer programming can be integer division or floating point number division. If both operands are integers, the result is an integer. If one operand or both operands are floating point numbers, the result is a floating point number. A floating point number division () returns a result (quotient) including decimal part. An integer number division () returns a result (quotient) with decimal part removed. Use Remainder operation (%) to calculate a remainder Division Operation Expression 13/2 13.0/2 13/2.0 13.0/2.0 Result 6 6.5 6.5 6.5 Remainder Operation Expression 13 % 2 13.0 % 2 13 % 2.0 13.0% 2.0 Result 1 1.0 1.0 1.0 Integer division is more efficient in this project. First, convert the monetary amount (a double value) to an equivalent penny amount (an int value), and then use the equivalent penny amount to calculate the fewest number of each bill and coin. For example, if 47.63 is entered the equivalent penny amount should be 4763. 47.63 x 100 returns 4763.0 (a double value). And then remove the decimal part with a (int) cast. Of course, each money measurement must be converted as penny amount. For example, $10 is 1000 pennies: $1 is 100 pennies, and $0 25 is 25 pennies etc. Only one (int) cast is allowed to use. Next, use the equivalent penny amount to calculate the fewest number of $10 bill in a division operation, and then calculate the remaining balance in a remainder operation. The remaining balance should be used to calculate the next number

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!