

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


CoSc 2030 5 December 2020 Computer Science II Fall 2008 page 1 of 2 Programming Project 9a Also consider Programming Project 9b. Due Friday, 5 December 2008 Check a Proposed Solution to an Instance of the Turnpike Problem The Interstate Commerce Commission needs a program that solves the following Turnpike Problem. The solution will be used to monitor the work of the Wyoming Department of Transportation, thereby simplifying the tasks of both governmental entities. This will improve our quality of life and lower our taxes at the federal and state level. So do good work! The Turnpike Problem: Given a list of all distances between turnpike interchanges, determine the mile marker positions of each of the interchanges. Assume one of the interchanges is positioned at mile marker zero. An initial step toward solving the problem is to check proposed solutions. This is the task of this programming project. Write code for two classes, TurnDistSet and TurnLocSet. TurnDistSet stores and manipulates a list of distances between turnpike interchanges. TurnLocSet stores and manipulates a list of turnpike interchange locations. Here is the client code that must be supported by your classes: int main() { TurnDistSet distances; cin >> distances; TurnLocSet mileMarkers; while( cin >> mileMarkers ) { cout << endl << "Locations set" << endl; cout << mileMarkers << endl; if( TurnDistSet( mileMarkers ) == distances )
CoSc 2030 5 December 2020 Computer Science II Fall 2008 page 2 of 2 { cout << " is a solution for Distances set" << endl; } else { cout << " is NOT a solution for Distances set" << endl; } cout << distances << endl; } return 0; } Your classes must implement the constructors, destructors, functions, and methods called by this client code. Turn in a typed report in class on Friday. Your printed report will include: