Question: CalculationGiven the class Calculationwith variables a and b , create a method getResult ( ) that will calculate and return the sum of the variables
CalculationGiven the class Calculationwith variables a and b create a method getResult that will calculate and return the sum of the variables a and b
import java.io;
import java.util.;
public class CodingQuestions
public static class Calculation
private int a;
private int b;
public Calculationint a int b
this.a a;
this.b b;
DO NOT CHANGE THE CODE ABOVE THIS LINE
Write your getResult method here
end of Calculation class
DO NOT CHANGE THE CODE BELOW THIS LINE
public static void mainString args
Scanner in new ScannerSystemin;
int x innextInt;
int y innextInt;
Calculation z new Calculationx y;
int result zgetResult;
System.out.printlnresult;
end of main
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
