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
Get step-by-step solutions from verified subject matter experts
