Question
C++ Programing Student List A teacher wants to list all her students full names, considering only for the two students at the front and the
C++ Programing
Student List
A teacher wants to list all her students full names, considering only for the two students at the front and the end of the list that must be in alphabetical order. That meant the student at the top and at the end of the list will be set alphabetically according to their full name.
Write a C++ program that can help her with the issue. The list of names could be either read in from an external text file or entered from the keyboard, one full name at a time.
Once all the names have been read in, the program reports which name should be at the top of the list, and which name should be at the end of the list, in alphabetical order of their names. Also, the list of names must be displayed on the screen, together with the original order that their names were entered, for the teacher to check back of her record.
Assume that no two students have the same name. Using array is not allowed, absolutely, and will have no credit.
Lastly, allow your program to run continuously as often as the user wishes. Before ending the program, your name as the programmer must be displayed.
Input validation: the number of students must be in the range of 5 to 30, inclusively.
Hint: If the names were entered from the keyboard, all the read-in names must be recorded in the order that they were entered into an external text file.
Sample the professor made. He wants it to be the same.
Among the names read in, either from a file or from the keyboard,
the program reports which name should be at the top and which name should be at the end of the list,
in alphabetical order of the names.
The list of names and their read-in-order are displayed as well.
== * == * == * == * == * == * == * == * == * == * == * == * ==
How would you like to read in the students' names?
(1) Entering names from keyboard
(2) Reading names from external file
(3) End program
== * == * == * == * == * == * == * == * == * == * == * == * ==
Enter your choice: 1
Enter a number of students between 5 and 30 inclusive: 1
Please enter a number in the range [5 - 30].
Re-enter a valid number: 5
Enter the full name of student 1: adnkfd
Enter the full name of student 2: fkjdkdkl
Enter the full name of student 3: nkfdgkd
Enter the full name of student 4: fdjknjfd
Enter the full name of student 5: fgbfdjngk
Here is the list of names you have entered:
1. adnkfd
2. fkjdkdkl
3. nkfdgkd
4. fdjknjfd
5. fgbfdjngk
The name at the top: adnkfd
The name at the end: nkfdgkd
== * == * == * == * == * == * == * == * == * == * == * == * ==
How would you like to read in the students' names?
(1) Entering names from keyboard
(2) Reading names from external file
(3) End program
== * == * == * == * == * == * == * == * == * == * == * == * ==
Enter your choice: 2
Enter the name of the file: cisc 192.txt
1 AISHA ASIF
2. ARSHA BOUSTANI
3. DANIEL CHEEK
4. JALAL DAABAS
5. KAMAL ELAMRI
6. IVAN-ALEJANDRO GALINDO
7. SALIEM GEBREMICAEL
8. VANESSA JONES
9. AUSTIN KINGHORN
10. DYLAN MORRIS
11. ARIANA NELSON
12. HUNG NGUYEN
13. LE NGUYEN
14. NHAT NGUYEN
15. TIEN NGUYEN
16. MARIAM NOUREDDINE
17. DYLAN O'NEAL
18. YEN PHAM
19. DEREK POWERS
20. ROMAN ROSSER
21. NAZANIN SHOKRANI
22. KELSEY SMITH
23. MANUEL SOBOL
24. TRUNG TRIEU
25. MIKILA TUCHSCHER
26. LUIS VEGAORELLANA
27. DONALD VUONG
28. MATTHEW WNUK
29. KIRK YOUNG
30. PHILIP YUENMAK
The name at the top: AISHA ASIF
The name at the end: YEN PHAM
== * == * == * == * == * == * == * == * == * == * == * == * ==
How would you like to read in the students' names?
(1) Entering names from keyboard
(2) Reading names from external file
(3) End program
== * == * == * == * == * == * == * == * == * == * == * == * ==
Enter your choice: 3
Programmer: .
GOOD BYE! Press [Enter] key to end the program...
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started