I would like to create a java prob that will request three integers from a users and have it printout the sum and product as such:
the 3 different integers are : 13, 27, 14.
the sum is 54
The product is 4914
Completed
Have i programm the right way:
import java.util.Scanner;
public class Template
{
public static void main(String[] args)
{
// display a welcome message
System.out.println("");
System.out.println(); //print a blank line
// get the input from the user
Scanner sc = new Scanner(System.in) ;
System.out.print("the 3 different integers are: 13, 27, 14");
double subtotal = sc.nextDouble();
// Calculate the discount amount and total
int num1 = 13;
int num2 = 27;
// format and display the result
String message = "The sum is: " + num1 + "\n"
+ "the product is: " + num2 * "\n"
System.out.println(message);
}
}
Thank you