-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestPanes.java
More file actions
32 lines (30 loc) · 1.24 KB
/
TestPanes.java
File metadata and controls
32 lines (30 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import javax.swing.JOptionPane;
/** TestScanner implements an application that
Accepts the information of many employees:
Their Age, income and name.
*/
public class TestPanes
{
public static void main(String[] args)
{
String name, inputString;
int age;
double income;
JOptionPane.showMessageDialog(null,"Welcome to the Second Test Scanner class program.");
name = JOptionPane.showInputDialog("\nWhat is your age? [Negative to Stop] ");
age = Integer.parseInt(name);
while(!(age < 0))
{
inputString = JOptionPane.showInputDialog("What is your annual income? ");
income = Double.parseDouble(inputString);
inputString = JOptionPane.showInputDialog("What is your name? ");
JOptionPane.showMessageDialog(null,"Hello, " + name + " your age is " + age +
" and yout income is $" + income);
JOptionPane.showMessageDialog(null,"Welcome to the Second Test Scanner class program.");
name = JOptionPane.showInputDialog("\nWhat is your age? [Negative to Stop] ");
age = Integer.parseInt(name);
}
JOptionPane.showMessageDialog(null,"End of Program!");
System.exit(0);
}
}