Sei sulla pagina 1di 2

PFC Assignment

All result screens of programs must be put in a MS word file


Compress all your source folder to a RAR file then upload it to the CMS

Write a C program that provides the following menu:


1. Input student name
2. Search student name
3. View search history
4. List all the name in ascending order
5. Quit the program

Depending on the selected number, the program should be properly operated as the following
description:

If users Operation description Example


select:
1 Input a student name. Your program Input a student name: Le Thi Ca Chua
should maintain a list of student name Continue (y/n): y
inputted from users, and the max item in Input a student name: Tran Van Ot
the list should be 50. If users enter more Continue (y/n): y
than 50, an error message should be Input a student name: Nguyen Van Teo
given Continue (y/n): n
2 Allow users to search name based on the Enter keyword: van
inputted keyword. The results should be Result: Tran Van Ot, Nguyen Van Teo
listed all student name containing the Continue (y/n): y
keyword. Keywords can be upper or Enter keyword: Thu Nga
lower case. Result: not found

3 Show all the keywords users had Keywords you have entered: Van, Thu
entered. Those keywords should have Nga
been stored when users performed
option 2.
4 All the names in the list should be shown Le Thi Ca Chua
in ascending order Nguyen Van Teo
Tran Van Ot
5 Quit the program

Sample output program

Select an option:
1. Input student name
2. Search student name
3. View search history
4. List all the name in ascending order
5. Quit the program
--------------------------------------------------------------
Select: 1
Input a student name: Le Thi Ca Chua
Continue (y/n): y
Input a student name: Tran Van Ot
Continue (y/n): y
Input a student name: Nguyen Van Teo
Continue (y/n): n
Select an option:
1. Input student name
2. Search student name
3. View search history
4. List all the name in ascending order
5. Quit the program
--------------------------------------------------------------
Select: 2

Enter keyword: van


Result: Tran Van Ot, Nguyen Van Teo
Continue (y/n): y
Enter keyword: Thu Nga
Result: not found
Continue (y/n): n

Select an option:
1. Input student name
2. Search student name
3. View search history
4. List all the name in ascending order
5. Quit the program
--------------------------------------------------------------
Select: 3

Keywords you had entered: Van, Thu Nga

Select an option:
1. Input student name
2. Search student name
3. View search history
4. List all the name in ascending order
5. Quit the program
--------------------------------------------------------------
Select: 4

List of students:
Le Thi Ca Chua
Nguyen Van Teo
Tran Van Ot

Select an option:
1. Input student name
2. Search student name
3. View search history
4. List all the name in ascending order
5. Quit the program
--------------------------------------------------------------
Select: 5

----Bye Bye-----------------

Potrebbero piacerti anche