subject

Compute change 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 % operator.
import java. util. Scanner;
public class ComputingChange {
public static void main(String[] args) {
Scanner scnr = new Scanner(System. in);
int amountToChange;
int numFives;
int numOnes;
amountToChange = scnr. nextInt();
numFives = amountToChange / 5;
/* Your solution goes here */
System. out. print("numFives: ");
System. out. println(numFives);
System. out. print("numOnes: ");
System. out. println(numOnes);
}
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 18:00
Determine whether the following careers would require training or college.
Answers: 1
question
Computers and Technology, 22.06.2019 23:30
Select all that apply. which of the following are proofreading options included in microsoft word? spell check find replace grammar check formatting check
Answers: 1
question
Computers and Technology, 23.06.2019 03:00
What are the different parts of computer
Answers: 2
question
Computers and Technology, 24.06.2019 11:00
Need fast im timed in a paragraph of 125 words, explain at least three ways that engineers explore possible solutions in their projects.
Answers: 2
You know the right answer?
Compute change A cashier distributes change using the maximum number of five dollar bills, followed...
Questions
question
Mathematics, 09.12.2019 07:31
question
Chemistry, 09.12.2019 07:31
Questions on the website: 13722363