Lab #3 Assignment , CSE 1320 Summer 2010

 

Due Date: See class website for due date

(see instructions on website for how to turn this in - “lab submission info”)

 

Grade value: 13% out of 100% for all grades.

 

Topic objectives:

Linked lists, structs and pointers

Dynamic memory allocation

Files for I/O

Command line parameters

 

 

The goal for this lab is to provide an opportunity for practice of C program development and the C programming topics covered in class. It is assumed that the student is familiar with and can use all the concepts in those chapters. This assignment is designed to practice those concepts by creating a C program.

 

The class instructor and the TAs will have office hours each week when students can come ask for help. See the website for this info.

 

This assignment has an overview section, a task description section, an implementation requirements section, a grading scale, and a deductions section. If there is additional info needed it will be in a miscellaneous section at the end of this lab assignment. Read ALL of the assignment before you start trying to develop the program. You will be required to turn in a DESIGN DOCUMENT before the lab assignment is due. The goal of the design document is to assist you in developing the actual program.

 

This lab assignment looks similar to the previous assignment but it has many differences. Read it carefully and do not assume that everything from the previous lab is the same this time.

 

Be sure to check the DEDUCTIONS section at the end of this assignment to avoid penalties. You may NOT use global variables, the exit command, goto, break (except in a switch), or continue.

 

• -- • -- • -- • -- • -- • -- • -- • -- • -- • -- • -- • -- • -- • -- • -- • -- • -- • -- • -- • -- • -- • -- • -- • --

Lab #3 Problem Statement:

 

As a student as a large university in the Metroplex you have many activities and events that you can choose to attend. These events give you an opportunity to expand your worldview and learn things outside of UTA. However, there are so many of these events that it can be difficult to keep track of all of them. Your goal for this program will be to develop a computer program that helps students learn about art, music, and cultural events that are occurring in DFW that they may wish to attend. This system will be a searchable calendar and database of upcoming events with categories of event types, event city, and other info. Your system will have two main activities – first, a knowledgeable user, such as someone who arranges social events for a group, will input the event data to your system. Once this is done, the system will then become an information provider that a participant user would access to try to find interesting events to participate in.

 

Throughout the course of this semester you will work on your event database. Each lab assignment will build on the previous assignments and will also implement changes to make the system more efficient and so on. Over the semester you will implement a program that can hold data about events such as event name, city, event date ranges, and so on. You will write functions that can retrieve data that matches certain criteria, that can modify the data, that can output the data, and other tasks. For this lab you will be creating a more flexible representation for the components of the event database and adding more functionality.

 

The tasks for this lab assignment #3 will be:

 

¨                  Have the user call the program and pass in the name of the input file as a command line parameter if using file input.

¨                  Introduce the event database to a new user.

¨                  Create a struct type to hold the data for an event, including a pointer to this struct type.

¨                  Create a linked list of structs as the user enters the event data. (This is the knowledgeable user activity.)

¨                  Create and display a screen menu of the following choices for the user. (This is the participant user activity.)

1)      Using the data in the arrays,

A) Search for events by

i. Event type

ii. Event start date

iii. Ticket price

iv. Word

a. Street name

b. Keyword

B) Calculate

1. Cost for purchase of tickets

i. Regular

ii. Member

iii. Student

2. Length of time that an event will be occurring

3. Count the total number of events that are in the event database

C) List all the events that meet a certain criteria

i. In a certain city

ii. Can be reached by specified transportation

iii. Running on a specific date

D) Sort events by

i. City

ii. Date

iii. Ticket price

iv. Name

2) Update the data in the arrays–this will take the user to a submenu for doing updates

3) Add new events - this will take the user to a submenu to add a new event to the list

4) Delete events

5) End the program

* OPTIONAL: Write the program in such a way as to be able to conditionally compile it

a) with debugging turned on or

b) with debugging turned off

 

Each of these tasks is described in more detail below. There are also a number of simplifying assumptions for this lab. Many of these simplifications will be eliminated in later labs.

 

Simplifying assumptions for the lab:

a) Various constants will be given for use in the lab. These constants should be declared in your program using “const” or “DEFINE”

b) All events will have a unique start and end date combinations but the same event code and event name may be used for more than one event. For example, the Ringling Bros. circus may play the same venue once a year and so could be in the database for two different years with the same code and name.

 

 

Task Descriptions:

 

* Introduce the event database to a new user.

 

For this task your system must provide an introduction/welcome screen to the user. The screen should briefly describe what the system will do. You may have the welcome screen stay up for a fixed period of time or you may let the user press a key to continue on with the program. Make sure you tell the user what to do if you want them to press a key.

 

* Create a struct type to hold the data for an event, including a pointer to this struct type.

 

For the lab, the following data will be used:

 

1. Number code representing the event. The event code will be a three digit number where the digit in the hundreds place represents the city where the event is held where the cities use the number code as follows:

1 – Arlington

2 – Fort Worth

3 – Dallas

4 – Grand Prairie

5 – Mansfield

9 – Other city

(see the list at the bottom of this assignment for the lab data giving numbers and events)

 

2. Event type. Specifies the form of the event to occur. The following are the valid event types

C Concert

M Museum exhibit

A Art exhibit

T Theater performance

E Cultural event

O Other

 

3. Event start date consisting of

a. day of the month given as a number

b. month given as a number

c. year given as a 4-digit value

 

4. Event end date consisting of

a. day of the month given as a number

b. month given as a number

c. year given as a 4-digit value

 

5. Transportation available to the event where the best, cheapest, and fastest transportation is recorded

(representing transportation that ARRIVES at event even if it doesn’t leave from UTA)

D – DART rail and bus routes

T – The T, Fort Worth bus routes

R – TRE rail

C – cabs or taxis

A – automobile

B – bicycle

P – pedestrian, walking distance event from UTA

 

6. Regular ticket price

 

7. Member/sponsor ticket price

 

8. Student ticket price

 

9. Name of event as a multiple word string.

 

10. Street address as street number, street name (all one word), and street designator (Ln, Ave, St, etc.)

 

11. Zip code given as a 5-digit value

 

12. A pointer to the struct type to be used as the link for the singly linked list.

 

 

For the lab, a struct data type must be defined to hold all the pieces of data associated with any one event. The name string should be declared as a char *. The data items that go in the struct are described below:

 

The struct must hold the following items:

 

o   Event start day - the integer date of the day the associated event begins. Make sure that the number that is entered is valid, i.e. that it is a meaningful date for that month.

o   Event start month - the integer starting month info for the event. The event month [n] corresponds to event code [n]. Make sure that the event month that is entered is valid, e.g. how many months are there in a year?

o   Event start year - the integer year that the associated event starts. Make sure that the number that is entered is meaningful – since these are supposed to be events people can attend, should the date be in the past?

o   Event end day

o   Event end month

o   Event end year

o   Event type - the one letter code of the event type. Make sure that the character that is entered is valid, i.e. that it is one of the allowed characters.

o   Event transportationbest – theone letter associated with the “best” mode of transportation to get to an event. Make sure that the character that is entered is valid, i.e. that it is one of the allowed characters. The event transportationbest [n] corresponds to event code [n].

o   Event transportationcheapest - the one letter associated with the cheapest reasonable mode of transportation to get to an event. Make sure that the character that is entered is valid, i.e. that it is one of the allowed characters. [“Reasonable” means that it is a sensible way to travel and that it is the cheapest of the sensible ways to travel. For example, it would be cheap but not sensible to walk to Dallas for an event.]

o   Event transportationfastest - the one letter associated with the fastest mode of transportation to get to an event. Make sure that the character that is entered is valid, i.e. that it is one of the allowed characters.

o   Event regular ticket - the amount as a double that it costs for a regular ticket to the associated event. Make sure this amount is not negative but tickets can be free.

