Вы находитесь на странице: 1из 3

University of Central Florida

COP 3502 Computer Science I


Recitation 1
Due, Wednesday, June 3, 2015 up to 100
Friday, June 4, 2015 up to 90
Saturday, June 5, 2015 up to 80
Sunday, June 6, 2015 up to 70
Deliverables
To complete this assignment you must submit your source code .c file to Webcourses.
Introduction
The goal of this assignment is to write an application that read in data from the command line
and stores it as a linear linked list.
References
Text book, Chapter 2.
Source code examples on Webcourses, LinkedList.c, LinkedListWithPrototypes.c
Online tutorials:
http://www.cprogramming.com/tutorial/c-tutorial.html
http://fresh2refresh.com/
http://www.tutorialspoint.com/c_standard_library/
Tasks and Rubric
Activity
Create a linked list
node to include
main()

char name[50];
struct node *next;
- Provide the user a menu of the following options:
1. Insert
2. Display
3. Count
4. Delete
5. Exit
- Use a conditional statement to evaluate the users
selection
-- if option 1, call function to insert a name
-- if option 2, call function to display the linked list
-- if option 3, call function to display the number of

Point
s
5
5

Function to insert a
new name
Perform Test Case 1
Perform Test Case 2
Perform Test Case 3
Function to display the
linked list
Perform Test Case 4
Function to count
nodes in the linked list
Perform Test Case 5
Function to delete

Perform Test Case


Perform Test Case
Perform Test Case
Exit the program
Perform Test Case

6
7
8
9

nodes in the linked list


-- if option 4, call function to delete a name
-- if option 5, exit the program
Prompt the user for the name
Populate an instance of the linked list node with the
data
Add the new node to the existing linked list at the end
Test Case 1 executes successfully
Test Case 2 executes successfully
Test Case 3 executes successfully
Traverse the linked list and display the data of each
node
Test Case 4 executes successfully
The function should return the number of nodes in the
linked list
Test Case 5 executes successfully
Prompt the user for the name
Traverse the linked list to find the entered name
If it exists delete it and inform the user it has been
deleted
If it does not exist inform the user the entered name
was not found
Test Case 6 executes successfully
Test Case 7 executes successfully
Test Case 8 executes successfully
Write the appropriate code to exit the program
Test Case 9 executes successfully
Source compiles with no errors
Source runs with no errors
Source includes comments

Total
Perform the following test cases
Test Cases
Action
Test case 1
Select option 1
Test case 2
Select option 1
Test case 3
Select option 1
Test case 4
Select option 2
Test case 5
Test case 6

Select option 3
Select option 4

5
5
5
5
5
5
5
5

5
5
5
5
5
5
10
5
100

Expected outcome
Enter a string value to add to the linked list
Enter a string value to add to the linked list
Enter a string value to add to the linked list
Display the elements of the linked list, there
should be three strings displayed
The returned value should be 3
Delete one of the three strings displayed
from selecting option 2

3
Test case 7

Select option 2

Test case 8
Test case 9

Select option 3
Select option 5

Display the elements of the linked list, there


should be two strings displayed
The returned value should be 2
Program exits and quits

Вам также может понравиться