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. Using C++, Write a program that allows the user to choose whether they want to enter the names manually, or if the application should get the student names from a .txt file. If they choose manually, the program should prompt the user to enter a number between 1 and 20 for the number of students in the class and then loop to read in that many names. Once all the names have been read in, it should report which student should be at the front of the line and which one would be at the end of the line. If they choose to get the names from a .txt file, the names should be read in from the file until there is no more data to read in. The program should display all of the names from the .txt file before displaying which student should be at the front of the line and which one would be at the end of the line. Names for the .txt file: Liam Olivia Noah Emma Oliver Charlotte Elijah Amelia James Ava William Sophia Benjamin Isabella Lucas Mia Henry Evelyn Theodore Harper

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 6PE
icon
Related questions
Question
100%

Please send me answer within 10 min!! I will rate you good for sure!!

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. Using C++, Write a program that allows the user to choose whether they want to enter the names manually, or if the application should get the student names from a .txt file.

If they choose manually, the program should prompt the user to enter a number between 1 and 20 for the number of students in the class and then loop to read in that many names. Once all the names have been read in, it should report which student should be at the front of the line and which one would be at the end of the line.

If they choose to get the names from a .txt file, the names should be read in from the file until there is no more data to read in. The program should display all of the names from the .txt file before displaying which student should be at the front of the line and which one would be at the end of the line.

Names for the .txt file:

Liam

Olivia

Noah

Emma

Oliver

Charlotte

Elijah

Amelia

James

Ava

William

Sophia

Benjamin

Isabella

Lucas

Mia

Henry

Evelyn

Theodore

Harper

 

Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
File Input and Output Operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT