Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ please follow all instruction Program Description: Write a program that keeps track of students' information in a class. The program should use a structure
C++ please follow all instruction
Program Description: Write a program that keeps track of students' information in a class. The program should use a structure (name it Students) to store the following data about a student: name (c string of capacity 81. Name contains a space. You may hardcode 81) id (integer) grade (double) your program should keep an array of students. It should also have the following organization and menu choices. Use a loop to allow the user to repeatedly choose from the following menu choices: 1) Edit a student 2) View a student's info 3) Display a count of how many students are in the list. 4) Quit // display "Finished!" Data Storage: Data should be stored in an array of structures. The array should hold 10 structures. All elements of the array should be initialized to "-",0,0). This will make it easy to determine if a structure at an index position has been used to store a student's information (see menu option 2 and 3.) const int SIZE = 10; Students students[SIZE)....//initialization should be done here Input Validation: For view option (option 2). Ask user to re-enter an index if there is no student on that index (ie. name is "-") User input for index must be between 0-9 Menu options can only be 1, 2, 3 or 4. Functions needed: You may create any other function if needed, but following functions are required. void editStudent (Students studentsil, Can the array parameter be constant? This function should int size) ask user for an index number and allow entry of all data for a particular student on that index. Display student's info in the format of [ID.name grade) void viewStudent (const Students Can the array parameter be constant? Ask user for an students [], int size) index number and display all data of that student. View will only work for an entry with a real name, not a "-". Display an error message if there is a "-" as name on that index vold count Student Iconst Students students[l. Int size) Can the array parameter be constant? count for names that are not a Other Requirements Line separator used in the display has 6 Define a string variable name "line to handle this task. string line(60,'*'); Use cin.ignorel) between cin>> and getline function Name should be a c-string, do not use string Your output should be similar to the provided output (attached below), including format and messages, although you can try different input. Copy and paste your output to the end of the program, commented out, and separated by a line separator. Please follow the program style guidelines o Points will be taken off Submit your.cpp program on World classroom before due date and time. Sample Display 1) Edit a student 2) View a student info 3) Display a count of how many students are in the list. 4) quit Please choose one of the options: 5 Please choose an option between 1 to 41 Please enter an index: 1 Please enter a name: John Please enter an ID: 1234 Please enter a grade: 97 1) Edit a student 2) View a student info 3) Display a count of how many students are in the list. 4) quit Please choose one of the options: 2 Please enter an index: 1 1234. John 97 1) Edit a student 2) View a student info 3) Display a count of how many students are in the list. 4) quit Please choose one of the options: 2 Please enter an index: 0 There is no student on that index, please re-enter1 1234. John 97 1) Edit a student 2) View a student info 3) Display a count of how many students are in the list. 4) quit Please choose one of the options: 3 There are 1 students 1) Edit a student 2) View a student info 3) Display a count of how many students are in the list. 4) quit Please choose one of the options: 1 Please enter an index: 4 Please enter a name: Jane Please enter an ID: 234 Please enter a grade: 59 1) Edit a student 2) View a student info 3) Display a count of how many students are in the list. 4) quit Please choose one of the options: 3 There are 2 students 1) Edit a student 2) View a student info 3) Display a count of how many students are in the list. 4) quit Please choose one of the options: 4 Finished! Press any key to continue 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