road trip

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 :

typedef struct attraction


char name[50];

float cost;

int hours;

int minutes;


where all items are contained in the [url removed, login to view] file.

typedef struct node * NODEPTR;

typedef struct node





You'll use NODEs to construct the linked list of attractions for each leg.

typedef struct leg


char originCity[20];

char originState[3];

char destinCity[20];

char destinState[3];

int nights;

int miles;

NODEPTR attractions;


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


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

Veja mais: used structures, string manipulation c, string in data structure, string data structure, programing source code, programing data structures, programing code, program for get programing code error, printed names, php free programing software, node data structure, lists in data structures, lists data structures, lists data structure, list of data structures, list in data structures, list data structures, linked lists in data structures, linked lists data structures, linked list in data structures

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

ID do Projeto: #3020536

Concedido a:


See private message.

$15 USD em 3 dias
(195 Comentários)

4 freelancers estão ofertando em média $22 para esse trabalho


See private message.

$31.45 USD in 3 dias
(79 Comentários)

See private message.

$17 USD in 3 dias
(5 Comentários)

See private message.

$23.8 USD in 3 dias
(1 Comentário)