Guest User

Untitled

a guest
Nov 25th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.14 KB | None | 0 0
  1. /**
  2.  * Write a description of class Act_1_mod here.
  3.  *
  4.  * @author (your name)
  5.  * @version (a version number or a date)
  6.  */
  7.  
  8. //remembering to import before anything is weird.
  9. import javax.swing.*;
  10.  
  11. public class Act_1_mod
  12. {
  13.     public static void main(String []args)
  14.   {
  15.      JFrame frame=new JFrame("Your Name.");
  16.                //claim variables
  17. String myName;
  18.     String myAge;
  19.             String annualPay;
  20.                 //getting info from user...
  21. String Myname= JOptionPane.showInputDialog(frame,"What is your name?");
  22.                 //yay for not parsing!
  23.                 //more infor from user...
  24.     myAge=JOptionPane.showInputDialog("Enter your age.");
  25.             //now parsing :/ input string into int...
  26.            
  27.    myAge int number=Int.parseInt(myAge);
  28.     //even more info from user.
  29. String annualPay=JOptionPane.showInputDialog("Enter desired annual job Salary");
  30.   //parsing string into double
  31.   annualPay double number=Double.parseDouble(annualPay);
  32.  
  33.     System.out.printf("Hello, My name is "+myName+". I am "+myAge+
  34.     "and I hope one day to make "+annualPay+".");
  35. System.exit(0);
  36.  
  37.  
  38.  
  39.  
  40.  
  41. }
  42.  
  43.         }
Add Comment
Please, Sign In to add comment