Question: need help testgoodinput wont pass at all only testbadinput will need to pass output package edu.wit.cs.comp1050; import java.util.Scanner; //TODO: document this class public class PA1b
need help testgoodinput wont pass at all only testbadinput will
need to pass output
package edu.wit.cs.comp1050; import java.util.Scanner; //TODO: document this class public class PA1b { /** * Error message to display for any non-negative counts */ public static final String ERR_MSG = " All coin counts must be non-negative!"; // TODO: document this method // TODO: write your code here //Error message to display for any non-negative counts /*method to prompt the user for a count of quarters, dimes, nickels and pennie and convert and output the total amount in dollars and cents */ public static void main(String[] args) { /*declare double variables quarters,dimes,nickels,pennies and totalDollars and initialize totalDollars with 0 */ double quarters; double dimes; double nickels; double pennies; double totalDollars=0; //create an instance of Scanner class named input Scanner input=new Scanner(System.in); //prompt user to enter number of quarters System.out.print("Enter number of quarters:"); //read quarters quarters=input.nextDouble(); //prompt user to enter number of dimes System.out.print(" Enter number of dimes:"); //read dimes dimes=input.nextDouble(); //prompt user to enter number of nickels System.out.print(" Enter number of nickels:"); //read nickels nickels=input.nextDouble(); //prompt user to enter number of pennies System.out.print(" Enter number of pennies:"); //read pennies pennies=input.nextDouble(); //if any of the count is negative,then show the error message if(quarters
} }

Result Comparison X testGoodlnput(edu.wit.cs.comp 1050.tests.PA1bTestCase) Expected 1 Enter number of quarters: Enter number of dimes: Enter number of nickels: Enter nu Actual 1 Enter number of quarters: Enter number of dimes: Enter number of nickels: Ente A F
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
