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
Aleonysh [2.5K]
3 years ago
8

A cashier distributes change using the maximum number of five dollar bills, followed by one dollar bills. For example, 19 yields

3 fives and 4 ones. Write a single statement that assigns the number of one dollar bills to variable numOnes, given amountToChange. Hint: Use the % operand.
Sample program:
#include
int main(void) {
int amountToChange = 0;
int numFives = 0;
int numOnes = 0;
amountToChange = 19;
numFives = amountToChange / 5;

printf("numFives: %d\n", numFives);
printf("numOnes: %d\n", numOnes);
return 0;
Computers and Technology
1 answer:
posledela3 years ago
6 0

Answer:

The correct program to this question as follows:

Program:

//header file

#include <stdio.h> //include header file for using basic function

int main() //defining main method

{

int amountToChange=19,numFives,numOnes; //defining variable

numFives = amountToChange/5; //holding Quotient  

numOnes = amountToChange%5; //holding Remainder

printf("numFives: %d\n", numFives); //print value

printf("numOnes: %d\n", numOnes); //print value

return 0;

}

Output:

numFives: 3  

numOnes: 4  

Explanation:

In the above program first, a header file is included then the main method is declared inside the main method three integer variable is defined that are "amountToChange, numFives, and numOnes", in which amountToChange variable a value that is "19" is assigned.

  • Then we use the numFives and the numOnes variable that is used to calculate the number of 5 and 1 , that is available in the amountToChange variable.
  • To check this condition we use (/ and %) operators the / operator is used to hold Quotient value and the % is used to hold Remainder values and after calculation prints its value.

You might be interested in
Which of the following is a function of an audio programmer?
olchik [2.2K]

Answer:function of audio programmer

1. The audio programmer at a game development studio works under to integrate sound into the game and write code to manipulate and trigger audio cues like sound effects and background music.

6 0
4 years ago
The only way to print a photo is on a special glossy paper using professional printing services in a store
DaniilM [7]

i believe this is true


8 0
3 years ago
Read 2 more answers
The _____ is the amount of time that the camera lets light in to create the photograph.
andriy [413]

Answer:

Explanation:

2

8 0
3 years ago
Read 2 more answers
A slide titled Alexander Graham Bell. There are 6 bulleted entries on the slide, and there is a lot of text on the slide. There
Tasya [4]

Answer:

The following are design problems associated with the Alexander Graham Bell slide:

The slide contains too much text.

The slide does not have an image or visual aid.

The background makes it hard to read the text.

The slide does not have enough empty space.

Explanation:

8 0
3 years ago
Read 2 more answers
Which command or key combination allows a user to return to the previous level in the command hierarchy?
OLEGan [10]

The correct command is exit.

5 0
3 years ago
Other questions:
  • You manage the IT department at a small startup Internet advertiser. You need to set up an inexpensive system that allows custom
    14·1 answer
  • Which of the following can you do under the fair use exceptions?
    10·1 answer
  • How many bits are required to address a 1mx8 main memory if main memory is byte addressable?
    6·1 answer
  • ______ is a modem standard that uses Lempel-Ziv encoding to compress data. V.22 V.44 V.32bis V.34 RS 232
    15·1 answer
  • Using the program below, explain what the output will be at LINE A. 1 #include 2#include 3#include 4 5 int value - 128; 6 7 int
    11·1 answer
  • What is cell address?​
    9·1 answer
  • While creating a digital portfolio, Harry wants to add documents that authenticate his skills, experience, and knowledge in digi
    11·1 answer
  • One subtask in the game is to ‘refuel a car’. Explain why ‘refuel a car’ is an abstraction.
    13·1 answer
  • Is there actually a difference between left and right twix
    9·1 answer
  • Consider the following code using the posix pthreads api:
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!