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
Who do we make games for?(single term)
Ket [755]

Answer:

Gamers

Explanation:

5 0
3 years ago
Read 2 more answers
Omar wants to add transitions to his presentation, so he clicks the Transitions tab. Which tasks can he now complete? Check all
ser-zykov [4K]

Answer:

a b c and d

Explanation:

edgunity 2020

7 0
2 years ago
Where is the video card located in a computer?
Rama09 [41]
Video card??????????
3 0
3 years ago
Read 2 more answers
An array of integers named parkingTickets has been declared and initialized to the number of parking tickets given out by the ci
Sedaia [141]

Answer:

Following code will store the largest value in array parkingTickets in the variable mostTickets

mostTickets = parkingTickets[0];

for(int k = 0; k<parkingTickets.length; k++)

{

if(parkingTickets[i]>mostTickets)

{

 mostTickets = parkingTickets[i];

}

}

Explanation:

In the above code segment, initially the number of tickets at first index is assumed as largest value of tickets in array.

Then using a for loop each value in the array parkingTickets is compared with the current mostTickets value.

If the compared value in parkingTickets array is larger than the current mostTickets value. Then that value is assigned to mostTickets.

This process is repeated for all elements in array.

Thus after looping through each element of array the largest value in array will get stored in mostTickets variable.  

6 0
3 years ago
A security technician has been receiving alerts from several servers that indicate load balancers have had a significant increas
djyliett [7]

Answer:The capacity of the servers

Explanation:because is full

6 0
2 years ago
Other questions:
  • What is an example of constructive criticism for an employee who frequently arrives late?
    10·2 answers
  • Variables make it easier to do what?
    10·1 answer
  • Write a program that takes a date as input and outputs the date's season. The input is a string to represent the month and an in
    6·1 answer
  • Knowing what you know about today’s video games, imagine what it would look like if you had to create a modern-day version of Sp
    6·1 answer
  • There is an application which inputs hundred numbers from the user, if user enters a positive number it increments valid numbers
    6·1 answer
  • PLEASE HELP AND FAST!!!!!<br>Which of the following devices uses binary code?
    6·2 answers
  • 1 #include 2 3 int max2(int x, int y) { 4 int result = y; 5 if (x &gt; y) { 6 result = x; 7 } 8 return result; 9 } 10 11 int max
    12·1 answer
  • PLTW IM Chapter 1.2-1.3 i need this please
    9·1 answer
  • You have been asked to investigate a web server for possible intrusion. You identify a script with the following code. What lang
    10·1 answer
  • State four input device that are used for playing gaming programs​
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!