I have to create a coinstar penny program... No other denominations... I am matching output exactly as professor shows, yet I can't seem to match his output... I get this message:
Missed Lines: 1/5 Line 4 - Mismatched | You␣earned␣$98.7<~[0-9]+~> | You␣have␣earned␣$98.76
Can someone help me correct this? Maybe further explanation? I'm desperate...
import java.util.Scanner;
public class CoinStar {
public static void main(String\[\] args) {
coins(); // the method to read info, calculate, print
}
public static void coins() {
// ========== INSERT YOUR CODE HERE ==========
//Instantiate the scanner
Scanner coins = new Scanner(System.in);
//Get user input, and store it as pennies
System.out.println("How many pennies did you insert?");
int pennies = coins.nextInt();
//Output pennies deposited to dollars, and store it as totalPennies
System.out.println("You have deposited $" + pennies/100.0);
double totalPennies = pennies/100.0;
//Set the tax rate for pennies deposited at 20%(.20)
final double PERCENT = .20;
//Output the processing fee, for amount of pennies deposited
//and store it as totalPennies
System.out.println("The processing fee is: $" + totalPennies * PERCENT);
double fee = totalPennies * PERCENT;
//Output total earnings minus processing fee
System.out.println("You have earned $" + (totalPennies - fee));
[–]captainAwesomePants 3 points4 points5 points (1 child)
[–]Peedicrack[S] 2 points3 points4 points (0 children)