Question: 3.19 compute sum of 2 (Individual Assignment) Please help check work 3.19 Compute Sum of 2 (Individual Assignment) This is an Individual Assignment. You must
3.19 compute sum of 2 (Individual Assignment)
Please help check work




3.19 Compute Sum of 2 (Individual Assignment) This is an Individual Assignment. You must complete this assignment on your own. - Do not collaborate or share code with other students. - Do not copy and paste code from anywhere. - Do not use any resources outside of those provided in the course materials. - Do not use any language features that have not been covered to this point in the course materials. - If you get stuck or need help, please use only the help systems provided in this course. Required Skills Inventory - Declare a variable - Use math operators to construct an expression - Store a value in a variable Problem Description and Given Info Complete a Java program that takes two numbers as the inputs, and computes and outputs the sum of the two inputs. Here is an example of what the user should see when the program runs. Be sure to read and understand the code that you are given for this assignment below. You will be adding only two lines of code to complete this Java program. Add the two required lines where indicated by the comments in the code you are given. The first line you will add will declare a variable named total of data type int. The second line you will add will compute the sum of the two values that the user inputs, and then store this value in the variable named thetal. Make no other changes to the code you are given for this assignment. When you are finished adding the two required lines of code, be sure to Run and test your program before you Submit your program for the auto-grader to score. If the auto-grader does not give you all 100 points, then be sure to carefully read the auto-grader feedback. You can correct your code and re-run and test and re-submit as many times as you like before the due date. The score for your last submission will be recorded in the grade book. ComputeSum.java Load default template. import java.util.Scanner; public class Computesum \{ public static Noid main(String[] args) \{ // declare and instantiate a Scanner object to collect user input Scanner scnr = new Scanner(System. in); // collect the first number from the user. System.out.print("Enter first number : "); int firstNumber = scnr. nextInt () ; // collect the second number from the user. System.out.print("Enter second number : "); int secondNumber =scnr. nextInt(); I/ Below this comment: write a single Java statement to declare a variable named total of data type int. ComputeSum.java Load default template. System.out.print("Enter first number : "); int firstNumber = scnr. nextInt(); // Collect the second number from the user. System.out.print("Enter second number : "); int secondNumber = scnr.nextInt(); // Below this comment: write a single Java statement to declare a variable named total of data type int. // Below this comment: write a single Java statement to compute the sum of the two numbers inputted above, // and store the result in a variable named total. // Display the sum of the two input values. System.out.println("The sum is: " + total); \}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
