Question: Starting from Java 1 A , use JOptionPane ( pg 9 3 ) to ask the user for the same five variables. JOptionPane only returns
Starting from JavaA use JOptionPane pg to ask the user for the same five variables. JOptionPane only returns Strings, so you must convert them to the corresponding data type using parse pg then assign them to the variables. Though not in the book, Boolean.parseBoolean works like the other parse methods. You must enter either true or false when getting the user response. To print the variables, use JOptionPane.showMessageDialog The message can span multiple lines, but a single literal in quotes may not. You should only have one statement to show all the results. Do not show the results individually. All Java programs must have a Class Header and a main Method Header, like Java A UNT
EX:
Name: Prince Humperdinck
Age:
Letter Grade: C
AIS Member: true
Desired Salary:
HintsTips:
Remove the assigned values from Java A then assign them using JOptionPane.
Dont forget to import the JOptionPane package at the start of the program.
Use toUpperCasepg to convert the letter grade to uppercase it goes after the close parenthesis of JOptionPane Then, use charAtpg to convert it to a char it goes after the close parenthesis of toUpperCase
To convert the starting salary to a double, use Double.parseDouble pg to convert the String returned from JOptionPane.
This time, you must rewrite println using JOptionPane.showMessageDialog to display the message.
In the JOptionPane message, use
to put each piece of info on a separate line. Since each variable is on a separate line, you should use labels as shown in the example
Rubric
Doesnt use JOptionPane to allow the user to assign the five variables each
Doesnt use JOptionPane to allow the user to display the five variables each
Code is not formatted correctly
Doesnt do System.exit for JOptionPane
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
