//
input 3 number , one at a time and print total
// notice that data is input as a string and it must
// be converted to numeric before using it in arithmetic
import java.io.*;
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
public class Application1
{
public static void main(String args[])
{
// declare all variables
int total=0;
int num=0;
int number;
String cur_num;
do {
// all data is
input as String and the converted to int --next 2 commands
cur_num = JOptionPane.showInputDialog("enter a number ");
number = Integer.parseInt(cur_num); // convert to
integer
total=total + number;
num=num+1;
} while ( num < 3);
JOptionPane.showMessageDialog(null,"total is "+total);