o   Event member ticket - the amount as a double that it costs for a member or sponsor to get a ticket to the associated event. Make sure this amount is not negative but tickets can be free.

o   Event student ticket - the amount as a double that it costs for a student ticket to the associated event. Make sure this amount is not negative but tickets can be free.

o   Event street number - an integer to hold this number

o   Event street name - a single word stored in an array with no white spaces as street name with a maximum length of 39 characters to be stored in a char array

o   Event street designator - a single word abbreviation with no white spaces i.e. Ave., St., Ln. with a maximum length of 8 characters in an array

o   Event zipcode - the integer zip code of the event location

o   Event name - a char * pointer to the name string

o   Next event - a struct pointer to another struct

 

 

* Create a linked list of structs as the user enters the event data.

 

The struct data type for events should be defined globally. The actual event variables should be dynamically allocated as needed using pointers and linked into a list that is sorted in order by the event number. The lab must allow the user to enter any number of events into the database.

 

For this lab the user may enter any number of events. The user should NOT give a count of how many events they are entering. [Note for development: start with a small number of events then increase when program is working well ]. When a new event is ready to be entered your program should

allocate a new struct,

then read and store input into that struct in one of the three following ways:

Individual data method,

line of data input method, or

file of lines input method. Once the data for one event has been read in,

then the struct should be linked into the event list in to order sorted by event number from smallest to largest.

This process continues until there is no more input to be given.

 

For the lab, you must implement at least two of the following three methods of input and one of the methods must be file input. The first method will prompt the user for each piece of data about an event individually, the second method will allow the user to input all needed pieces of data about one event on one line, and the third method is to read lines of event data from a data file. When data is being input directly by the user (the individual data or line of data methods), the program should ask the user after each event whether they wish to continue entering data or not and stop when directed by the user. For the file input, the program should stop reading new events when it reaches the end of the file. The three forms of the input and the input data file are described below.

 

Input implementation:

 

Individual data method:

a. Ask the user for the event code (don’t forget to supply a list of names and codes for them.) Read in their number, make sure it is a valid code and then store it in the current struct.

b. Ask the user for the type of event – make sure to give them a list of the event types and abbreviations. Check to make sure it is a valid type. Store this valid character in the struct

c. Ask the user for the month that the event starts. Make sure it is a valid number and then store it in the struct

d. Do the same for the event start day, start year, end month, end day, and end year. Be sure to check for validity of the data. [Note: checking validity where appropriate means to check the value IF there is something to check against. For event year there is a current date to check against. For some items there isn’t anything to check against for this lab except to make sure the size isn’t negative.]

e. For the data values that are letter codes (Event transportation, Event type), ask the user for the data using the single character descriptions (don’t forget to supply a list of abbreviations for them.) Read in their char, make sure it is a valid abbreviation and then store it in the appropriate member of the struct

f. Ask the user for the different ticket prices to the event. Make sure each is a valid value and then store each in the appropriate member of the struct

g. Ask the user for the zip code of the event location. Make sure it is a valid length zip code and store it in the appropriate member of the struct. Do a similar thing for the street number.

h. Ask the user to type in the street name as one single word with no blanks or spaces. Make sure the word is not longer than 39 letters. Store valid names into the member of the struct. Do a similar thing for the street type abbreviation.

i. Ask the user to enter the name of the event as a string. This string should be typed in the normal fashion with blanks between words. Read the string in using the getline function into a buffer of size 512 characters. After the string is read in, find the length of the string and then allocate enough space for the string using the name pointer in the struct. Copy the name string from the buffer into the newly allocated space. The buffer will then be reused when the next name string is read.

 

 

Line of data input method:

Your program may ask the user to enter all the information for one event on the same line. This data would be an integer for event code, ints for event start and end month, day and year, chars for type and transportation, and floats ticket prices. You must tell the user exactly how to enter the line of data. The data for a single event will be entered by the user as values on one line as follows {there must be one space only between the values}:

 

> 150 T 4 6 2010 3 7 2010 B P A 19.00 10.00 15.00 410 Main St. 76010 “Leading Ladies” at Theatre Arlington

 

which represents event 150 (“Leading Ladies” at Theatre Arlington) starting June 4, 2010 and ending July 3, 2010. The best transportation to the event would be by bicycle, the cheapest would be on foot, and the fastest would be by car. The regular ticket price is $19.00, the sponsor ticket price is $10.00, and student tickets are $15.00. The address is 410 Main St. at zip code 76010.

 

Your program will read the first number and store it in the current struct, then read and store the eventtype char in the struct, then read and store the third number in the struct, and so on. Your program should read all the numbers and chars within a single input command. You should use the getline function to read the string at the end of the line. Your program should read in as many lines of input for events as the user gives. There is no maximum number for this lab.

 

File of lines input method:

 

You must implement two options for getting the name of an input file. First, your program must be able to accept a command line parameter for the input file name if desired by the user. Make sure if you do this, that you clearly indicate how to use the command line parameters in your e-mail when you turn in your lab assignment. Second, your program must allow the user to type in a file name and then read from that file.

 

When your user selects file input as the method of entering data, your program should first check to see if the user entered a file name on the command line. If a valid file name was entered, then the program should ask the user if they wish to use the file name that was entered. The user can choose to use the file name already given on the command line or they can enter the name of another data file to use. Once the input file is determined and has been verified, your program will read the data from the file.

 

You must create at least two data files that contains more than 20 lines of event data and you must read the data from either file. To do this requires creating file variables, opening the file and linking it to the file variable, and then reading the data from the file variable using fscanf in the same way that a line of data would be read from the screen. If the file name was entered from the command line, the validity of the file name must be determined before trying to use the file for input. Basically, the two needed commands to create a file variable, infile, and connect it to your data file, lab2data.txt, are:

 

FILE *infile; //declares a new file variable to be used

 

infile = fopen(“lab3data.txt”, “r”); // connects the variable to your data file for “r”eading

 

Since the file will NOT have a count in it then the first line of the file will just be a line of data that would be read with fscanf and getline commands very similar to the Line of data input method commands.

 

Linking structs:

For this lab the user may enter any number of events. The user should NOT give a count of how many events they are entering. [Note for development: start with a small number of events then increase when program is working well ].

 

The user will enter data for one event struct and then that struct will be added to the linked list. After that struct is added to the list, then the user can enter data for another struct. This process is the same even if the data is read from a file. The steps for entering the data and building the linked list are:

 

Determine if there is more event data to be entered and if so, your program should

1) allocate a new struct,

2) read and store input into that struct in one of the three following ways:

Individual data method,

line of data input method, or

file of lines input method

3) link the struct into the event list in to order sorted by event number from smallest to largest.

Loop back to the top to get the next event

 

The list must be BUILT in sorted order by event number. If you build an unsorted list and then sort it into event number order this will deduct points.

 

 

Input verification:

When the user has entered all the desired events, print out all the input event data in an easily readable form, ex. use a table with headings, or columns with headings or rows with labels. It is strongly suggested that this printing be written as a separate function that can be called at any time in the program to print the current contents of the arrays. It is also suggested that a small function be written which will print the name of an event given the event code as input. The function could have a switch or a bunch of if statements in it.

 

* Create and display a screen menu of the following choices for the user.

Once all the data is read into the arrays your program should give the user a screen menu with the following choices: (use any number scheme you wish)

 

i. Search for an event by type

ii. Search for an event by start date

iii. Search for an event by ticket price

iv. Search for an event by street name

v. Search for an event by a keyword in the event name

vi. Calculate cost for X number of people buying Y types of tickets to attend event

vii. Calculate length of time an event will be occurring

viii. Find all events in a certain city

ix. List all events that are running on a given date

x. List all events that can be reached by transportation type Y as

a. Cheapest

b. Fastest

c. Best

xi. Sort events by ticket price

xii. Sort events by city

xiii. Sort events by date

xiv. Sort events by name

xv. List all the events

xvi. Count the number of events and give the count

xvii. Update the data in the list

xviii. Add a new event to the list

xviv. Delete an event from the list

xvv. End the program

 

The search functions should let the user choose the event type or event start date and then look through the list to find the first event that matches that type/date, then print a sentence stating that matching type/date was or was not found and if found, it should also print the code and the name of the event. The type and start date functions should use linear search on the linked list and it is only necessary to return the first event that is found as a match.

 

The ticket price search should ask the user for a type of ticket and a requested price and should return the first result that is identical to the given ticket price or, if no price is identical, then the closest less expensive ticket. The ticket price search should use linear search. For the ticket price function, if one event is found that matches, the program must ask the user if they wish to keep searching for more events that match and then continue searching if the user wants.

 

The street name search should use string compare to test the user’s input street name against the events. The user must enter the name with no blanks and the user’s string must match exactly for the search to find a match. Any search algorithm can be used.

 

The keyword search should use the substring search to determine if the user’s input string is anywhere in an event name. Any search algorithm can be used. If one event is found that matches, the program must ask the user if they wish to keep searching for more events that match and then continue searching if the user wants.

 

The calculate cost function should ask the user for a specific event and then a total number of people who will be buying tickets for this event and then number of people in this group buying each type of ticket. Given these values for the type of tickets they will be buying, calculate the total cost of tickets for the whole group.

 

The calculate length function should ask the user for an event and then determine in years, months, and days how long a particular event will run. As an example, a museum exhibit running from Jan. 1, 2009 to March 10, 2010 would have a length of one year, two months, and 9 days.

 

The find-all-city function should ask the user to enter the desired city (using the city codes) then go through every event and determine if that event occurs in that city and if so, print that event.

 

The list-all-on-a-given-date function should ask the user for a specific date then compare that date to the beginning and end dates of each event to determine if that event will be running on that given date.

 

The find-all-transportation should ask the user to enter the desired transportation (by using the codes) and then should return any event that has that type of transportation listed as the best, cheapest or fastest and should indicate which (best, cheapest or fastest type of transportation) it was. If it was listed as more than one type, then all of the types should be listed.

 

The sort by ticket price function should ask the user which type of ticket price they wish to sort with and then sort the structs. You must use bubble sort on the linked list with a swap function that is called. The swap function must use pointers as its parameters so the two structs being swapped must be passed in by address to the swap function.

 

The sort by city function sorts using the event codes. You may use any sort algorithm.

 

The sort by date function should ask the user if they wish to use start or end dates and then should sort correctly for day, month, and year. You may use any sort algorithm.

 

The sort by name function should use the string comparison function to sort strings alphabetically. For purposes of the sort you can just let them be sorted by the ASCII table and not worry about capital or small letters. You must use the bubble sort algorithm with the linked list.

 

The list events function is the same as the print function described for input verification.

 

The count events function should return a count of the number of events stored in the linked list.

The update option should take the user to a second screen to allow them to update information in the linked list. This screen should ask for a event code from the user and search for that event. Once the correct event is determined give the user a menu of the following options:

 

o        Change Event start month, day, or year

o        Change Event end month, day, or year

o        Change Type

o        Change one of the Transportation values

o        Change one of the Ticket values

o        Change event name

o        Change event address – Street number, street name or street designator

o        Change event zip code

o        Return to main menu

 

For any change the user wishes to make, do the same error checking as in the original data entry section. After each change is made, print all of the event info for the event. [Hint: If you write your data entry section with little functions for each input check then you can reuse them all here.]

 

Add new events to the list:

The add events option should take the user to a second screen to allow them to add information about a new event into the linked list. The user should be allowed to choose whether to enter the new event by individual items or by the line of data method (if both of these are implemented) but NOT by file input. The process to add an event should be just like the process for taking in the events initially. The list should be sorted by event number code before the new element is added and the new event should be put into the list in sorted order. After the new event is added, print the list.

 

Delete events from the list

