Question: calcSum ( ) was copied and modified to create calcProduct ( ) . Which line in calcProduct ( ) contains an error? 1 public static

calcSum() was copied and modified to create calcProduct(). Which line in calcProduct() contains an error?
1 public static int calcSum(int a, int b){
2 int s;
3 s = a + b;
4 return s;
5}
6 public static int calcProduct(int a, int b){
7 int p;
8 p = a * b;
9 return s;
10}
Question 50Answer
a.
Line 9
b.
Line 7
c.
Line 8
d.
There are no errors

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 Programming Questions!