Lab Assignment #3, CSE 1320-001 Fall 2008

 

Due Date:        Mon. Dec 1st at NOON

(see instructions on website for how to turn this in)

 

Grade value;    13% out of 100% for all grades

 

Topic objectives:   File input

                              Bit operations

                              Doubly linked lists

                              Conditional compilation

                              Unions and enumerated types

                              Library functions

                              (and all previous topics)

                             

The goal for this lab is to provide an application of the topics covered in CSE1310 as well as material covered so far in CSE 1320 about the C programming language.   This assignment is designed to practice those concepts by creating a program.   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.

 

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

 

Here at UTA we have lots of opportunities for engineering students to participate in fun, competitive team activities.  You are going to write programs that will capture and analyze data about the teams and the team members.  You’ll probably be surprised at all the things that UTA Engineering students do!

 

Throughout the course of the semester, you will work on developing the team competition data analysis program.  Each lab builds on the previous labs.  For Lab #3 (this lab) you are STILL PROGRAMMING IN C (not C++) will be given some constant data to #include just like Labs #1 and #2 and then you will also have to read in some additional data from a file and from the user (There will really be a file this time. )  Using this data you will perform most of the tasks from Labs #1 and #2 along with some additional tasks all of which are listed below.  You will still need to give the user a menu of choices and to report results from the program.

 

 

 

 

Your tasks for the team program lab #3 will be:  (Still programming in C not in C++)

 

¨              Be able to compile your program in debug mode and in user mode.

¨              Introduce the team data analysis system to a new user.

¨              Create two-dimensional arrays to store student data in and then populate the arrays with data.

1.     Verify that each student is unique OR

2.     If student already in array, put in duplicate student struct into new team row AND

1.     put additional team data into bitfield of both new and existing student struct(s)

¨              Create a doubly linked list for all team info

1.     Put given constant team data into team linked list sorted by team name

2.     Find additional team data from team member array and put into team linked list

3.     Link the team captain in the member array to the team linked list

4.     Read in team data from a file and put into team linked list

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

1) Using the data in the team member array and the team linked list, let the user do the following tasks

i.    Get a list of team competitions that UTA participates in

ii.   Count the number of people on a given team

iii.  List the members of a team

iv.  Find the average GPA of a single team

v.   Sort the members of a single team by last name

vi.  Search for a particular team or team member by name

      a. For the team member, print all competitions that they are in

      b. For the team member, print all teams that they are on

vii. Get a list of all the student teams (by name) that compete in engineering competitions

viii.Find the average age of a single team

ix.  Count the number of students of each class/year (Fr, So, …) on a single team

x.   Find the average GPA of all students who participate on teams

xi.  Sort the members of a single team by student ID number and by GPA

xii. Calculate data about the time needed to participate on each team using a recursive function as described below

xiii.Sort the team linked list by competition and by number of team members

xiv.Search for a particular team member by ID

xv. Search for a particular team by competition or by sponsor

xvi.Find the average age of all students who participate on teams

xvii. Count the number of students of each class/year (Fr, So, …) on all teams

xviii. Calculate amount of time between now and next competition using localtime and time functions

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

3) Add data to the arrays - this will go to a submenu to allow new data to be added

4) End the program

 

 

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

 

Simplifying assumptions for the lab #3:

a) A maximum size for any team (MAXMEMBERS) will be given

b) A maximum number of teams (MAXTEAMS) will be given

c) The given number of team members in the const array is 31 (GIVEMEMBERS) and there are duplicate students, i.e. one student who is on multiple teams.

d) The given number of teams in the const array is 5 (GIVETEAMS)

 

 

Task Descriptions:

 

            Be able to compile your program in debug mode and in user mode.

For this task your program must be conditionally compilable.  You must include debugging code and statements in your program AND you must use preprocessor directives to control whether or not the debugging statements will be compiled and executed in your program.  Every function for this lab must have at least one debugging statement in it, such as “In function SearchMemberID” or some other sort of debugging info.  When your program is compiled in DEBUG mode (#define DEBUG) then all of these debugging statements must show up when the program is executed.  When your program is run in normal mode (without the #define DEBUG statement) then no debugging statements should appear in the output.  You may have multiple levels of debugging if desired.

 

Introduce the team data analysis system 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 two-dimensional array to put student data in and then populate the arrays with data.

For lab #3 you will create a two dimensional array of student structs (just like in labs #1 and #2) that will hold all the team members of each team in the subarrays, i.e. each row is a team and the student struct in each column of that row is a team member.

 

The data to put into this 2D array will be given to you as a constant 1-dimensional array of student structs.  This array will be in a separate data file (C1320F08L3testdata.h) that you will #include at the beginning of your program.  The specification of the array you will be given in the #include file is as follows (Note that the struct has additional members from the struct type in Labs #1 and #2):

 

const struct UTAstdt{

            char *lastname;

            char *firstmidname;

            long int UTAID;

            double cumGPA;

            char major[5];

            char *competition;

            char *teamname;

            int teamslist : 16; //each bit represents a team

            short year;  // 1 =Freshman, 2 =Soph, 3 =Jr, 4 =Sr, 5 =other UG, 7 =MS, 9 =PhD

            char gender;  // M, F or U for Unknown or Unreported

            int age;

            char *role;       // captain, driver, member, engineer, etc.

short joinyear, joinmonth, joinday; // Date the member joined the team

            struct UTAstdt *nextstdt;

}         

const struct UTAstdt giventeammembers[31] =

{

{“Patel”, “Joshua”, 2000457234, 3.245, “CE”, “Steel Bridge”, “Blaze”, 0, 3, M, 20, "engineer", 2007, 10, 20, NULL},

// …another buch of records like this

{“Smith”, “Yan Akiba”, 2000943211, 2.87, “CS”, “ICPC”, “UTA Blue”, 0, 3, U, 20, "member", 2008, 8, 30, NULL}

};

 

You will need to create a two-dimensional array that can hold up to MAXTEAM different teams with a maximum of MAXMEMBERS on each team.  You will then go through the struct data in the giventeammembers array and sort them into the new two-dimensional array by copying each record out of the giventeammembers array and putting each unique team into one row of the two-dimensional array and each member of that team into the same row.  So, for example, if Joshua Patel is the first person in the giventeammembers array then his record would be assigned into the first row of the two-dimensional array.  Then the next record in giventeammembers that was in the Steel Bridge competition would be assigned after Joshua in that row.

 

Every value in each record in giventeammembers should be put into the new two-dimensional array.  The program should verify that the student GPA is valid, i.e. between 0.0 and 4.0 in value.  Any other GPA value should be reset to 0.0 .  The program should also verify that the ID number is between 2000000000 and 2000999999.  Any other ID value should be reset to 1999999999.  The program should verify the class year value as one of the valid values, the age as a positive number, and the gender as one of the valid values.

 

All of the rest of the program will only use the two-dimensional array not the giventeammembers array.   The two-dimensional array will not be full since there are many more spots in the array than there are team members in the constant array. 

 

The bitfield info is updated after the teams linked list is created.

 

Input verification:

When the program has put all of the giventeammembers into the two-dimensional array, it should print out all of the team data in the two-dimensional array at each [indexteam][indexmember] 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 two-dimensional array.

 

Create a sorted doubly linked list for all team info

For lab #3 you will create a DOUBLY linked list of team structs that will hold data for each team.  Some of the data to put into this team linked list will be given to you as a constant 1-dimensional array of team structs.  This array will be in the same data file (C1320F08L3testdata.h) as the student team member data.  The specification of the struct and the constant array you will be given in the file is as follows:  Notice there is now a union and enum to use for results info.

 

enum scoretype {rank, points, percent, category, other};

 

union scoring{

            int rk;

            float pts;

            double pcntg;

            char cat[12];

            long other;

};

 

struct UTAteam{

            char *competition;

            char *teamname;

            int teammask : 16;

            char sponsor[10]; // Dept. or Lab that sponsors the team

            char *advisor;    // Name of faculty or staff advisor

            int compyear;   // Year this team competed in this competition

            int membercount;         // Number of team members

            struct UTAstdt *captain;

            int hrsperwk;  // Minimum hours of time needed per week

            short eventmonth, eventday, eventyear; // Date of competition

            union scoring results; // record last competition or testing results

            enum scoretype resultstype;

            struct UTAteam *prevteam;

            struct UTAteam *nextteam;

};

 

const struct UTAteam giventeams[5] =

{

{"Steel Bridge", "Blaze", 1, "CE", "Dr. Jim Williams", 2008, -1, NULL, 4, 10, 10, 2008, 92.3, points, NULL, NULL},

// … more records like this

{"Imagine Cup", "mUTAte", 16, "GDC", "Dr. Carter Tiernan", 2008, 1, NULL, 2, 31, 1, 2009, 88.0, percent, NULL, NULL}

};

 

You will need to create a doubly linked-list that will hold all the different teams sorted in order by team name.  You will create this list by going through the struct data in the giventeams array and storing the teams into the linked list.  The linked list should be created using the nextteam and prevteam pointers in the struct.  The struct pointer for captain should be set to NULL for all teams initially.

 

For each team in the giventeams array, the first six values are given.  The seventh value (number of team members) may or may not be correct.  Your program should check this value from the giventeams array and do the following: 

If the number of team members is positive, then store it in the linked list; else if it is -1, run the team member counting function (menu choice iv.a. below) and store the result in the linked list as the number of team members. 

 

After all the data from the giventeams array is stored in the linked list, then some additional team verification should be done.  The program (not you directly) should go through the two-dimensional team member array and make sure that every team in the team member array is in the team linked list.  You should have a function that verifies this and adds any teams from the members array to the teams linked list in order if they are not there.  If a team is added to the team linked list the following things should be done:

All character strings for teamname and competition should be treated as pointers and the pointer values assigned to the team linked list not the whole string.

The teammask value should be the next power of two higher than the last given team mask value, i.e. the last teammask for a giventeam is 16 (2 to the power of 4) so the next new team that is found from the teammembers array should have the team mask of 32 (2 to the power of 5) and so on.  (You could save the last mask value somewhere and multiply it as needed by 2 to get the next value.)

If the team data needed is not in the member array (advisor and sponsor) then those values should be found by programmer research (search the UTA website) and then the info should be added to the team linked list (using the add functions – see below also) by allocating space to the advisor and sponsor pointers and storing the new data into these allocated string spaces.

Any team whose year is not given can be assumed to be 2008.

As the program goes through the team member two-dimensional array, it should also find the team member for each team whose role is captain (if such a member exists) and store the pointer for the captain string into the captain pointer in the team struct

 

After all the teams from the 2D team member array have been added to the team linked-list then the program should read in data from a file called "CF08L3readdata.txt" and add these teams to the team linked-list in sorted order by team name.  The data in this file should be read in using file I/O as  discussed in class.  The file name must be passed as a command line parameter.   Each line of the file has the data for one team and each line is the same format.  The format of the data is the file is as follows:

 

            comp_name team_name teammask dept adv_title adv_first adv_last compyear membercount eventmonth eventday eventyear scoretype scoring

 

where

            comp_name is a single word (a string) with no blanks for the competition(might have underscores or dashes but no whitespace)

            team_name is a single word (as above)

            teammask is an integer

            dept is a string of 4 char or less (excluding end of string marker)

            adv_title is a single word that is the title for the team’s advisor (Dr., Ms., Dean, etc.)

            adv_first is a single word that is the advisor’s first name

            adv_last is a single word that is the advisor’s last name

            compyear, membercount, eventmonth, eventday, and eventyear are integers

            scoretype is a string with the word representing one of the enum types

            scoring is a value of the correct type for the enum type given

            and each piece of data on a line is separated by one blank

 

Your program should open the file, do error checking, then read in one line and process it.  After one line is done, read in the next line until there are no more lines of data in the file (EOF).

 

The giventeammembers array now has duplicate students in it.  After all the teams are put in the linked list, the program should go back to the teammembers 2-D array and check each student to put the correct bitfield info for the team into that students teamslist bitfield.  After this has been done for all the teams in the teams linked list, then a final review of the teammembers array should be done to see if any student is duplicated in the 2-D array on another team.  If so, then the teamslist bitfield for each copy of that student should be updated to show ALL of the teams that the student participates on.  E.g.  If Max is on AVL Team 1 and ICPC UTA Orange then there are two copies of Max in the 2-D array with one copy having the bitfield set for AVL Team 1 and the other having its bitfield set for ICPC UTA Orange.  The bitfield values should be combined so that the bitfield will indicate BOTH teams for Max and both copies of Max’s info in the 2-D array should have this updated bitfield showing both teams.

 

 

Input verification:

When the program has put all of the teams into the team linked-list, it should print out all of the team data in the linked-list in an easily readable form.  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 team linked-list.  Print out the bit mask data as a binary number - sequence of zeros and ones – not as a decimal value (e.g. print 0000 0000 0000 1000 instead of 8 for the IEEE Robotics Team 08 tam mask.  Also reprint teammember 2-D array to show the teamslist (as 1’s and 0’s) for each student (e.g. a student on team 8 and team 64 would have a teamslist of 0000 0000 0100 1000).

 

Create and display a screen menu of choices for the user implementing all the functions.

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.)  Note that some items which were extra credit in previous labs are now required.

 

i-    List the engineering team competitions that UTA participates in (give competition, sponsor and advisor as minimum info)

ii-   List all the UTA engineering teams by name (give team name, competition, sponsor, number of team members as minimum info)

iii-  List the members of a team by name (give first name, last name, team name, year/class, GPA, ID number, and role as minimum info)

 

iv-  Get team member data/statistics for a given team

      a. Count the total number of team members

b. Count the number of freshman, sophomores, etc.

c. Calculate the average GPA

d. Calculate the average age

e. Recursively calculate an estimate of hours of time needed per week for team

v-   Get team member data/statistics for all teams together

      a. Calculate the average GPA

      b. Count the total number of team members on all teams

c. Count the number of freshman, sophomores, etc.

d. Calculate the average age

 

vi-  Sort the members of a single team by

      a. Last name

      b. GPA

      c. ID number

vii- Sort the team list by

      a. Team name

      b. Competition

      c. Number of team members

viii- Search for a particular team member by

a.     Last name 

      a. For the team member, print all competitions that they are in

      b. For the team member, print all teams that they are on

b.     ID number

ix-Search for a particular team by

      a. Team name

      b. Competition

      c. Sponsor

 

x- Calculate amount of time between now and next competition using localtime and time functions

 

 

xi-  Update the team member data

xii-   Update the team data

xiii-  Add new team member data

xiv- Add new team data

 

xv- End the program

 

The competition list function (i) should print a list of all the competitions that are named in team array giving each competition only once.  It is suggested that you number this list as you print it so that you can then used this list of competitions to search with in other functions.  The team list function (ii) should print a list of all the teams that are named in the one-dimensional array.  It is suggested that you number this list as you print it so that you can then used this list of teams to search with in other functions.  The member list function (iii) should print a list of all the students that are named in the two-dimensional array for a given team chosen by the user.

 

The count function (iv.a.) should just count the number of members that are in the array for a given team chosen by the user.  The count-by-class function (iv.b.) should count and print the number of students on the team in each of the valid class categories (1 =Freshman, 2 =Soph, 3 =Jr, 4 =Sr, 5 =other UG, 7 =MS, 9 =PhD).  The GPA function (iv.c.) should call the count function (or refer to the team number data in the team array) to help perform its function for a given team chosen by the user.  The average age function (iv.d.) should also call the count function to do its job.  The hours per week estimation function (iv.e.) will use the following algorithms to determine the estimated hours required for that team activity at a given time of the year PRIOR to the event itself.

 

The hours per week calculation will be based on the following:  For any team there is a minimum hours per week needed all year round and that minimum hours per week is stored as the hrsperwk member of the team struct.  However, as the event approaches, more hours per week are needed with the most hours needed immediately prior to the event.  So, if we assume that the hours needed starts rising about 4 months before the competition (we’ll say 18 weeks and use the constant PREPWEEKS to equal 18), then we want to make the following calculations:

            Step 1:  Get the event date from the team struct and calculate a Gregorian calendar day number for that date.  Write a function to implement this day number calculation using the algorithm given on the class website in the file "calendaralgorithm.txt"

            Step 2:  Ask the user for a date PRIOR to the event and get a day, month, and year for this date from user input from the keyboard.  Calculate the Gregorian calendar day number for that date using the day number function just discussed.

            Step 3:  Subtract the PRIOR date from the event date to get the number of days before the event.

            Step 4:  Divide this number by 7 to get the number of weeks before the event.  Do integer division here.

            Step 5:  Write a small recursive function with two input parameters, the number of weeks just calculated and the minimum hours per week (from the team struct), to calculate the number of hours that will be needed that week based on the algorithm below:

                        Week calculation algorithm

                        If number of weeks is greater than or equal PREPWEEKS or less than or equal to 0,

                                    the needed hours per week is just the minimum hours per week, hsperwk, from the team struct.

                        Else calculate the needed number of hours as a

                                    running sum of the minimum hours per week plus

                                                the value returned by calling the calculate hours function with number_of_weeks + 1.

                        // If you are asking yourself "why +1 instead of -1 there?" the answer is that you want to count from the number of weeks UP to 18

                        // weeks to calculate the needed hours because the total hours need to increase the closer you get to the event; e.g. if you are 15 weeks

                        // from the event you might only need three times the minimum hours to work on the team project but if you are one week from the

                        // event you will need a lot more than the minimum hours that week.

 

 

The GPA function for all team members (v.a.) should find the average GPA of all members on all the team.  For Extra Credit do the total team member count, the class member count and the average age functions for all the team members in the two-dimensional array.

 

The sort-by-last-name function (vi.a.) will mergesort the subarray for a single team chosen by the user within the two dimensional array.  You must also sort the subarray for a single team by GPA (vi.b.) or by ID number (vi.c.).  Any sorting algorithm may be used.  Since these are small arrays, the bubble sort would be a reasonable choice.

 

The sort-by-competition function (vii.b.) will sort the linked list of teams by competition name.  You must also sort the linked list by number of team members (vii.c.).  Even though the team linked list is built in a sorted order by team name you must also implement a team name sort function (vii.a.) so that if you have resorted it by competition or member numbers, you can then sort it back into to team name order.  A linked-list version of the bubblesort would be fine to use or any other sort algorithm for a singly linked-list.

 

The search options (viii.a., viii.b., ix.a., ix.b,. and ix.c.) should call search functions that perform linear search on the appropriate subarrays of data. If you have one or more searches that use the same type of data, you may pass in the value to look for and the array to search and use the same search function for both. When the search is complete your program should print the search result(s) and then show the user the menu again.  In case of ties, print all results.  For search viii.a. by name, the program should also ask the user if the want to see a list of teams the student is on or a list of competitions they are in and should print these as appropriate.

 

The time calculation (x.) should find the number of days between today (the day the program runs) and the competition date.  Today’s date should come from the time and localtime functions.  It should print out the result with a message similar to “The competition will occur in 45 days.”

 

The update options (xi. and xii.) should take the user to a second screen to allow them to update information in the arrays.  This screen should ask the user which array they wish to update – the team member array or the team array. 

 

To update the team member array (xi.) the system should go to another menu.  This screen should ask for a team member’s last name and search for that student.  Once the student is determined, save the two [indexteam][indexmember] values and give the user a menu of the following options:

 

o               Change lastname at [indexteam][indexmember]

o               Change firstmidname at [indexteam][indexmember]

o               Change UTAID at [indexteam][indexmember]

o               Change cumGPA at [indexteam][indexmember]

o               Change major at [indexteam][indexmember]

o               Change competition at [indexteam][indexmember]

o               Change teamname at [indexteam][indexmember]

o               Change year at [indexteam][indexmember]

o               Change gender at [indexteam][indexmember]

o               Change age at [indexteam][indexmember]

o               Change role at [indexteam][indexmember]

o               Change join day, month, or year at [indexteam][indexmember]

o               Return to main menu

 

To update the team array (xii.) the system should go to another menu.  This screen should ask for a team name and search for that team.  Once the team is determined, save a pointer to that struct in the team linked-list and give the user a menu of the following options:

 

o               Change competition

o               Change teamname

o               Change sponsor

o               Change advisor

o               Change compyear

o               Change membercount

o               Change captain

o               Change hrsperwk

o               Change event day, month, or year

o               Change recorded score

o               Change how event is scored

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.  Note that the structs use pointers for their strings.  To update a string, the program must ask the user for the new string, allocate new space (malloc or calloc) to the pointer in the struct big enough for that string and then copy the user’s string into the newly allocated space. 

 

After each change is made, print all of the struct info for the team member or team that was updated.  

 

The add options (xiii. and xiv.) should take the user to a second screen to allow them to add new information in the arrays.  This screen should ask the user which array they wish to add to – the team member array (xiii.) or the team linked-list (xiv.).  For a new team member, the program must determine if they are on an existing team or on a new team.  (If a new team member is added on a new team, the program should automatically add this new team to the team linked=list after the new team member is added.  This should work in a similar fashion to how the team list was originally verified with the team member data.) 

 

For members or teams then the program should prompt the user to enter all of the member data for the struct type except for the struct pointers which should be initialized to NULL.  The newly entered data should be saved in an empty member of the appropriate subarray or should be sorted into the linked list as appropriate.

 

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

 

Implementation requirements:

The program should use the following data structures:

Struct with integer, character, floating point, pointer elements and bit fields for recording team member data

Struct with integer, character, pointer elements and bit fields for recording team data

Two-dimensional array of the team member structs

Doubly linked-list of team structs

Unions and enumerated types to record scoring data

Pointers in function declarations to pass arrays and lists

Global constants given as input data

 

The program should use the following control structures:

Function calls to perform tasks

A while, do-while, or for loop to read the input data

If, if-else, or nested ifs to error check

A switch statement for implementing menus

Recursive number of hours function and mergesort implementations

Preprocessor directives to control conditional compilation

 

The program should NOT use:

global variables

exit

goto

break

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, two for the mergesort functions, one for counting team members, one for calculating average GPA, one for calculating the day of the year, and a recursive function for finding needed hours per week.  You may use more functions than this but you must use at least this many.  It is suggested that you also have a function for printing the team member and team data but these are not required.

 

Prior to running the program:

            Determine whether to compile with debugging or without and use the proper #define if needed

 

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

Declare and initialize the variables

Read data from the given input file

Print a welcome screen for the user that introduces the system

Get the needed input value from the keyboard

Print the appropriate outputs

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

 

The program MUST 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, MUST 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.

 

This program MUST be compiled and run at least once with debugging on and at least once with debugging off. 

 

This program MUST be run with two different sets of test data for the team member constant data.  You must create one data set in addition to the one that I will give you 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 sample data set you create must be submitted as one of your source files that are turned in for this lab.

 

The program output must be recorded in a script file from OMEGA using the gcc compiler.  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.  

 

Read the lab submission instructions on the website for what material to turn in, what to call it, and how to turn it in. 

 

Grading scale:

Code:   (57%)

Conditional compilation directives for debugging and non-debugging versions of program (3 points)

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

Comments (line comments and block comments)       (3 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)

Correct manipulation of the arrays and structs (3 points)

Correct manipulation of the DOUBLY linked lists and structs (7 points)

Correct use of bit fields and masks including team member recording (6 points)

Correct use of required control structures including recursive needed-hours function (4 points)

Correct use of library functions for time and date as needed (4 points)

Correct use of union and enumerated types (5 points)

Correct function structure as required (3 points)

Proper implementation of input error checking (4 points)

Correct use of file input (7 points)

Correct use of memory allocation for strings (2 points)

Output:        (43%)

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

            Search and sort tasks perform correctly on doubly linked lists (5 points)

            Print and calculate tasks perform correctly (3 points)

            Correct output of teammask in zeros and ones (5 points)

Correct calculation of time from now to competition (4 points)

            Update tasks perform correctly (3 points)

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

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

            Output includes one example run showing debugging and one without debugging (6 points)

            Output contains all the given test data and one additional data set (5 points)

 

Deductions:

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

            Use of the exit, break, or continue command will result in 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:

            Competitions include:

                        Steel Bridge Building Competition

                        ACM International Computer Programming Contest

                        Society of Automotive Engineers Formula SAE Race Car Team

                        Google’s Imagine Cup

                        Institute of Electrical and Electronic Engineers Robotics Competition

                        Autonomous Vehicle Laboratory competitions in Air vehicles and Ground vehicles

                        Concrete Canoe Competition

                        CanSat Satellite Payload Competition

                        IEEE Energy Challenge