tegansg / TC-ObjectOrientedProgramingLabs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#Part 1 Rotate Array

###Objectives

  1. To demonstrate your understanding of objects and functions
  2. To demonstrate your understanding of controlling execution
  3. To demonstrate your understanding of access control
  4. To demonstrate your understanding of reusing classes

Overview

Finish the class RotateList in the RotateList package make it subclasse the built-in List class. (Hint extends ?????) Write a function that rotates a list by k elements. For example [1,2,3,4,5,6] rotated by 2 becomes [3,4,5,6,1,2]. The first 2 elements where rotated to the back of the List. If it was rotated by 3 [1,2,3,4,5,6] rotated becomes [4,5,6,1,2,3]. Try solving this without creating a copy of the list. How many swap or move operations do you need?

Unit Test

UML is required Unit test in place before proceeding with code Make sure you test EVERY public method

Instructions

  1. In your unit test class, initialize your custom List with values
  2. In your unit test class call the method that rotates your array

#Part 2 Humans and Superhumans

Objectives

  1. To demonstrate your understanding of objects and functions
  2. To demonstrate your understanding of controlling execution
  3. To demonstrate your understanding of access control
  4. To demonstrate your understanding of reusing classes

Overview

Complete the 'Human' class in the Superpowers Package that has fields for: name, age, gender, occupation, and address. Also create methods for retreiving and outputing this data to screen.

Then create a SuperHuman class and UNIT TEST that subclasses the first with fields for good or bad, hero name, super ability. As before, create methods for retrieving field data and printing to screen.

Unit Test

UML is required Unit test in place before proceeding with code Make sure you test EVERY public method

Instructions

  1. In your unit test initialize a human and superhuman instances
  2. Demonstrate calling methods inherited from Human on your SuperHuman instances

#Part 3 Class Manager

Product Inventory Project

Objectives

  1. To demonstrate your understanding of objects and functions
  2. To demonstrate your understanding of controlling execution
  3. To demonstrate your understanding of access control
  4. To demonstrate your understanding of reusing classes

Overview

Finish the InventoryManager Class in the InventoryManager Package, which manages an inventory of products. Create a product class which has a price, id, and quantity on hand. Then create an inventory class which keeps track of various products and can sum up the inventory value.

Note: Inventory and InventoryManager should not be the same class!!!

Unit Test

UML is required Unit test in place before proceeding with code

Instructions

  1. In your main class initialize your manager and populate your inventory
  2. Demonstrate calling methods on your manager

About


Languages

Language:Java 100.0%