Question: 23. 17 LAB: Convert to dollars Given four values representing counts of quarters, dimes, nickels and pennies, output the total amount as dollars and cents

23. 17 LAB: Convert to dollars Given four values representing counts of quarters, dimes, nickels and pennies, output the total amount as dollars and cents Output each floating-point value with two digits after the decimal point, which can be achleved as follows System,out.printf("Amount: $t.2f, , dollars); Ex: If the input is: 4. 321 where 4 is the number of quarters; 3 is the number of dimes, 2 is the number of nickeis, and 1 is the number of pennies. the outout is Anount: 71,41 For simplicity, assume input is non-negative. LabProgram.java 1 import java.util. Scanner; 1 import java.util. Scanner; 3 public class LabProgram \{ 4 public static void main(String[ args) \{ 5 Scanner scnr = new Scanner(System. in); / Type your code here. */ 83 Run your program as often as you'd like, before submitting for grading Below, type any needed input values in the first box, then elick Run program and observe the program's output in the second box Enter program input (optional) If your code requires input values, provide them here Program output displayed here
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
