good day all,
i am having an issue with running my program, i am not sure where i have gone wrong, i would appreciate it if someone could help me asap.
Thank you
here is what i was instructed to do:
You are to write a program for the DataGimmick wireless data provider company. The company
has three possible plans that consumers can sign up for, as follows:
Package: Monthly Fee: Included MB: Cost Per Additional (up to) 150 MB:
A $9.99 150 14.99
B $24.99 500 12.99
C $39.99 2000 8.99
Note that additional data beyond the “Included MB” may only be bought in increments of 150MB,
even if only a portion as little as 1 additional MB is used.
Your task is to write a program that:
• prompts the user for and reads in the exact number of MB of data they used (which cannot
have a fractional portion).
• prompts the user to enter the letter corresponding to their plan and reads in that plan’s letter.
• prints out the total monthly charge (in dollars and cents) for data usage for that user, based
on what they entered.
here is my code:
import java.util.*; public class DataGimmick { public static void main(String [] args) { public static void main(String [] args) { double cost; int data; double fee; double additional; Scanner myReader = new Scanner(System.in); char A; char B; char C; String option; // Prompt User for the data usage. System.out.print("How Much Data Did You Use?"); data = myReader.nextInt(); // Prompt User for the package plan. System.out.print("Which Plan Are You Using?"); myReader.next(); //Calculate the cost for different packages. if (option A); { fee = (data - 150) / 150; cost = fee * 9.99; } if ((data - 150) % 150 != 0); { additional = cost + 14.99; } if (option = B); { fee = (data - 500) / 500; cost = fee * 24.99; } { if ((data - 500) % 500 != 0); { additional = cost + 12.99; } if (option = C); { fee = (data - 2000) / 2000; cost = fee * 39.99; } if ((data - 2000) % 2000 != 0); { additional = cost + 8.99; } //Print out the total monthly charge for data. System.out.printf("Your bill for the month is $%,.2f\n", cost + additional); } } }