CSC 360: Object Oriented Programming II
Fall 2014
Assignments and Handouts
Program template (for grading purposes):
- Program template to see the instructor's expectations with respect to commenting and program structure
Programming assignments:
- Program #1 due Friday, August 29. If you do not know the ArrayList type, see
this brief explanation as well as section 11.11 (pages 430-435) of the textbook. Here is an example program that uses two ArrayLists and various ArrayList methods. Here is my solution to program 1 in case you want to see what I created:
Fighter.java
Weapon.java
Armor.java
Treasure.java
AdventureGame.java
- Program #2 due Monday, September 8. My solution:
Vehicle.java
FlyingVehicle.java
Helicopter.java
Plane.java
GroundVehicle.java
Jeep.java
Tank.java
TroopCarrier.java
Wargame.java
- Program #3 due Monday, September 15. My solution
- Program #4 due Monday, September 29. -- note the extension on this assignment
- Program #5 due Monday, October 6. input file
- Program #6 due Friday, October 17
- Program #7 due Friday, October 31
- Program #8 due Monday, November 10 -- here are the commands for the User program and here is the Person.java program
- Program #9 due Wednesday, November 19
- Program #10 due Friday, December 5
Study guides
Daily homeworks and answers
- Chapter 21: 21.3. My solution: Ch21_3.java
- Chapter 21: 21.4. My solution: Ch21_4.java
- Chapter 21: 21.5, 21.6, 21.7 (combined). My solution: Ch21_5_6_7.java
- Chapter 21: 21.10. My solution: Ch21_10.java
- Chapter 22: 22.1. My solution: Ch22_1.java
- Chapter 22: 22.2. My solution: Ch22_2.java
- Chapter 22: 22.4. My solution: Ch22_4.java
Older exercises:
- Chapter 8: 8.2 (page 330), add mutator methods to set previousClosingPrice and currentPrice, also a method that will take currentPrice and move it to previousClosingPrice and then assign currentPrice to a new currentPrice. My solutions: Stock.java ch8_2.java
- Chapter 8: 8.10 (page 332-333). My solutions: QuadraticEquation.java ch8_10.java
ch8_10_uml.gif
- Chapter 10: 10.3 (page 400). My solutions: MyInteger.java
Ch10_3.java UML
- Chapter 10: 10.11 (page 403). My solutions: Circle2D.java
ch10_11.java
- Chapter 20: 20.4 exercise (page 741). My solution: Ch20_4_Exercise.java
- Chapter 20: 20.3 (page 760). My solution: Ch20_3.java
- Using recursion, write a method that will take a long number and sum the digits together and then sum the sum together until our long consists of a sole digit, return that sole digit sum, for instance 12345 = 1 + 2 + 3 + 4 + 5 = 15 = 1 + 5 = 6. My solution: ReduceToOneDigit.java
- Using recursion, write a method that gets a String and a character and returns the largest character found in the String. Invoke this method by passing the 0th character of the String and the rest of the String, e.g., method(s.charAt(0),s.substring(1)); My solution: FindGreatest.java
- Chapter 14: 14.2 (page 554). My solution: Ch14_2.java
- Chapter 14: 14.3 (page 554). My solution: Ch14_3.java
- Chapter 14: 14.6 (page 555). My solution: Ch14_6.java
- Chapter 14: 14.11 (page 555). My solution: Ch14_11.java
- Chapter 14: 14.13 (page 556). My solution: Ch14_13.java
- Chapter 15: 15.1 (page 591). My solution differs somewhat in that I create an abstract function which computes but does not draw the Polygon. Instead, it can return the computed Polygon to be drawn by another class. In this way we separate the JFrame/JPanel stuff from the abstract class. My solution: Ch15_1.java, Ch15_1_a.java (this is a subclass that extends the abstract class to define the function f(x)=x^2), Ch15_1_b.java (another extended class), and Ch15_1_main.java (a user class to create and draw the actual function).
- Chapter 15: Create a class called ComparableCircles to implement Comparable. Two ComparableCircles will be equal if they have the same x,y coordinate and same raduis. Two ComparableCircles will be compared by compareTo which will determine if one is bigger or smaller than the other by comparing radii. My solution: ComparableCircles.java and ComparableCirclesUser.java
- Chapter 15: Define an interface called Colorizable which will colorize (fill in the interior) of a shape. Then define a base class Square which will define a Square and draw one (without filling it in) and then extend Square to a ColorizableSquare which implements Colorizable. My solution: Colorizable.java (the interface),
Square.java (the base class, it does not implement Colorizable),
ColorizableSquare.java (extends the base class and implements the interface), TwoSquares.java (a user class which creates a Square and a ColorizableSquare and draws them on a JPanel).
- Chapter 12: 12.1 (page 476). My solution: Ch12_1.java
- Chapter 12: 12.5a (page 476). My solution: Ch12_5a.java
- Chapter 12: 12.5b (page 476). My solution: Ch12_5b.java
- Chapter 12: 12.8a (page 477). My solution: Ch12_8a.java
- Chapter 12: 12.14 (page 478). My solution: Ch12_14.java
- Chapter 13: 13.3 (page 509). My solution: Ch13_3.java - without JButtons
- Chapter 13: 13.3 (page 509). My solution: Ch13_3b.java - with JButtons
- Chapter 13: 13.4 (page 509). My solution: Ch13_4.java
- Chapter 13: 13.13 (page 512). My solution: Ch13_13.java
- Chapter 16: 16.4. My solution: Ch16_4.java
- Chapter 16: 16.4. My solution: Variation of Ch16_4 with radio buttons added
- Chapter 16: 16.15. My solution: Ch16_15.java
- Chapter 16: 16.19. My solution: Ch16_19.java
Back to CSC 360 Page
Back to Teaching Page
Back to Richard Fox's Home Page