Question: This program inputs three numbers from a user, calculates the sum of the numbers, and prints the answer. Match the items below based on the

This program inputs three numbers from a user, calculates the sum of the numbers, and prints the answer. Match the items below based on the following code. Assume that the user enters a 10 for the first number, a 20 for the second number and a 30 for the third number:
public class sumThreeNums
{
public static void main(String[] args)
{
// Create a Scanner object
Scanner input = new Scanner(
System.in);
// Prompt the user to enter three numbers
System.out.print("Enter three numbers: ");
double number1= input, nextDouble();
double number 2= input, nextDouble();
//LINE IS MISSING HERE
double sum = number 1+ number 2+ number 3 ;
System.out.print("Sum =+ sum);
}
3.
double number 3= input.nextDouble();
Sum =60.0
double sum = number 1+ number 2+ number 3 ;
60
 This program inputs three numbers from a user, calculates the sum

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!