Continuously prompts the user for a number

Assignment Help Basic Computer Science
Reference no: EM13165675

Create the logic for a program that continuously prompts the user for a number of dollars until the user enters 0. Pass each entered amount to a conversion method that displays a breakdown of the passed amount into the fewest bills; in other words, the method calculates the number of 20s, 10s, 5s, and 1s needed. While also making certain to use the function prototype above the "using" statement.

I have the flowchart and pseudocode already, I could really use some help with the C++ translation however.

// Pseudocode

// Start

//     Declarations

//       num dollars

//     output "Please enter the a whole dollar amount (no cents!). Input 0 to terminate: "

//     input dollars

//     while ( dollars <> 0)

//       displayBills(dollars)

//       output "Please enter the a whole dollar amount (no cents!). Input 0 to terminate: "

//       input dollars

//     endwhile

// Stop

//

//

//

// displayBills(num dollars)

//     Declarations

//       num ones

//       num fives

//       num tens

//       num twenties

//       num temp

//     twenties = dollars / 20

//     temp = dollars % 20

//     tens = temp / 10

//     temp = temp % 10

//     fives = temp / 5

//     ones = temp % 5

//     output "The dollar amount of ", dollars, " can be represented by the following monetary denominations"    

//     output "     Twenties: ", twenties

//     output "     Tens: ", tens

//     output "     Fives: ", fives

//     output "     Ones: ", ones

// return

Reference no: EM13165675

Questions Cloud

The ieee 754 single precision binary representation : What would be the IEEE 754 single precision binary representation of the floating point value -314159265. 3589 ? Express your final answer as an 8-hex-digit number and explain how your answer was obtained for full credit.
Child process to take the role of the number guesser : Write a program in C that takes a number between 1 and 1024 as input on the command line, and then forks a child process to take the role of the number guesser
Assume that a student table in a university : Assume that a student table in a university database has an index on StudentID (the primary key). and additional indexes on Major, Age, Marital status, and HomeZipCode.
Prepare a multiple-step income statement for 2010 : Prepare a multiple-step income statement for 2010 for Howell Corporation that is presented in accordance with generally accepted accounting principles
Continuously prompts the user for a number : Create the logic for a program that continuously prompts the user for a number of dollars until the user enters 0. Pass each entered amount to a conversion method that displays a breakdown of the passed amount into the fewest bills
Prepare the necessary journal entry : Prepare the necessary journal entry to update the allowance for doubtful accounts assuming that the balance prior to preparing the aging was a credit of $100,000.
Provide reaction mechanisms for the formation byproducts : provide reaction mechanisms for the formation of each of these byproducts and specify whether the mechanisms you write are SN1, SN2, E1, E2, or none of these. explain why you would expect bisulfate to be a good leaving group for substitution or eli..
State radio station broadcasts at a longer wavelength : Which radio station broadcasts at a longer wavelength: 93.9 FM or 104.3 FM? To support your answer, list the actual wavelength values and units for each of these radio stations.
Using an array in java : Using an array in Java - have a list of keywords from a web service and have to print out the list of keywords on the screen with one keyword on each line. This is my code

Reviews

Write a Review

Basic Computer Science Questions & Answers

  The authentication process in a synchronous token system

Describe how the Kerberos authentication process work and outline the main components within the Kerberos environment, their respective functions and the level of security provided by Kerberos. Draw a diagram supporting your explanation Explain..

  Expert systems created-deployed in real-world applications

Expert systems have been created and deployed in many real-world applications to support decision making. Discover one recent case study or academic journal article.

  What is break -even point for upgrades

You have also learned that you can upgrade your CPU to make it 1.4 times as fast for $5,000. Which would you choose to yield the best performance improvemen tfor the least amount of money?

  Determine integer to divide maximum number of partial sums

Now, given sequence, can you determine the integer M (L ≤ M ≤ U) which divides maximum number of partial sums of the sequence?

  Develop an approach that will automatically integrate error

Develop an approach that will automatically integrate error messages and a user help facility. That is, the system would automatically recognize the error type and provide a help window with suggestions for correcting it. Perform a reasonably complet..

  Floating point format has an n-bit frac field

Suppose a floating point format has an n-bit frac field and a k bit exp field. What is the smallest integer that can be represented exactly? Assume that k is large enough not to provide any limitations on the problem. What is the integer for IEEE-754..

  Explaining company-s internal operations

A company's internal operations and its relationship with suppliers and other busienss partners are frequently_________.

  What is the response time for jobs in observed system

We observe a closed system for 30 minutes, during which 1600 tasks are completed, from 12 terminals. Each terminal (source of tasks). What is the response time for jobs in the observed system?

  Compare iso-iec outline with nist documents

Compare the ISO/IEC 27001 outline with the NIST documents outlined in 'Management of Information Security' (by Michael E. Whitman, Herbert J. Mattord).

  Identify people to interview to learn new training activity

Draft a project scope statement for the TIMS system and describe the constraints. She said be specific. Need to identify the people want to interview to learn more about the new training activity, and prepare a list of the questions I will ask.

  Class that tests all the methods in the class

Write a test program for each class that tests all the methods in the class.

  Collecting information for data dictionary

Pproblems generated by going directly to manager with questions regarding data dictionary entries? Describe to the team member how he can better collect information for the data dictionary.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd