road trip3

The ObjectiveThis project will give you practice using good design techniques, separate compilation, arrays of structures, command-line arguments, file handling, dynamic memory allocation, string manipulation, and a linked-list implementation of a list ADT. The BackgroundThis project is a trip planner, rather than the trip cost estimator that we wrote in Project 3. It doesn't really do any cost estimating, but will allow you to plan a trip by including a list of attractions, their cost and time necessary to see them to each of the legs of the trip.

If you wanted to do so you could use Project 3 in combination with this project to make yourself a really nice trip planning package. There is not enough time in this course to do so, however. ... A Winter Project ? ;)

The data files for this project are [url removed, login to view] and attractions.dat. [url removed, login to view] is of the same form as the [url removed, login to view] file from project 3, except that cities with multiple words in their names no longer use underscores between the words. Since the planning has been much more careful at this point, many of the origin and destination cities are different (to allow more time to view attractions).

## Deliverables



The TaskYour task is to read the legs of the trip in from the [url removed, login to view] file, and then construct a linked list of attractions for each of the legs of the trip using the information found in the [url removed, login to view] file. Please note that not all legs of the trip will have attractions. Those legs then will have an empty list of attractions and you should print out an appropriate message for those. (See sample output).

the [url removed, login to view] file contains information about each leg of the journey, which includes a city of origin and the destination, the number of days planned to stay at the destination and the number of miles from the origin to the destination of that particular leg.

The [url removed, login to view] file contains the origin and destination city of a leg as a string, the name of an attraction, the cost of that attraction for 2 adults, and the amount of time needed to see that attraction, followed by the three pieces of information for each of the other attractions for that leg and then a line of 5 dashes, -----. Legs of the journey that have no attractions are not in the [url removed, login to view] file.

More details

* You must use the following typedefs and structure definitions : <XMP> typedef struct attraction { char name[50]; float cost; int hours; int minutes; }ATTRACTION; </XMP>where all items are contained in the [url removed, login to view] file. <XMP> typedef struct node * NODEPTR; typedef struct node { ATTRACTION data; NODEPTR next; }NODE; </XMP>You'll use NODEs to construct the linked list of attractions for each leg. <XMP> typedef struct leg { char originCity[20]; char originState[3]; char destinCity[20]; char destinState[3]; int nights; int miles; NODEPTR attractions; }LEG; </XMP>where all of the information except the NODEPTR attractions is given in the [url removed, login to view] file. As before, the number at the beginning of the file is the number of legs found in the file.

* You must build the array of LEGs using [url removed, login to view] and then construct a linked list of attractions for all of the legs that have attractions. You'll notice that the LEG structure now has a NODEPTR called attractions as one of its members. This member is to hold the head of the linked-list of attractions for that leg. Some legs will have an empty list of attractions.

* You must use command-line arguments to get the names of the two data files. Of course, you must check to make sure you've gotten the correct number of arguments.

* You must use dynamic memory allocation for the array of legs and also for each of the nodes used in the linked-lists. You must check after every allocation to make sure that you've gotten the memory and you must also remember to free all of the memory when you are finished using it.

* You are also using C file-handling, so you must make sure that each file is properly openned and you must close each file when you have finished reading from it.

* All error messages should be printed to stderr.

1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.

2) Installation package that will install the software (in ready-to-run condition) on the platform(s) specified in this bid request.

3) Exclusive and complete copyrights to all work purchased. (No GPL, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site).

## Platform

only C based on UNIX and need project in 24 hrs.

Habilidades: Programação C, Programação C#, Engenharia, Linux, MySQL, PHP, Arquitetura de software, Teste de Software, UNIX

Ver mais: use of data structure in programming, used structures, the practice of programming, struct c programming, string manipulation c, string in data structure, string data structure, software for dynamic programming, road to programming, programming techniques, programming structures, programming practice, programming planning and practice, programming head, programming definitions, printed names, practice programming, practice of programming, node programming, node data structure, node based programming, lists in data structures, lists data structures, lists data structure, list of data structures

Acerca do Empregador:
( 18 comentários ) United States

ID do Projeto: #3030451

2 freelancers estão ofertando em média $29 para este trabalho


See private message.

$33.15 USD em 1 dia
(33 Comentários)

See private message.

$25.5 USD em 1 dia
(48 Comentários)