Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.JOptionPane;
- public class Lab3_Ex1
- {
- public static void main (String [] args)
- {
- float x;
- int y;
- char ch1, ch2;
- String name;
- String input;
- name = JOptionPane.showInputDialog( "Enter a name: ");
- inputString = JOptionPane.showInputDialogSystem.out.print( "Enter a character: ");
- ch1 = input.charAt(0);
- inputString = JOptionPane.showInputDialogSystem.out.print( "Enter another character: ");
- ch2 = input.charAt();
- inputString = JOptionPane.showInputDialogSystem.out.print( "Enter a number: ");
- y = Integer.parseInt(inputString);
- inputString = JOptionPane.showInputDialogSystem.out.print( "Enter a floating point value: ");
- x = Float.parseFloat(inputString();
- JOptionPane.showMessageDialog(null,"\nch1 = " + ch1);
- JOptionPane.showMessageDialog(null,"y = " + y);
- JOptionPane.showMessageDialog(null, "ch2 = " + ch2);
- JOptionPane.showMessageDialog(null, "Name is " + name);
- JOptionPane.showMessageDialog(null, "x = " + x);
- System.exit(0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement