C++ Student Data Write a program that uses two structures Name and Student to store the following information for multiple students: Create a nameType structure that consists of First Name, Middle Initial, and Last Name Create a studentType structure that contains student information (Include the nameType structure within the Student information structure): Name ID email GPA Program (an enum type named programType containing programs such as CSCI, DBMS, INFM, SDEV) Suppose that a class has at most 20 students. Use an array of 20 components of type studentType. You will read in the names, id, and email from classroster.txt.  The first line of the file will tell you how many students are in the class.  To get the the GPA and program for each student you will need to read from studentlist.txt. The second file will have the id, program, and GPA for all of the students in the department.  That means that not every student from studentlist.txt will be in classroster.txt. You will need to only add GPA and program for the students in the class.  Your program must contain at least the following functions (the function prototypes are provided in the starter code): A function to read the students’ data into the array. This function will open classroster.txt. The file is in the format first name, middle initial, last name, student id, email  A function to assign the relevant program and GPA to each student. This function will open studentlist.txt. You will have to search the student array to find the student from the file and assign their program and GPA. If a student from the file is not found in the array skip it and go to the next student in the file. Programs are encoded as single character codes C = CSCI, S = SDEV, D = DBMS, I = INFM A function to find a student by id in the array. This function should do a search on the array and return the position of the student with a matching student id, or -1 if the student is not in the array. A function to find the highest GPA. A function to print the names of the students having the highest GPA. Other than declaring the variables and opening the input and output files, the function main should only be a collection of function

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter13: Structures
Section: Chapter Questions
Problem 3PP
icon
Related questions
Question

C++

Student Data

Write a program that uses two structures Name and Student to store the following information for multiple students:

  1. Create a nameType structure that consists of
    • First Name,
    • Middle Initial, and
    • Last Name
  2. Create a studentType structure that contains student information (Include the nameType structure within the Student information structure):
    • Name
    • ID
    • email
    • GPA
    • Program (an enum type named programType containing programs such as CSCI, DBMS, INFM, SDEV)

Suppose that a class has at most 20 students. Use an array of 20 components of type studentType. You will read in the names, id, and email from classroster.txt.  The first line of the file will tell you how many students are in the class.  To get the the GPA and program for each student you will need to read from studentlist.txt. The second file will have the id, program, and GPA for all of the students in the department.  That means that not every student from studentlist.txt will be in classroster.txt. You will need to only add GPA and program for the students in the class. 

Your program must contain at least the following functions (the function prototypes are provided in the starter code):

  1. A function to read the students’ data into the array.

    • This function will open classroster.txt.
    • The file is in the format first name, middle initial, last name, student id, email 
  2. A function to assign the relevant program and GPA to each student.

    • This function will open studentlist.txt.
    • You will have to search the student array to find the student from the file and assign their program and GPA.
    • If a student from the file is not found in the array skip it and go to the next student in the file.
    • Programs are encoded as single character codes C = CSCI, S = SDEV, D = DBMS, I = INFM
  3. A function to find a student by id in the array.
    • This function should do a search on the array and return the position of the student with a matching student id, or -1 if the student is not in the array.
  4. A function to find the highest GPA.

  5. A function to print the names of the students having the highest GPA.

Other than declaring the variables and opening the input and output files, the function main should only be a collection of function calls.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Types of trees
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++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning