
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Assignment; Class: Introduction to Computer Science II with Laboratory; Subject: Computer Science; University: Baylor University; Term: Spring 2005;
Typology: Assignments
1 / 1
This page cannot be seen from the preview
Don't miss anything!

CIS 1440 Program 8 Due 08/05/ Linked Lists 23:59:
Page 1
Create a linked list of objects that represent points of interest. A header object is not required. In addition to a “Next” pointer, each object will contain a distance (float), a rating (1-5) and a description (char */string). The items for the points of interest will be read from a text file, named “LinkList.txt” in the order given, with one point of interest on each line. Read each item and add it to the end of the list until you encounter EOF. Then print each item, in the order read, one item per line in the following format:
Points of interest in order entered 30.5, 2, Zimbabwe Falls 21.6, 5, The Brazos Belle etc.
Next, sort the items into ascending sequence by distance and print them in the following format:
Points of interest in order by distance 1.1, 4, Computer Science Lab 16.3, 1, Mortimer the Mighty Moose etc.
Print a blank line between the two groups.
Your main program should be called LinkList.cpp, your class definition should be placed in LLClasses.h, and the function implementations should be placed in LLClasses.cpp. Your class should look something like this.
class DataItem { private: float Distance; int Rating; char * Name; public: DataItem * Next; DataItem(char * NewName,int NewRat,float NewDist); float GetDistance(); int GetRating(); char * GetName(); DataItem(); ~DataItem(); DataItem &operator=(const DataItem &Old); DataItem(const DataItem &Old); };