Answer:
Replace /* Type your code here. */ with the following lines of code
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 given currencies as integer
<em>int quarter =scnr.nextInt();</em>
<em>int dime = scnr.nextInt();</em>
<em>int nickel = scnr.nextInt();</em>
<em>int penny = scnr.nextInt();</em>
This line calculates the amount in dollars
<em>double dollars = quarter * 0.25 + dime * 0.1 + nickel * 0.05 + penny * 0.01;</em>
The next two lines print the amount in dollars and cents respectively
<em>System.out.printf("Amount: $%.2f\n", dollars); </em>
<em>System.out.print((dollars * 100)+" cents");</em>