I have tried many different ways like compareTo == and making service code all uppercase with the strService and made equalsIgnoreCase to just equals and still not working! help!
here is the whole error message I recieve this is line 49
System.out.println("Enter Your Day Minutes Used: ");
dayMinutes = console.nextDouble();
Exception in thread "main" java.util.InputMismatchException
at java.util.Scanner.throwFor(Unknown Source)
at java.util.Scanner.next(Unknown Source)
at java.util.Scanner.nextDouble(Unknown Source)
at cellphonebill.cellularbill.main(cellularbill.java: 49)
package cellphonebill; import java.util.*; public class cellularbill { public static void main(String[] args) { Scanner console = new Scanner(System.in); final double premiumService = 25.00; final double dayPremiumPerMin = 0.10; final double nightPremiumPerMin = 0.05; final double regularService = 10.00; final double regPerMin = 0.20; double nightMinutes; double dayMinutes; double dayMinutes1; double nightMinutes1; double amountDue; double usedMinutes; double usedMinutes1; int accountNum; String serviceCode; String userName; System.out.println("Enter Your Member Account Number: "); accountNum = console.nextInt(); System.out.println("Enter Your Name: "); userName = console.next(); System.out.println("What Type Of Service Do You Have:(Regular or Premium) "); serviceCode = console.next(); { if (serviceCode.equalsIgnoreCase("premium")) System.out.println("Enter Your Day Minutes Used: "); dayMinutes = console.nextDouble(); if(serviceCode.equalsIgnoreCase("premium")) System.out.println("Enter Your Night Minutes Used: "); nightMinutes = console.nextDouble(); { if (dayMinutes > 75) dayMinutes1 = dayMinutes - 75; else dayMinutes1 = dayMinutes - dayMinutes; } { if (nightMinutes > 100) nightMinutes1 = nightMinutes - 100; else nightMinutes1 = nightMinutes - nightMinutes; } amountDue = (dayMinutes1 * dayPremiumPerMin) + (nightMinutes1 * nightPremiumPerMin) + (premiumService); System.out.println( "Account Number: /r/n" + accountNum + "Service Type: /r/n" + serviceCode + "Minutes Service Used (Day): /r/n" + dayMinutes + "Minutes Service Used (Night):/r/n" + nightMinutes + "Amount Due: " + amountDue); } { if (serviceCode.equalsIgnoreCase("regular")) System.out.println("Enter Your Minutes Used: "); usedMinutes = console.nextDouble(); if (usedMinutes > 50) usedMinutes1 = usedMinutes - 50; else usedMinutes1 = usedMinutes - usedMinutes; amountDue = (usedMinutes1 * regPerMin) + (regularService); System.out.println( "Account Number: /r/n" + accountNum +" Service Type: /r/n" + serviceCode +" Minutes Service Used: /r/n" + usedMinutes +" Amount Due: /r/n" + amountDue); } console.close(); } }