Your job for program #1 will be to develop software that can predict how busy the roads will be for skiers and those that want to play in the snow so that they can make decisions before leaving Portland and driving to Mount Hood specifically. Drivers will want to know the best route to take, the number of hours it will approximately take them to get there, how long it will take to get home when they are done and if special traction devices will be needed.
Some of the information you will need to keep track of includes:
1. The roads (Highway 26 or Highway 35/84)
a. Current volume on the roads
b. The road conditions (bare pavement, icy, etc.)
c. Where there are accidents
2. How weather will impact the trip
a. On a nice day there will be more cars
b. On a snowy day it will take longer to chain up and cars will head up the mountain that do not have the proper traction devices causing all sorts of problems
Then, select ONE other characteristic to consider in your software:
1. Number of skiers expected at the resorts
2. How full the parking lots at the ski resorts are (including Mt Hood Meadows, Timberline, Ski Bowl, Summit, Cooper Spur, and Snow Bunny) 3. Changes expected in the weather as the day progresses
4. Others?
Once you make a decision about what aspect you want to support - you will want to think about breaking this down into a series of classes and create them independent of the entire problem. Some relationships should be hierarchical, others can be containment. With hierarchies always push the common elements up to the base class. Avoid classes with only setters and getters! And Nodes will need to be classes instead of structs.
Required Data structures This program should implement the following data structures. All traversal functions must be implemented recursively.
1. An array of linear linked lists for the highways surrounding Mt Hood which includes the information about traffic volume and accident location
2. Implement another data structure (of your choice) that represents the user’s journey and the factors that will influence their travel to the mountain and back down when they are done.
Brainstorming (The following are suggestions) The following represents some ideas on the design – the first step is to plan what classes might make the most sense! Some of the basics that are part of an OO program could be:
1. Highways
a. Contains the mile markers where accidents commonly take place and the current status of ice or snow at these points.
b. Contains information as to the amount of delay expected at each of these mile markers
2. Journey
a. My path from home to and from Mt Hood and all of the items that impact that journey
3. Weather
a. Weather that impacts our journey includes if it is sunny, icy, freezing rain, windy or snow-fall and the time impact that such weather influences. A light snow is different than a blizzard. If these are handled by a class, the rest of the code will not need to worry about the details of how weather impacts them.
Anything that is similar between these or other classes that you write should be pushed up to be part of a base class. For example, classes that manage collections of items may be derived from a common base class that manages the collection. Keep classes small and functions small. A large class or function means that the problem has not yet been broken down into its basic components (objects).