Question: Java ( Q02 ) QUESTION points Swew Type the following program that uses if-else-if to implement a basic calculator. Compile it, find and remove errors,

Java ( Q02 )
Java ( Q02 ) QUESTION points Swew Type the following program that

QUESTION points Swew Type the following program that uses if-else-if to implement a basic calculator. Compile it, find and remove errors, and run it. [ Hint: There are more than 20 errors in this program. ] import java.util.Scanner class javaCalc 1 4 1 8 10. 11. 13 14 15 10. 11 18 static void main(String args) { Double n1, n2, result = 0; Char operator: String fullName, firstName Scanner kb = new Scanner(); System.out.println(Basic Calculator In -): System.out.println(Enter your full name:); String fullName = kb.NextLine(): String firstName = fullName.substring(0, (fullName.indexOf(" ") }); System.out.print.firstName.upperCase).plz eter 2 numbers double nt = kb.NextDouble(); double n2 = kb.NextDouble(); System.out.println("Enter an operator (+ 1.1: "); Char operator = ( kb.Next().charAt(0); if(operator ++): result = n1 + n2; else iffoperator.) : result - n1-n2; else if(operator =") result = n1n2: else if(operator =) : result = n12; else if ( System.out.println(Error! incorrect operator.); return; > System.out.println(n1+""+operator + + n2 result): > 19. 20 21 22 24 25 26 2T 28 30 31. 33 1. Write your corrected Java program (3 Marks] 2. Run your program and input as follows. What is the output: [2 marks] Input = 53.3 and 25.3 for operator /. What is the output = ? Input = 21.5 and 15.5 for operator, What is the output? TTTA T GI CN Ale

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!