The delete option should take the user to a second screen to allow them to indicate the information to delete in the linked lists. This screen should ask for an event code from the user and search for that event. Once the correct event is determined, the program should verify again with the user that this is the event they wish to delete. If the user answers yes, the event should be deleted from the list by changing the pointers of the other list elements and then freeing the space of the deleted event. After the event is deleted, print the list.

 

 

When the user chooses “End the program” from the main menu, print a concluding message and then gracefully end the program.

 

Implementation requirements:

 

WRITE A DESIGN DOCUMENT FIRST. The design should include

 

a) all the functions you expect to write,

 

b) brief (one line) descriptions of each function, and

 

c) some indication of which function calls what other functions.

 

The design document may be written as lines of text or as diagrams (such as a diagram that start with the main function at the top and all others below it) or as some combination of those, but it must include the information listed for a), b), and c) above. Each function should accomplish one main purpose and each function at a lower level should have a more specific purpose than the function that calls it. Be sure to include all the functions that are described in this lab assignment. This design documentation will be turned in for the lab and a design will be required to be turned in for Lab 1 and all later labs. See the website for the DESIGN DOCUMENT due date.

 

A Lab #3 Design Document must be turned in in order for your Lab #3 assignment to be graded.

 

The program should use the following data structures:

Struct data type to hold one event with a struct pointer member

Linked list of these structs

Global CONSTANTS for specific and/or maximum values given in this assignment. Constants can be done with

#define or with the const declaration.

 

The program should use the following control structures:

Function calls to perform tasks

A while or for loop to read the input data

If, if-else, nested ifs, or switches to error check and implement the menu options

Recursion for binary search and merge sort

 

The program should NOT use:

global variables

exit

break (unless inside a switch)

continue

any topic not covered in class before the lab DUE date unless approved by the instructor

 

The program should be implemented as a set of functions with a main routine and at least one function for menu operations, at least two for getting input, at least one for printing, and all of the functions listed for the user choices. You may use many more functions than this but you must use at least this many.

 

The program should perform the following actions in the given order:

Declare and initialize the variables

Print a welcome screen for the user that introduces the system

Get the needed input values from the keyboard

Print the appropriate outputs

Let the user enter additional values until the user indicates that they are finished.

 

The program should have a program header which gives, at least, your name, the number of the lab assignment, your class and section, the assignment date, the due date, and a description of the program. If multiple files are used, each file should contain a similar header. See your instructor’s website for SPECIFIC instructions about the program header.

 

Each programmer-defined function, i.e. each function you write, should have a function header similar to those used in the examples in the textbook. This header should include at least the function name, the purpose of the function, and its inputs and outputs.

 

Output requirements:

The program must be run and the output recorded in a script file from OMEGA using the gcc compiler. NO EXCEPTIONS! If you do not know how to create a script file, it is your responsibility to ask the TA, look for help on the class website, or OIT how to use this function.

 

You must add at least 15 real events to the event data (Event code list) given below. The name of the event, the location, the address, the zip code, the start date, end date, and regular ticket price must all be real data. If you can find the member price and student price use those values, otherwise you can make those values up. If there is transportation info for the event, include that real data too (for example, AA Center in Dallas includes info about trains in their event information.) Otherwise you may make up the transportation data for the event.

 

This program must be run with two different sets of test data for the input data. You must create two data sets and run your program with both of them. You may run it two times within a single execution or you may execute the program two different times so that you have a total of two different data sets. The sample data set that you create must meet the guidelines given in the problem definition. The example data at the bottom of the assignment may be used as part of one of the data sets.

 

NOTE ABOUT ERRORS:

 

Programs turned in for credit MUST compile and run without any compilation errors or runtime errors using the gcc compiler on omega. No other compiler may be used for the compilation for credit. No other operating system may be used for the compilation and/or execution for credit.

 

Compilation errors occur while the program is being developed and they prevent the program from compiling correctly. Programs compile correctly when running

 

>gcc myprogram.c

 

gives no error or warning messages.

 

Programs may be turned in for credit when they are partially complete but all completed functions must run without any errors. A program completes without runtime errors if it ends only when the user selects for the program to end and it correctly prints the exit message. Partially complete programs that run correctly for all menu choices will receive partial credit.

 

Any other type of ending is a runtime error or a "crash". A program has a runtime error if it compiles and runs but then crashes in any situation, i.e. if there is any set of choices the user can make that will make the program crash. It is your responsibility to test all possible choices in your program to make sure that none of them cause a runtime error. The goal of creating input test data and running your program with it should be to test all of the various choices in your program to make sure all of them terminate correctly.

 

Labs which have errors in them and do not terminate normally will receive an overall grade of 0 (zero)

 

 

 

Grading scale:

Code: (51%)

Program header and function headers for all functions (2 points)

Comments (line comments and block comments) (5 points)

Modularity (division of the problem into small tasks, each one assigned to its own function and called from main() or from another function when appropriate--do not code the entire program in main!) (2 points)

Style (indentation, consistency, meaningful identifiers, lateral separation of code from line comments, etc.) (2 points)

Quality and correctness of code (simplicity, readability, testability, etc.) (9 points)

Correct declaration of struct type with struct pointer member (4 points)

Correct access of struct members (3 points)

Correct use of external pointers to structs (4 points)

Correct dynamic allocation of memory with struct pointer (3 points)

Correct implementation of required algorithms bubble sort, linear search on linked list (8 points)

Correct function structure as required (4 points)

Proper implementation of data input and input error checking (5 points)

Output: (49%)

User clearly understands what is being requested for input (2 points)

Correct creation of the sorted linked list of structs (8 points)

Search (find) tasks perform correctly (6 points)

Correct linear search on linked lists

Calculate and count tasks perform correctly (4 points)

Sort tasks perform correctly on linked list (8 points)

Add, delete and update tasks perform correctly (8 points)

Input verification shows valid values and list of inputs correctly saved and printed (4 points)

Output gives clear information to explain the values to the user (3 points)

Output contains all the given test data including 10 new events and one additional data set (5 points)

Grading Deductions:

Use of global variables will result in an overall grade of 0 (zero)

Use of the exit, break (not in switch), or continue command will result in an overall grade of 0 (zero)

Labs which have errors in them and do not terminate normally will receive an overall grade of 0 (zero)

Late submission of softcopy of code and/or script file to appropriate TA will result in an overall grade of 0 (zero) without prior instructor approval

Use of C language elements not yet discussed in class by the lab due date will result in potential deduction of points – discuss with instructor before using.

 

Miscellaneous:

 

Event code list:

 

“Leading Ladies” at Theatre Arlington : 150

DaVinci exhibit at FW Museum of Science and History : 201

Mayan art exhibit at Kimball Art Museum : 221

Ansel Adams photography at the Amon Carter Museum : 233

“Greater Things Than These” at Unity Fort Worth : 277

Freedom’s Sisters at Women’s Museum of Dallas : 368

A.R. Rahman at AA Center : 374

"Zing Zang Zoom" Ringling Brothers and Barnum & Bailey Circus at AA Center: 375

"Zing Zang Zoom" Ringling Brothers and Barnum & Bailey Circus at FW Convention Center: 275

 

Example data:

150 T 4 6 2010 3 7 2010 B P A 19.00 10.00 15.00 410 Main St. 76010 “Leading Ladies” at Theatre Arlington

374 C 4 7 2010 4 7 2010 R A A 65.00 1000.00 39.00 1000 AA_Center Blvd. 75219 A.R. Rahman at AA Center

277 T 25 6 2010 27 7 2010 A T A 10.00 0.00 10.00 406 Trail_Lake Dr. 76133 “Greater Things Than These” at Unity Fort Worth

368 M 23 4 2010 4 7 2010 C D A 5.00 0.00 4.00 15 Fair_Park Ave. 75226 Freedom’s Sisters at Women’s Museum of Dallas