Question: Code in C + + please Chapter 5 Homework 3 Student Line Up Using Files A teacher has asked all her students to line up
Code in C please
Chapter Homework
Student Line Up Using Files
A teacher has asked all her students to line up 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 will prompt the user for a filename that contains the student names. Check to see if the file opened. If not
ask for the filename again. The logic should not proceed until a valid filename is entered.
Names should be read in until there is no more data to read. As the names are read in you will check to see if the new name
should be in the first or last student. Count the number of students. The names may have a space in them like Mary Ann or J R
At the end display the number of students. Display the determined first and last student.
Do not use a for loop for this program. Do not use arrays or sorting for this program!
The file to use is at the bottom of Moodle screen for Chapter Remember to check to see if the file opened. Also remember to
close the file when done. Jackie
Sam
Tom
Bill
Peter
Steve
John Paul
Vicki
Sarah
Henry
David
George
Aaron
Mary
Paul
Bob
Zev
Swayam
Jesse
Barb
Anna
Quincy
Yancy
Tina
Marco
Alvin
Xavier
Kenya
Robert
Mary Ann
Marg
Alan
Valerie
Ernest
Tommy
Betty
David
William
J R
Alice
Mark
Greg
Faith
Zack
Sue
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
