Question: public class Panes 1 Fa 2 4 { public static void main ( String [ ] args ) { String name; String [ ] prompts

public class Panes1Fa24
{
public static void main(String[] args)
{
String name;
String[] prompts = new String[]{ "What is your age? ", "What is your annual income? ",
"What is your name? "};
String[] messages = new String[]{ "Hello, ",". Your age is "," and your income is ",
"End of Program!" };
int age;
String strAge;
double income;
String strIncome;
strAge = JOptionPane.showInputDialog(prompts[0]);
age = Integer.parseInt(strAge);
strIncome = JOptionPane.showInputDialog(prompts[1]);
income = Double.parseDouble(strIncome);
name = JOptionPane.showInputDialog(prompts[2]);
JOptionPane.showMessageDialog(null, messages[0]+ name + messages[1]+
age + messages[2]+ String.format("$%,.2f",income));
JOptionPane.showMessageDialog(null, messages[3[);
System.exit(0);
}
can you fix it please. solve this program
public class Panes 1 Fa 2 4 { public static void

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!