Design and implements a program that asks the User for their name and randomly generates a...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Design and implements a program that asks the User for their name and randomly generates a monetary amount between $0.01 and $500.00. Then determine the least number of dollars (ten dollar bills, five dollar bills, and one dollar bill) and coins (quarters, dimes, nickels and pennies) are needed to represent that amount, starting with the highest. Your program should demonstrate you understanding of variables, data types, assignments, the Random, Math, NumberFormat String, and Scanner classes as well as data conversion (specifically casting) and expressions. Example outputs: What is your name? Clare What is your name? John What is your name? McKenna What is your name? Jane Clare, you have: $1 John, you have: $4 McKenna, you have: Jane, you have: $10 6.41 7.89 $22.90 7.91 $10 1 $10 : 4 $10 2 $10 10 $5 1 $5 1 $5 0 $5 : 1 $1 1 $1 : 2 $1 2 $1 : 2 Quarters: 1 Dimes : 1 Nickels : 1 Pennies 1 Quarters: 3 Dimes : 1 Nickels 0 Pennies 4 Quarters: 3 Quarters: 3 Dimes : 1 Nickels : 1 Dimes 1 Nickels : 1 Pennies : 0 Pennies : 1 Design and implements a program that asks the User for their name and randomly generates a monetary amount between $0.01 and $500.00. Then determine the least number of dollars (ten dollar bills, five dollar bills, and one dollar bill) and coins (quarters, dimes, nickels and pennies) are needed to represent that amount, starting with the highest. Your program should demonstrate you understanding of variables, data types, assignments, the Random, Math, NumberFormat String, and Scanner classes as well as data conversion (specifically casting) and expressions. Example outputs: What is your name? Clare What is your name? John What is your name? McKenna What is your name? Jane Clare, you have: $1 John, you have: $4 McKenna, you have: Jane, you have: $10 6.41 7.89 $22.90 7.91 $10 1 $10 : 4 $10 2 $10 10 $5 1 $5 1 $5 0 $5 : 1 $1 1 $1 : 2 $1 2 $1 : 2 Quarters: 1 Dimes : 1 Nickels : 1 Pennies 1 Quarters: 3 Dimes : 1 Nickels 0 Pennies 4 Quarters: 3 Quarters: 3 Dimes : 1 Nickels : 1 Dimes 1 Nickels : 1 Pennies : 0 Pennies : 1
Expert Answer:
Answer rating: 100% (QA)
import javatextNumberFormat import javautilRandom import javautilScanner public class MoneyCounter p... View the full answer
Posted Date:
Students also viewed these programming questions
-
In accounting, revenue recognition is governed by the principle of when revenue is earned and realized, rather than when cash is received. For revenue to be recognized, certain criteria must be met....
-
What is a branch delay slot and why does it arise? [7 marks] How can branch delays be avoided? If a processor exhibited one branch delay slot how would you reorder (and possibly modify) the...
-
Distributed Systems Einstein has established that there is no universal time. For earth-based computer systems discuss how events might be assiganed a time stamp which is reasonably close to...
-
The given graph is a transformation of one of the six basic functions. Find an equation for the given graph. 10 'y -1 -2 -3 -5 -6 -7 -8 -9 -10 -15 -13 -9 -8 -7 -6 -5 4 3 -2 -1 0 1 2 3 45 -11
-
Chapter 1 suggests that the decision-making processes of investing in assets (buying assets) and of financing assets (raising funds) are two separate and distinct functions of the financial manager....
-
A gold mine with an estimated deposit of 500,000 ounces of gold is purchased for $80 million. The mine has a gross income of $48,365,000 for the year, obtained from selling 52,000 ounces of gold....
-
Both oil and gas are produced from Core Petroleums lease in Oklahoma. Additional information as of 1/1/17: Assuming the lease is fully developed, compute amortization: a. Assuming oil is the dominant...
-
On January 1, 2013, Henderson Corporation retired $500,000 of bonds at 99. At the time of retirement, the unamortized premium was $15,000 and unamortized bond issue costs were $5,250. Prepare the...
-
Question 8 Which of the following is true about transfer prices? For a negotiated transfer price, the minimum price (i.e. the floor) likely increases as the selling department's excess capacity...
-
Q:Question:Write each number in standard notation 0.9??10^(-1)A:Answer:See a step by step answer
-
A test is made of H0 : = 30 versus H1: < 30. The test statistic is z = 1.28. Find and interpret the P-value.
-
Compute the structure constants $f_{147}$ and $f_{458}$ of the algebra of generators of the $\mathrm{SU}(3)$ group.
-
Starting from the relation $\left[H_{i}, E_{\alpha} ight]=\alpha_{i} E_{\alpha}$ and its adjoint, and using the Hermiticity of the Cartan generators, show that the $E_{\alpha} \mathrm{s}$ are...
-
What are the seven bases of power?
-
What are the principal parts of the CIA examination?
-
9 Check my work Futura Company purchases the 79,000 starters that it installs in its standard line of farm tractors from a supplier for the price of $13.30 per unit. Due to a reduction in output, the...
-
Experiment: Tossing four coins Event: Getting three heads Identify the sample space of the probability experiment and determine the number of outcomes in the event. Draw a tree diagram when...
-
Discuss the key features of Section 404 of the Sarbanes-Oxley Act.
-
Which of the following is NOT a requirement in management's report on the effectiveness of internal controls over financial reporting? a. A statement of management's responsibility for establishing...
-
Which of the following is NOT an implication of Section 302 of the Sarbanes-Oxley Act? a. Auditors must determine, whether changes in internal control has, or is likely to, materially affect internal...
Study smarter with the SolutionInn App