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
Which ergonomic principle helps to maintain good posture?
alina1380 [7]
It’s a keep the neck non-aligned to your spine
3 0
2 years ago
Read 2 more answers
Write a loop that continually asks the user what pets the user has until the user enters stop, in which case the loop ends. It s
Nataliya [291]

Answer:

int counter = 0;
String userInput = "";
while (userInput != "stop") {
print "What pet do you have? ";
userInput = readInputLine();
if (userInput != "stop" ){
counter = counter + 1;
print "\nYou have one ";
print userInput;
print ". Total # of Pets: ";
print counter;
}
}

Explanation:

not sure what programming language you use, therefore the answer is pseudocode but it should give you an idea how to implement a piece of code for this problem.
Also, from the way you described the exercise I'm not sure if you always are supposed to reply with "you have one" + the pet or if you should count how often the same pet was entered.

6 0
1 year ago
The Chart below from Google Trends shows the prevelance of some search terms in the United States between 2004 and the present.
ad-work [718]

The question is incomplete. The complete question could be found here: https://www.coursehero.com/file/p655c1i/a-Maintaining-privacy-of-the-information-stored-in-the-data-set-b-Scalability/

Answer:

B. Generally speaking, since 2009 more people use "red" in their search terms more than they use "blue", "yellow", "green", or "purple."

Explanation:

Based on the data provided in the figure, it can be inferred that the color 'red' was used the most in the search terms compared with the other colors such as purple or green. The other colors were also used in the search terms on google, however, the trend of those that used the color 'red' in the search terms is the highest.

8 0
3 years ago
Convert each of the fo" wing base ten representations to its equivalent binary form a. 6 b. 13 C. d. 18 e. 27
asambeis [7]

Answer:

6=110

13=1101

18=10010

27=11011

Explanation:

A decimal number is converted to binary number by constantly dividing the decimal number by 2 till the number becomes zero and then write the remainders in reverse order of obtaining them.Then we will get our binary number.

I will provide you 1 example:-

18/2 = 9   the  remainder =0

9/2 = 4    the remainder =1

4/2 = 2    the remainder =0

2/2 = 1     the remainder =0

1/2 = 0     the remainder =1

Writing the remainder in reverse order 10010 hence it is the binary equivalent of 18.

6 0
2 years ago
When saving a memo you created in Word, which one of the following extensions is automatically assigned to the document?
VMariaS [17]
What are the options and if it's meaning like when you save something it has .pdf .jpg or .doc after the title then it would be ".doc"
8 0
2 years ago
Other questions:
  • What image format should be used to keep the file size manageable​
    14·1 answer
  • You are the network administrator for a school system. Your boss informs you that she is thinking of implementing a BYOD program
    15·2 answers
  • Describe safe motherhood​
    9·2 answers
  • Complete the function void update (int *a, int *b), which reads two integers as argument, and sets a with the sum of them, and b
    8·1 answer
  • Mac and PC .Which one is better for professional users, and why
    6·1 answer
  • What major criteria must a product or process meet in order to be considered emerging technology?
    6·1 answer
  • Here's a better picture of my pc mouse and keyboard​
    5·2 answers
  • Use the function random.randint to write a program that rolls a 6-sided die 100 times, and prints out all of the rolls.
    8·1 answer
  • Which bits of the address would be used in the tag, index and offset in a two-way set associative cache with 1-word blocks and a
    7·1 answer
  • What is pseudocode? O A way of describing a set of instructions in text form using plain english O A diagrammatic representation
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!