Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Write a description of class Act_1_mod here.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
- //remembering to import before anything is weird.
- import javax.swing.*;
- public class Act_1_mod
- {
- public static void main(String []args)
- {
- JFrame frame=new JFrame("Your Name.");
- //claim variables
- String myName;
- String myAge;
- String annualPay;
- //getting info from user...
- String Myname= JOptionPane.showInputDialog(frame,"What is your name?");
- //yay for not parsing!
- //more infor from user...
- myAge=JOptionPane.showInputDialog("Enter your age.");
- //now parsing :/ input string into int...
- myAge int number=Int.parseInt(myAge);
- //even more info from user.
- String annualPay=JOptionPane.showInputDialog("Enter desired annual job Salary");
- //parsing string into double
- annualPay double number=Double.parseDouble(annualPay);
- System.out.printf("Hello, My name is "+myName+". I am "+myAge+
- "and I hope one day to make "+annualPay+".");
- System.exit(0);
- }
- }
Add Comment
Please, Sign In to add comment