Question
If anyone could help me with this C++ prgram i would greatly appreciate it. I cant quite figure out how to make the vectors read
If anyone could help me with this C++ prgram i would greatly appreciate it. I cant quite figure out how to make the vectors read in from the files and get a constant stream of errors. i have included all the information needed to complete the program and the information that was needed from the input file. thanks in advance to anyone who can help.
Objective:
The purpose of this project is to expose you to:
Vectors, vector elements, input/output, parallel vectors, using vector methods to manipulating sum, and maintain vectors.
Problem Specification:
Using the structured chart below, write a program to keep records and print statistical analysis for a class of students. There are three quizzes for each student during the term. Each student is identified by a four-digit student ID number. The number of students in the class is unknown, therefore we need to detect end of file to stop. The file pr2data.txt is included and contains the data.
The program calculates the statistics for each student and for each quiz as shown in the sample output. The output goes to a file and is in the same order as the input and should be similar to the following: any other improvements to the output are welcomed.
CIS Department
CIS 161 Class Statistics
Student Quiz 1 Quiz 2 Quiz 3 Average
1234 78 83 87 82.67
2134 67 77 84 76.00
3124 77 89 93 86.33
High score 78 89 93
Low score 67 77 84
Quiz Average 73.4 83.0 88.2
Must use vectors to complete the task.
Vectors declarations does not include size.
Vectors are not passed by reference and you have to use pass by reference if the vector changes.
Use any available vector methods
Grading Criteria:
There are sufficient comments in the programs.
typedef is used to define all vectors.
Data is read from the data file into variables then pushed back into the vector.
loop is included and reads the data until the trailing value 0 for ID is encountered.
the size() method is used to find the size of the vector.
proper passing by value/by reference for all functions.
the function findstavg () finds the float average for each student.
the function findhigh () is clear correct and returns the highest quiz.
the function findlow () is clear correct and returns the lowest quiz.
the function findqzavg () is clear correct and returns the quiz average.
headings (), prints the headings and column titles, formatted and looks nice.
data and results are printed with proper spacing and proper row titles and formatting.
the program runs correctly and produces the intended results.
source program, data file and sample output are submitted.
The stuff below is for the input file
1234 52 70 75 2134 90 76 90 3124 90 95 98 4532 21 17 81 5678 20 22 45 6134 34 45 55 7874 60 99 56 8026 70 10 66 9893 34 09 77 2233 78 20 78 1947 45 40 88 3456 78 55 78 2877 55 50 95 3189 70 98 78 2132 77 97 80 4602 89 50 91 3445 78 60 78 5405 35 33 15 9898 48 78 68 2323 78 20 78
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