Question: 1. A.) Suppose you have a class named BigClass that contains an array of 10 objects of type Weather which holds data about the weather

1. A.) Suppose you have a class named BigClass that contains an array of 10 objects of type

Weather which holds data about the weather on a specific day. In the constructor for

BigClass, the array gets allocated and filled with ten objects. Draw the memory diagram

for this statement:

BigClass x = new BigClass();

B.) Continuing from problem 1: Suppose each Weather has an instance variable holding the

high temperature (as an integer) for that day and there is a getter named getHighTemp

that returns it. Write a method named getAverageHigh() in BigClass that returns a

double containing the average temperature for the ten days the BigClass object

contains.

C.) Continuing from problem 2: Draw the class diagram for these two classes

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!