CurvedSpace Forums: More Java - CurvedSpace Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • {lang:pm_locked} This topic is locked

More Java

#1 {lang:macro__useroffline}   Mrb1 {lang:icon}

  • 2005 Mini Cooper S
  • Icon
  • Group: New Member
  • Posts: 835
  • Joined: 22-January 03

Posted 24 September 2004 - 07:51 PM

CODE
//Project: 2.18
//Date: September 24, 2004
//Programmer:  %*%*%*%

import javax.swing.JOptionPane;

public class Chap2Num4 {
   
   public static void main(String[] args) {
       
       String num1Val;
       String num2Val;
       String num3Val;
       
       int num1;
       int num2;
       int num3;
       int sum;
       int product;
       int average;
       
       num1Val = JOptionPane.showInputDialog("Enter First Number");
       num2Val = JOptionPane.showInputDialog("Enter Second Number");
       num3Val = JOptionPane.showInputDialog("Enter Third Number");
       
       num1 = Integer.parseInt(num1Val);
       num2 = Integer.parseInt(num2Val);
       num3 = Integer.parseInt(num3Val);
       
       sum = num1 + num2 + num3;
       product = num1 * num2 * num3;
       average = product / 3;
       
       JOptionPane.showMessageDialog(null, "Sum" + sum + "\n" + "Product"
       + product + "\n" + "Average" + average);
       
       System.exit(0);
       
   }
   
}

user posted image

Special Quote: A brave general once said, "You tell you men your soldiers. You tell them thats our flag. You tell them no one takes our flag. Tell them to raise it hight so everyone can see it. Now you've got yourself a Castle": The Last Castle

Car of the Week. Next Change: 1/22/05
Car Specs

Year: 2006
Make: Mitsubishi
Model: Eclipse
Trim: GT
Engine: 3.8L V6, 24 valve
Horsepower: 263@5750 hp
Transmission: 6 Speed Manual
Torque: 260 lb-ft @ 4500 rpm
0-60 mph : 5.8 sec.
Redline: 6500 rpm
Top speed: Top speed : 148 mph
More Info: Here

Join Slain Designs SilverSpy's Photoshop Site.
Join xDesignSx My Photoshop tutorial site.
0

Page 1 of 1
  • You cannot start a new topic
  • {lang:pm_locked} This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users