Title: Static versus Object Oriented Programming
Course: CPS 161: An Intro to Programming with Java - DL MM MASTER

Static versus Object Oriented Programming

In this unit we are going to consider 3 approaches to solving the same problem. The approaches used to solve this problem are:

1. Putting all of your code in "main".
2. Breaking the problem down into methods, but the methods are all static methods
3. Using classes and an object oriented technique for solving the problem.

Click on the following link to see Jack and Jill discuss these approaches:
Jack and Jill discuss 3 approaches to solving a problem

Subdivision problem

In this problem we want to enter the data for all of the parameters for the houses in a subdivision. After all of the parameters have been entered in, we then print out an over all description of the data along with a total cost for building all of the houses in the subdivision.

Each house has the following characteristics:

A Kitchen which has 2 choices for floor type (Tile, Linoleum, Cork), and 3 choices of counter type (granite, formica, cornware). We need the square footage of floor space and the square footage of counter top space.

A house can have any number of rooms. For each room we need to specify the number of windows. We have a choice of 2 flooring types: wood or carpet. We will also need the square footage of floor space.

Costs:

Kitchen costs:

Tile is $9/square-foot
Linoleum is $3/square-foot
Cork is $12/square-foot

Granite is $30/square-foot
Formica is $10/square-foot
Cornware is $14/square-foot

Room costs:

Windows cost $500 per window

Wood is $10/square-foot
Carpet is $4/square-foot

September 19, 2015 1:00 PM