Sumofintegers - int sum = a1 b1 c1 if(a1==0||b1==0||c1==0...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
import javax.swing.JOptionPane; public class Sumofintegers { public static void main(String[] args) { String a = JOptionPane.showInputDialog(null,"Enter an integer"); String b = JOptionPane.showInputDialog(null,"Enter an integer"); String c = JOptionPane.showInputDialog(null,"Enter an integer"); int a1 = Integer.parseInt(a); int b1 = Integer.parseInt(b); int c1 = Integer.parseInt(c);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: int sum = a1 + b1 + c1; if(a1==0||b1==0||c1==0) JOptionPane.showMessageDialog(null,"This is the end of the input at least one of the integers equal 0 " + " integer1 = " + a1 + " integer2 = " + b1 + " integer3 = " + c1); else if(a1>0&&b1>0&&c1>0) JOptionPane.showMessageDialog(null,"The sum of the there integers is = " + sum); System.exit(0); }}...
View Full Document

This note was uploaded on 10/04/2010 for the course COMPUTER S 106 taught by Professor Moore during the Spring '08 term at Clark Atlanta.

Ask a homework question - tutors are online