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, 21.06.2019 17:00
In addition to using the icons to adjust page margins, a user can also use
Answers: 1
question
Computers and Technology, 23.06.2019 00:00
What engine component is shown in the above figure?
Answers: 1
question
Computers and Technology, 23.06.2019 18:30
List 3 items that were on kens resume that should have been excluded
Answers: 1
question
Computers and Technology, 23.06.2019 21:00
Will this setup result in what kathy wants to print?
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, 23.04.2021 04:00