1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Kisachek [45]
2 years ago
6

Write a program that tells what coins to give out for any amount of change from 1

Computers and Technology
1 answer:
ipn [44]2 years ago
5 0

Answer:

#include<iostream>

using namespace std;

void computeCoin(int coinValue, int& number, int& amountLeft)

{

number = amountLeft / coinValue;

amountLeft = amountLeft % coinValue;

}

int main()

{

int cents;

int number;

char ch;

do

{

cout << "Enter no of cents. :";

cin >> cents;

while(cents<1 || cents >99)

{

cout << "Invalid cents entered. Re-Enter no of cents. :";

cin >> cents;

}

cout << cents <<" can be given as ";

computeCoin(25,number,cents);

if(number)

cout << number << " quarters ";

computeCoin(10,number,cents);

if(number)

cout << number << " dimes and ";

cout << cents << " penny"<<endl;

cout<< "do u want to continue enter y or n :";

cin >> ch;

}while(ch=='y');

return 0;

}

Explanation:

You might be interested in
Using a pin or password in addition to tpm is an example of what type of authentication?
anzhelika [568]
Considering it is private i would say security?
3 0
3 years ago
A customer in a store is purchasing five items. Design a program that asks for the price of each item, and then displays the sub
kykrilka [37]
What language are you programming in? 

<span>If you are programming in C or C++, you could do something like this: </span>

<span>#include <iostream> </span>
<span>using namespace std; </span>

<span>int main(void) </span>
<span>{ </span>
<span>//declarations </span>
<span>double item1 = 0; </span>
<span>double item2 = 0; </span>
<span>double item3 = 0; </span>
<span>double item4 = 0; </span>
<span>double item5 = 0; </span>
<span>double subtotal = 0; </span>
<span>double total = 0; </span>
<span>double tax = 0; </span>

<span>//Enter Items </span>
<span>cout << "Please enter the price of item 1"; </span>
<span>cin >> item1; </span>

<span>cout << "Please enter the price of item 2"; </span>
<span>cin >> item2; </span>

<span>cout << "Please enter the price of item 3"; </span>
<span>cin >> item3; </span>

<span>cout << "Please enter the price of item 4"; </span>
<span>cin >> item4; </span>


<span>cout << "Please enter the price of item 5"; </span>
<span>cin >> item5; </span>


<span>//Compute subtotal </span>
<span>subtotal = (item1 + item2 + item3 + item4 + item5 + item6); </span>

<span>//Compute amount of tax </span>

<span>tax = subtotal * (.06); </span>

<span>//Compute total </span>

<span>total = subtotal + tax; </span>

<span>//Display subtotal, total, and amount of tax </span>

<span>cout < " The subtotal of the sale is: " << subtotal << endl; </span>
<span>cout < " The amount of sales tax is: " << tax << endl; </span>
<span>cout < " The total of the sale is: " << total << endl; </span>

<span>return 0; </span>

<span>}//end of function main </span>


<span>I know this is a very very basic C++ program but I hope it helps and good luck on your project!</span>
5 0
3 years ago
Which of the following is likely the cause of the bass from a sound system rattling the windows on your car?
Andrei [34K]
The vibration of the sound system
4 0
3 years ago
The entirety of a packet at one Layer becoming the payload section at another is know as?
MA_775_DIABLO [31]
The answer to the question is: encapsulation
8 0
2 years ago
Read 2 more answers
Which ics function records time accounting and procures needed items?
vladimir1956 [14]
It is the finance / administration function that records time accounting and procures the needed items
7 0
3 years ago
Other questions:
  • How do you change between worksheets inside an excel workbook?
    13·2 answers
  • What happens if i receive a text while my phone is off?
    15·1 answer
  • Stores of data that are so vast that conventional database management systems cannot handle them, and very sophisticated analysi
    9·1 answer
  • When it comes to the best possible security for your wireless router, be sure to use WEP encryption to ensure that your transmis
    14·1 answer
  • At Chicago Cubs games, residents across the street from Wrigley Field can watch the game from their apartment windows. Many of t
    14·1 answer
  • What are candid shots? what are posed shots?
    13·1 answer
  • Why do certain words change color in Python?
    6·1 answer
  • What is a cookie? *
    9·2 answers
  • Which tab should a user click to access the Page Borders feature of Word?
    13·2 answers
  • Add me on Fortn!te <br> TsarBacon (imma girl)
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!