dec15


 * Some more theory...**

We'll need to get a few things taken care of to be able to do math on Strings:

//**Converting String data to integer (or double) data:**//

code format="java" String str = JOptionPane.showInputDialog(null, "How old are you?", "Input", 1);

int age = Integer.parseInt(str);

code

code format="java" String str = JOptionPane.showInputDialog(null, "What's your GPA?", "Input", 1);

double GPA = Double.parseDouble(str);

code code format="java" String str = JOptionPane.showInputDialog(null, "What is your GPA?", "Input", 1);
 * //So... if you want to do math on the GPA://**

double GPA = Double.parseDouble(str);

if (GPA == 4) { JOptionPane.showMessageDialog(null, "You have an A", "Grade", 1); } else if (GPA >= 3) { JOptionPane.showMessageDialog(null, "You have a B", "Grade", 1); } else if (GPA >= 2) { JOptionPane.showMessageDialog(null, "You have a C", "Grade", 1); } else if (GPA >= 1) { JOptionPane.showMessageDialog(null, "You have a D", "Grade", 1); } else { JOptionPane.showMessageDialog(null, "You have failed.", "Grade", 1); } code


 * And so... the guessing game**

Using the skills you've learned so far in Java, it's now time to show off what you can do. Write a program that does this:

Main menu:
 * 1) Run Program
 * 2) About the Programmer
 * 3) End Program

//Run the Program:// Ask the user to guess a number between 1 and 20. The user has three tries to guess If the guess is lower than the answer, tell the user that If the guess is higher than the answer, tell the user that At the end of the program, the program will tell the user the correct answer

//About the Programmer:// Display a brief message about the program

//End Program:// um... end the program.

//**Your program must use JOptionPane for all input and output**//

//**Grading:**//
 * Correct use of JOptionPane || 10 ||
 * Main Menu functions correctly || 10 ||
 * Guessing game runs 3x (unless they guess) || 10 ||
 * Guessing game evaluates "too high" and "too low" ...... || 20 ||
 * > **Total .... ** || **50 Points** ||