Question: note: please use java textpad . here's the exercise 1.2 :- //product.java public class Product{ int arr[]; public Product (int[] arr) { this.arr = arr;

note: please use java textpad .

here's the exercise 1.2 :-

//product.java

public class Product{ int arr[];

public Product (int[] arr) { this.arr = arr; } public int nNumbers(){ int product =1; for( int i=0;i

note: please use java textpad . here's the exercise 1.2 :- //product.java

Adding to the program in Exercise 1.2, design and implement two child classes (of Product) Sum and Difference that that overrides the nNumbers method in the Product class for their own. Using the ProductDriver as a template, create a driver that ask the user if they would like to find the Product, Sum or Difference and of how many numbers, then compute and print. Example Output: Are you looking to find the Sum, Difference, or Product? sum How many integers would you like to find the sum of? 4 Please enter 4 integers: 5 5 4 8 The sum is 23 Are you looking to find the Sum, Difference, or Product? difference How many integers would you like to find the difference of? 2 Please enter 2 integers: 7 8 The difference is -1 Are you looking to find the Sum, Difference, or Product? Product How many integers would you like to find the product of? 3 Please enter 3 integers: 4 5 2 The product is 40

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!