Name: Anonymous 2006-08-31 2:12
I am really new at programming anything, and taking a java class.
so i have a simple request:
What is the information i input to divide the sum of 3 numbers by their product?
this is what i have so far, probably waay off.
import java.util.*;
public class MyFirstProgram
{
public static void main(String[] args)
{
System.out.println("Hello out there.");
System.out.println("I will divide the sum of three numbers by thier product for you.");
System.out.println("Enter three whole numbers on a line:");
int n1, n2, n3, sum, product;
Scanner keyboard = new Scanner(System.in);
n1 = keyboard.nextInt( );
n2 = keyboard.nextInt( );
n3 = keyboard.nextInt( );
sum = keyboard.nextInt(n1+n2+n3);
product = keyboard.nextInt(n1*n2*n3);
System.out.println("The sum of those three numbers is");
System.out.println(sum/product);
}
}
so i have a simple request:
What is the information i input to divide the sum of 3 numbers by their product?
this is what i have so far, probably waay off.
import java.util.*;
public class MyFirstProgram
{
public static void main(String[] args)
{
System.out.println("Hello out there.");
System.out.println("I will divide the sum of three numbers by thier product for you.");
System.out.println("Enter three whole numbers on a line:");
int n1, n2, n3, sum, product;
Scanner keyboard = new Scanner(System.in);
n1 = keyboard.nextInt( );
n2 = keyboard.nextInt( );
n3 = keyboard.nextInt( );
sum = keyboard.nextInt(n1+n2+n3);
product = keyboard.nextInt(n1*n2*n3);
System.out.println("The sum of those three numbers is");
System.out.println(sum/product);
}
}