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

  Design static method below to find and return complex number

Given a "Complex" class with all the standard methods for complex numbers, design the static method below to find and return the smallest complex number.

  Responsibilities of job when designing digital portfolio

Do you think that your digital portfolio should depend on the job, title, or industry you are planning or working on getting into? Do task and responsibilities of a specific job matter when designing your digital portfolio?

  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?

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe potential challenge for collaboration-it department

Author recommends ways to do this. Describe potential challenge that this type of collaboration might face and explain way of dealing with it.

  Systems analyst modifying the sales order process

Suppose that you are a systems analyst on a project that involves modifying the sales order process. How many do you need to sample if you want 95 percent certainty that you have covered all variations?

  Determine minimum number of element

We wish to find the element x that is in upper half when S is sorted, or in other words element which is greater than median. Determine the minimum number of element comparision required to solve problem ?

  Assessing security risks for determining infrastructure

As part of project to assess security risks for determining infrastructure, you have found that other managers often have various ideas on severity and levels of risk.

  Variety of web-based applications of google account

Google presents a variety of web-based applications/products through accessing Google account from any computer with internet connection.

  Include the terms iterative and recursive query

Describe the process a client would perform to resolve the name yahoo.com. Assume that the full DNS names resolution process must be performed. Include the terms iterative and recursive query

  What ''are the differences between a policy, a standard

What 'are the differences between a policy, a standard, and a practice? What are the three types of security policies? Where would each be used? What type of policy would be needed to guide use of the Web? E-mail? Office equipment for personal use?

  Write dissolve method for three color components

It does this by incrementing (by 1) all three color components (using the above accessor and mutator methods) as well as the alpha component value. Write down dissolve method.

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