View Single Post
Old 05-07-2008, 04:00 AM   #1 (permalink)
lucky609
Registered User
 
Join Date: May 2008
Posts: 1
OS: WIN VISTA HOME BASIC EDITION


Confused Plz can anyone do this C++ program for me????

C++ program that reads N family names (N should be declared as a constant in your program
and it should be equal to the largest digit of your student id number), stores them in an array, sorts them
in ascending order and searches for the given name. The program should display and execute a menu
with the following options. A switch statement must be used to execute the following menu options:
1. Read N family names and store them in an array
2. Sort family names in ascending order
3. Search for a given family name
4. Display all family names which start with the letter "A"
5. Display all family names which end with the letter "H"
6. Display all family names
7. Exit
1. Read N family names and store them in an array
This option reads N family names from the keyboard and stores them in an array.
2. Sort family names in ascending order
This option sorts the family names in ascending order. The function to sort the family names must use
two “for loops” and one “if statement”.
3. Search for a given family name
This option searches for the family name. It asks the user to enter a family name and searches for it, if it
is found, it displays the message “family name - found” and array location otherwise displays a message
“family name - not found”.
4. Display all family names which start with the letter "A"
This option displays all family names stored in array which start with the letter "A".
5. Display all family names which end with the letter "H"
This option displays all family names stored in array which end with the letter "H".
6. Display all family names
This option displays all family names stored in the array.
7. Exit
The program should display the message “Thank you.” and your student id number and exit.
The whole program should work in a loop to enable the user to read N family names, sort them in
ascending order, search for the given family name and display all family names until the user chooses to
exit.

Last edited by lucky609 : 05-07-2008 at 04:07 AM. Reason: for more specification
lucky609 is offline   Reply With Quote