Pages

PA13-APCSA-17-18

Give a girl an Angle and she’ll want an assignment to go with it.

Exercises: Set One

  1. Study the program posted at http://scribbledecobble.blogspot.com/2018/03/angle.html.
    • You will receive a printed copy of the code in the form of a 12-page booklet. Peruse it at your leisure. (I like to read it by a fire while enjoying a hot beverage.)
    • Compiled and execute the program. Observe what it does. Experiment by passing the program various command line arguments. Can you make the program throw an exception or fail in some other way?
  2. Learn about systems of measurement:
  3. Learn about angular measurements:
  4. Extend the Angle superclass:
    • Create a subclass called Turns with units "turns".
    • Create a subclass called Brads that can be used for angles measured in binary radians, also known as binary degrees. Use the string "brads" for the units.
    • Extend the Zygo subclass with a subsubclass called ZygZorQuir. See the subclass DegMinSec for ideas about how you might want to approach this challenge. Use the strings "zyg-zor-quir," "zygo,", "zorch," and "quircits" where appropriate. Use the following definitions:
      • 100 quircits = 1 zorch.
      • 100 zorch = 1 zygo.
      • 100 zygo = 1 turn (one circle or circumference)
    • Extend the Angle superclass or one of its subclasses with yet another class representing another form of angular measurement of your choosing.
  5. Change the standard units of measure used by the Angle class (the pidgin or bridge units) from turns to radians.
  6. Modify the AngleTester class:
    • Enhance the parseAngles class so that it recognizes the commands "complement", "supplement", "conjugate", "reduced", and "reference". Whenever any of these commands appear after an angle measurement in the input, the parseAngle program should produce the Angle object that corresponds to the combination of the angle measure and the new command. For example, the sequence of strings "45" "degrees" "supplement" specifies the angle that is the supplement of a 45 degree angle, i.e. a 135 degree angle.
    • Produce a "REVERSE ORDERED MULTISET" instead of an "UNORDERED MULTISET". Order your angles in non-increasing order by their StdSize() values. (HINT: Use methods provided by Java's Collections API.)
    • Add a new test to the main program. The test data for your test should include include at least one occurrence of each of the new commands. Pass expected output along with your input when calling the smokeTest method.
  7. Provide a new set of expected results for the class Dataset1.
  8. Provide new implementations of Songs.getVerses and Songs.getAvgVerseLength that return pseudo-realistic values for at least one of the songs currently supported by the method Songs.getRefrain.

Assignment due date, submission instructions, and additional notes.

  • This assignment is due by 3:15 pm on Monday, 16 April 2018. No work submitted after that time will be accepted.
    • An electronic copy of your entire program should be emailed to jspurgeon@vcstudent.org. The subject of your message should be Programming Assignment 13.
    • A hardcopy of only the code you created or modified should be submitted via the box in the classroom.
  • You will received two scores for this assignment: one score will be for program literacy; the other score will be for technical accuracy.
  • The last portion of the assignment involving the Songs class (Exercises: Set One, #8) is optional and will be considered for extra credit if and only if the rest of the assignment is completed successfully.