Answer:
Substitute /* Type your code here. */ with these lines:
int quarter =scnr.nextInt();
int dime = scnr.nextInt();
int nickel = scnr.nextInt();
int penny = scnr.nextInt();
double dollars = quarter * 0.25 + dime * 0.1 + nickel * 0.05 + penny * 0.01;
System.out.printf("Amount: $%.2f\n", dollars);
System.out.print((dollars * 100)+" cents");
Explanation:
The next four lines declare the respective coin counts as integers:
int quarter =scnr.nextInt();
int dime = scnr.nextInt();
int nickel = scnr.nextInt();
int penny = scnr.nextInt();
This line computes the total amount in dollars:
double dollars = quarter * 0.25 + dime * 0.1 + nickel * 0.05 + penny * 0.01;
Lastly, the subsequent two lines output the dollar and cents value respectively:
System.out.printf("Amount: $%.2f\n", dollars);
System.out.print((dollars * 100)+" cents");