For some reason this program will not give me an answer all it says is, Enter the letter of the package you purchased (either A,B, or C.)
When "A" is entered it says, Enter the amount of hours you used.
If any number at all is is entered it says, please enter A,B, or C).
It should give your current charge based on what number you enter.
package internetserviceprovider; import javax.swing.JOptionPane; /** * * @author Home */ public class Main { /** * @param args the command line arguments */ public static void main(String[] args) { char packageLetter; int hoursUsed; int additionalHours = 0; double monthlyFee = 0; double additionalHoursFee; double totalFee; String inputString; inputString = JOptionPane.showInputDialog("Enter the letter of the " + "package you purchased (either A, B, or C.)"); inputString = inputString.toUpperCase(); packageLetter = inputString.charAt(0); inputString = JOptionPane.showInputDialog("Enter the number of hours " + "you used."); hoursUsed = Integer.parseInt(inputString); { if (packageLetter=='A'&& additionalHours > 0 && hoursUsed > 10) { monthlyFee = 9.95; additionalHours = hoursUsed - 10; additionalHoursFee = additionalHours * 2.00; totalFee = monthlyFee + additionalHoursFee; JOptionPane.showMessageDialog(null,"The total charges is $" + totalFee + "."); } if(packageLetter=='B' && additionalHours>0 && hoursUsed>20) { monthlyFee = 13.95; additionalHours = hoursUsed - 20; additionalHoursFee = additionalHours * 1.00; totalFee = monthlyFee + additionalHoursFee; JOptionPane.showMessageDialog(null,"The total charges is $" + totalFee + "."); } if(packageLetter=='C') { totalFee = 19.95; JOptionPane.showMessageDialog(null,"The total charges is $" + totalFee + "."); } else JOptionPane.showMessageDialog(null,"Please enter either A,B, " + "or C)."); } System.exit(0); } }