import java.util.Scanner; import javax.swing.JOptionPane; /** * * @author Adam */ public class Inputting { public static void main(String[] args) { Scanner Scan = new Scanner (System.in); // Creates the Scanner to allow input System.out.print("Enter a Number"); String first = Scan.next(); //System.out.println("you have entered " + first); String Second; // Second Declared as a string Second = JOptionPane.showInputDialog("Enter Another Number"); int num1 = Integer.parseInt (first); int num2 = Integer.parseInt (Second); //System.out.println("you have entered" + Second); System.out.print("What is your Name?"); String name = Scan.next(); String Age; // Age Declared as a String Age = JOptionPane.showInputDialog("Enter your age "); System.out.println( name + " "+ "(Aged" + " " + Age + ")" + "," + "your answer is " + num1*num2 ); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)