Question: 1 public class OperationsBetween { 2 / / You must define the following: 3 / / 1 . ) Two private instance variables, min and

1 public class OperationsBetween {
2// You must define the following:
3//1.) Two private instance variables, min and max
4//
5//2.) A constructor which takes initial values for
6// min and max
7//
8//3.) An instance method named sum, which sums the
9// values between min and max and returns the
10// result. For example, if min =3 and max =5,
11// then this should return 12(3+4+5). If
12// min is greater than max, then this should
13// return 0.
14//
15//4.) An instance method named product, which
16// multiplies the values between min and max and
17// returns the result. For example, if min =6
18// and max =9, then this should return 3024
19//(6*7*8*9). If min is greater than
20// max, then this should return 1. A stub has
21// been provided that simply returns 1; this is
22// just to allow things to compile while you're
23// working on the sum method.

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!