Answered step by step
Verified Expert Solution
Question
1 Approved Answer
IN C++ Problem 2 Overview: In this question, you will write a program that: 1. Reads a .csv file with 5 columns and up to
IN C++
Problem 2 Overview: In this question, you will write a program that: 1. Reads a ".csv" file with 5 columns and up to 10 lines containing information on student grades. 2. Stores the information in an array of structs. 3. Writes the lines into the output.csv file where the overall student grade is between a particular range. 4. Prints the content of the entire array. Specifics: Create an array that holds the studentData struct objects. Use the following struct declaration: struct studentData { string studentName; int homework; int recitation; int quiz; int exam; double average; }; 2A. Write a function named addStudentData: i. The addStudentData function has the following declaration: // length: Number of items currently stored in the array void addStudentData(studentData students[], string studentName, int homework, int recitation, int quiz, int exam, int length); ii. Instantiate a struct and store the studentName, homework, recitation, quiz, and exam values in it. iii. Assume equal weights amongst everything that needs to be graded. Take the average of the homework, recitation, quiz, and exam for each respective student and store it in the struct. a. student.average = (homework + recitation + quiz + exam)/4; iv. Add the struct to the students array. 2B. Write a function named calcLetter: i. The calcLetter function has the following declaration: char calcLetter(double avg); ii. Write IF-ELSE conditions to assign letter grades based on the following a. >=90: A b. 80-89.9: B c. 70-79.9: C d. 60-69.9: D e. earnedStep 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