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
Vikki [24]
3 years ago
13

Write a program with total change amount as an integer input that outputs the change using the fewest coins, one coin type per l

ine. The coin types are dollars, quarters, dimes, nickels, and pennies. Use singular and plural coin names as appropriate, like 1 penny vs. 2 pennies. Ex: If the input is: 0 or less, the output is: no change Ex: If the input is: 45 the output is: 1 quarter 2 dimes
Computers and Technology
1 answer:
Anna007 [38]3 years ago
4 0

Answer:.

// Program is written in C++.

// Comments are used for explanatory purposes

// Program starts here..

#include<iostream>

using namespace std;

int main()

{

// Declare Variables

int amount, dollar, quarter, dime, nickel, penny;

// Prompt user for input

cout<<"Amount: ";

cin>>amount;

// Check if input is less than 1

if(amount<=0)

{

cout<<"No Change";

}

else

{

// Convert amount to various coins

dollar = amount/100;

amount = amount%100;

quarter = amount/25;

amount = amount%25;

dime = amount/10;

amount = amount%10;

nickel = amount/5;

penny = amount%5;

// Print results

if(dollar>=1)

{

if(dollar == 1)

{

cout<<dollar<<" dollar\n";

}

else

{

cout<<dollar<<" dollars\n";

}

}

if(quarter>=1)

{

if(quarter== 1)

{

cout<<quarter<<" quarter\n";

}

else

{

cout<<quarter<<" quarters\n";

}

}

if(dime>=1)

{

if(dime == 1)

{

cout<<dime<<" dime\n";

}

else

{

cout<<dime<<" dimes\n";

}

}

if(nickel>=1)

{

if(nickel == 1)

{

cout<<nickel<<" nickel\n";

}

else

{

cout<<nickel<<" nickels\n";

}

}

if(penny>=1)

{

if(penny == 1)

{

cout<<penny<<" penny\n";

}

else

{

cout<<penny<<" pennies\n";

}

}

}

return 0;

}

You might be interested in
Using the SUM function allows a series of numbers to be 1. Multiplied 2. Subtracted 3 Added 4. Divided
MA_775_DIABLO [31]

Based on the name, i'm gonna go ahead and guess 3. Added.


sum

/səm/Submit

noun

1.

a particular amount of money.

"they could not afford such a sum"

synonyms: amount, quantity, volume More

2.

the total amount resulting from the addition of two or more numbers, amounts, or items.

"the sum of two prime numbers"

synonyms: (sum) total, grand total, tally, aggregate, summation

"the sum of two numbers"


4 0
3 years ago
LinkedIn uses the ________ because regular users access LinkedIn for free but you can upgrade individual upgrades range from $29
zloy xaker [14]

Answer:

freemium revenue model

Explanation:

Freemium revenue model -

According to this model,

It is the stage of the product, which is completely free and accessible by all people or users , is referred to as the freemium revenue model.

This basic level can act as a trial service, which can potentially get paid for various new and advanced service.

It helps the customers to have a jest of the goods or service, and then can insure if they want to have the advanced version of it or not.

Hence, from the given scenario of the question,

Linkedln act as a freemium revenue model.

6 0
3 years ago
How can social media be useful for brand awareness ?
shutvik [7]
It lets them reach out to people on that platform that can advertise their products
4 0
3 years ago
Listening to the audience refers to what in the context of slide presentations
Anit [1.1K]

Answer: D

Explanation: This concept refers to listening for various cues, such as confusion, interest, or boredom.

8 0
3 years ago
Read 2 more answers
When searching for an image on your computer, you should look for a file with which of the following extensions?
posledela
Images use the extension "jpg"
8 0
3 years ago
Other questions:
  • How many generations of computer languages have there been since the middle of the 20th century?
    9·2 answers
  • __________ is when a person feels compelled to acquire and abuse a drug despite the harm it causes him or her personally, and de
    14·1 answer
  • Which of the following patterns should be used for the delimiter to read one character at a time using a Scanner object's next m
    7·1 answer
  • What is a row of data in a database called?<br> Field<br> File<br> Record<br> Title
    10·1 answer
  • What are some effective methods for scrolling? Check all that apply.
    6·1 answer
  • Which statement is LEAST accurate? Select one: a. A common reason for ERP failure is that the ERP does not support one or more i
    14·1 answer
  • Look at (d), is it accurate? ​
    9·2 answers
  • What would this look like if you were to write the pseudocode but for c++?
    5·1 answer
  • Why is a Quality assurance tester needed on a software development team?
    5·1 answer
  • Does anyone know how to permanently delete photos on a dell computer? For my cousin.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!