I'm a college student and haven't programmed in a very long time and have never used Java as a source code. I'm taking a beginner Java class and our first project has me stumped. Where I'm having the problem is getting the user input for a Yes or No question by using a character as a variable (Y or N) and then moving into the If/else section of the code.
Thank you in advance for any help
Here is what I've written so far...
public static void main(String[] args) {
Scanner keyBoard = new Scanner(System.in);
//Constants
final double MONTHLY_PLAN = 39.99; //Cost per month
final int ALLOWABLE_MINUTES = 500; // number of minutes per month
final double ADDITIONAL_MINUTE_RATE = .45; //cost of overage minutes
final double TEXT_MSG_PLAN = 15.00; //Cost per month for text messaging
final double TEXT_MSG_RATE = .12; //Cost per text message w/o text plan
final double DATA_PLAN = 20.00; //Cost per month for data
final int ALLOWABLE_DATA = 300; //In Megabytes, overage costs
//User Inputs
int minutesUsed;
int textMessages;
int dataUsage;
char Y,y = 0;
char N,n = 0;
System.out.println("Please enter number of minutes used for the month:");
minutesUsed = keyBoard.nextInt();// user enters minutes used for the month
System.out.println("Do you have a text messaging plan?");
System.out.println("Please enter Y or N");
boolean textPlan = keyBoard.nextBoolean();
if(); //textPlan = Y
//Use TEXT_MSG_PLAN for calculations
else(); //textPlan = N
//Use TEXT_MSG_RATE for calculations
System.out.println("How many texts did you send and recieve?");
textMessages = keyBoard.nextInt();
System.out.println("Do you have a data plan?");
System.out.println("Please enter Y or N");
boolean dataPlan = keyBoard.nextBoolean();
if () //dataPlan = Y
//Use DATA_PLAN for calulations
System.out.println("How many MB of data was used for the month?");
dataUsage = keyBoard.nextInt();
else () //dataPlan = N
//Do not use DATA_PLAN for calculations
//Calculations
//Output