Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C++ programming Problem #28 - Using Files - Student Line Up Modify the Student L

ID: 3734813 • Letter: C

Question

C++ programming Problem #28 - Using Files - Student Line Up Modify the Student Line Up program described in Programming Challenge 15 so that it gets the names from a data file. Name should be read in until there is no more data to read. Data to test your program can be found in the LineUp.txt file (Download it from this assignment page). Problem 15 A teacher has asked all her students to line up single file according to their first name. For example, in one class Amy will be at the front of the line and Yolanda will be at the end. Write a program that prompts the user to enter a number between 1 and 25 for the number of students in the class, then loops to read in that many names from the file. Once all the names have been read in, it reports which student would be at the front of the line and which one would be at the end of the line. You may assume that not two students have the same name. (It is not asking you to sort ALL the names, it only wants to know who should be first and who should be last, do not try to sort the names, that is for another chapter)

Explanation / Answer

#include #include using namespace std; int main() { string Name, // Name of student Front, // Front of line End; // End of line ifstream InputFile; // Define ifstream object cout Name; // Read next student } } // Display the student at the front of the line // and which is at the back of the line. cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote