CS46A Fall 18

9A

Write a SimpleLineArrayManager class which manages SimpleLine objects. A SimpleLine represents a line in 2-d space. It is simpler than the one in the graphics library. Copy it into your project. You can look at the documentation for the class by opening the class in the editor window. On the right-hand side where it says "Source Code", click the down arrow and select "Documentation."

The SimpleLineArrayManager has an instance variable SimpleLine[]. Call the instance variable lines. Its constructor takes an array of SimpleLine objects as a parameter

Provide these method

Provide Javadoc

For the draft, define the instance variable, implement the constructor and the sum method

9A draft:
9A final:

9B

You are going to to work with a partially filled array in this problem. Write a class to manage an array of Strings. Call the class GrowableArray. GrowableArray constructor takes no parameters but initializes the array so it can hold 8 elements. Use the constant provided, CAPACITY.

Provide methods:

Hint: The algorithms to implement the methods is explained in your text book

Provide Javadoc

For the draft, implement the constructor and the first add method

9B draft:
9B final:

9C

 Weather.com maintains a table of the average high temperatures by year for various cities. TemperatureTable manages a 2d array of ints representing these temperatures.

The table for 3 years for San Jose might look like this

  2017 2010 2000
Jan 58 59 40
Feb 62 60 45
Mar 66 65 65
Apr 70 72 68
May 75 73 72
Jun 80 81 83
Jul 83 84 90
Aug 82 82 87
Sept 81 80 81
Oct 74 75 71
Nov 65 66 68
Dec 58 56 59

For the South Pole, since the temperatures do not vary much, they only record 3 values per year

  2017 2000
Nov - Feb -17 -15
Mar - Jun -58 -63
Jul - Oct -65 -80

 

The constructor that takes two parameters

Provide the constructor and instance variable.

Provide these methods

For the draft, provide the constructor, instance variables, and the last() method.

9C draft:
9C final: