You are on page 1of 3

CECS - 121

Summer 2014

Homework 5 (Total: 100 points)


(Due: 07/21/2014) by 11:59 pm
Please turn in
one .c source files as solution for the given problem on Blackboard.
Please submit your file only once. Remember to add your name, class section, title and date at the top of the
file (similar to HW-1) and also to have standard file names. Each file name have to follow this naming
standard:
Your last name_Asignment Number_Program name.c (e.g. smith_assignment3_textStatistics.c)

Your

task is to write a Student information program. Your program should be able to add new students to its
database, also it should be able to search for students using the first name last name pairs or Student IDs provided as
input by user and you need to have an option of printing all the information on the screen. To do so you should
create a structure named studentInfo. It must contain, firstName, lastName, ID, address, phoneNumber, birthDate,
startDate, endDate, gpa, creditHours and courseList. courseList should be a structure list type itself, having
courseName, creditHours and score array of size 20 and listLength variable inside. Also you can have a structure for
storing dates (birthDate, startDate, endDate) or you can have them as simple strings.
You program needs to perform following tasks using functions and present the following menu choices to the user:
1. Add a new record to Studen Information System
2. Search for a particular record based on name of the student
3. Search for a particular record based on student ID
4. Display the all the student information stored in system
5. Quit the program
You need to add two student information inline your code, so you dont have to enter information every time you
run the program. Also to keep track of number of added information to your database, you need to make a list type
structure, having an array of size 100 of studentInfo type and the listLength variable storing the number of records
stored in the array.
It is better to write your program using 4 functions, a function for adding information to your program, a function
for searching through your saved contact info, a function for displaying everything and a function to print out the
information of an specific index of the list array (You will need this function to print out the search results and to
display all the information).
Your name based search needs to go through all the information and print every search result matching your query.
So in case of having for example 3 similar first name and last name combinations, you search should be able to find
all and print out the information. In case of using student ID search because student IDs are unique numbers, you
dont need to go through all information after finding the first match.

CECS - 121
Summer 2014

Babaks Student Info System


*****************************
*
1. Add
*
*
2. Search name
*
*
3. Search ID
*
*
4. Display
*
*
5. Quit
*
*****************************
Enter your choice: 1
First Name:
Last Name:
Student ID:
Address:
Phone number:
Birth Date:
Start Date:
End Date:
Course 1name:
Course 1credit hours:
Course 1 grade:
More courses? (Y/N):
Course 2 name:
Course 2 credit hours:
Course 2 grade:
More courses? (Y/N):

Babak
Abbaschian
54055020
Room 202, Duthie center of Engineering, UofL.
5028526307
04/02/1981
January 2010
January 2014
Antenna Design
3
A
Y
Analog integrated Design
3
A
N

*************************************************************************
* Babak Abbaschian
* 54055020 * Birthdate: 04/02/1981
*
* Start Date: January 2010
* End Date: January 2014
*
* GPA: 4.00
* Total credit hours: 6
*
*************************************************************************
*
Course
List
*
*************************************************************************
* Name
*Credit Hours
*Grade
*
*************************************************************************
* Antenna Design
* 3
* A
*
* Analog integrated Design
* 3
* A
*
*************************************************************************
is stored.
Babaks Student Info System
*****************************
*
1. Add
*
*
2. Search name
*
*
3. Search ID
*
*
4. Display
*
*
5. Quit
*
*****************************
Enter your choice: 1
First Name:
Last Name:
Student ID:
Address:
Phone number:
Birth Date:
Start Date:
End Date:
Course 1name:
Course 1credit hours:
Course 1 grade:
More courses? (Y/N):
Course 2 name:
Course 2 credit hours:
Course 2 grade:
More courses? (Y/N):
Course 2 name:
Course 2 credit hours:
Course 2 grade:
More courses? (Y/N):

Jon
Doe
111113
Somewhere in mesopotamia
are you kidding?
December 992bc
January 976bc
January 900bc
Ship design
3
A
Y
Hunting with Bow
3
A
Y
Tree Climbing
3
F
N

*************************************************************************
* Jon Doe
* 111113 * Birthdate: December 992bc
*
* Start Date January 976bc
* End Date January 900bc
*
* GPA: 2.66
* Total credit hours: 9
*
*************************************************************************
*
Course
List
*
*************************************************************************
* Name
*Credit Hours
*Grade
*
*************************************************************************
* Ship design
* 3
* A
*
* Hunting with Bow
* 3
* A
*
* Tree Climbing
* 3
* F
*
*************************************************************************
is stored.

CECS - 121
Summer 2014

Babaks Student Info System


*****************************
*
1. Add
*
*
2. Search name
*
*
3. Search ID
*
*
4. Display
*
*
5. Quit
*
*****************************
Enter your choice: 2
Enter:
First Name:
Last Name:

Babak
Abbaschian

Found
*************************************************************************
* Babak Abbaschian
* 54055020 * Birthdate: 04/02/1981
*
* Start Date: January 2010
* End Date: January 2014
*
* GPA: 4.00
* Total credit hours: 6
*
*************************************************************************
*
Course
List
*
*************************************************************************
* Name
*Credit Hours
*Grade
*
*************************************************************************
* Antenna Design
* 3
* A
*
* Analog integrated Design
* 3
* A
*
*************************************************************************
Babaks Student Info System
*****************************
*
1. Add
*
*
2. Search name
*
*
3. Search ID
*
*
4. Display
*
*
5. Quit
*
*****************************
Enter your choice: 3
Enter Student ID:

111113

Found
*************************************************************************
* Jon Doe
* 111113 * Birthdate: December 992bc
*
* Start Date January 976bc
* End Date January 900bc
*
* GPA: 2.66
* Total credit hours: 9
*
*************************************************************************
*
Course
List
*
*************************************************************************
* Name
*Credit Hours
*Grade
*
*************************************************************************
* Ship design
* 3
* A
*
* Hunting with Bow
* 3
* A
*
* Tree Climbing
* 3
* F
*
*************************************************************************
Babaks Student Info System
*****************************
*
1. Add
*
*
2. Search name
*
*
3. Search ID
*
*
4. Display
*
*
5. Quit
*
*****************************
Enter your choice: 5
GoodBye

You might also like