Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

do it using these #include #include #include #include also implement vectors instead of dynamic arrays urgent Overview: In this homework, you will use vectors. You

image text in transcribedimage text in transcribedimage text in transcribeddo it using these

#include  #include  #include  #include 

also implement vectors instead of dynamic arrays

urgent

Overview: In this homework, you will use vectors. You will change the dynamic arrays created in homework 1 to use vectors instead. The history professor has the following text file as follows: 5 10 22 TFFTFFTTTTFFTFTFTTTTFF beee544468 TFTFTFTNFFFTFTFFTTFTTT beee743248 FFTFFFTFFFFTFTFFTTFTFT geee244418 TTTTTFTTFFNTTTFFTTFTTT g00144340 TFFTFFTTTTFFTFTFTFTFFF gee444140 The first number in above sample file indicates the number of students. In the above sample, we have 5 students. The second number indicates the number of characters for the student ID. In the above sample, we have 10 characters for each student ID. The third number indicates the number of questions in the exam. In the above sample, we have 22 questions. The rest of the file contains the student ID followed by the answers provided by the student. The Problem Description: The history professor at Aus needs your help. He has a file, hist101midterm1.txt, as shown above. You will also write a function that displays and saves a table with the student ID, the student's answers, the test score and then the test grade, for each student: Student ID ------- Answers ---- Percent Grade B0004543 TFTFTFTTFFFTFTFETTET 40.0 F B0004432 TETETTE 40.0 G0002333 TEFTEFTTTTEETETETETE 100.0 A Highest grade is 100 for student G0002333 Lowest grade is 40 for student B0004543 B0004432 Function Definition Requirements: You are required to implement the following functions. You must use vectors to store the values instead of the dynamic arrays. Change the functions definitions mentioned below to accept vectors instead of the dynamic arrays/pointers. Write a function studentscores that calculates the grade for each student in the exam based on their answers stored in the student_answers array. The function must accept the following parameters: Pointer to the array that hold the answers key Pointer to the 2-D character array that hold the students' answers Pass by value an integer variable that holds the number of students. The function returns a pointer to an array of type double that holds the calculated student percentage. Write a function save_grades that saves the information format specified above. Pass the parameters needed. Write the function display that prints the information format specified above. Pass the parameters needed. Write a function best_grade that returns the highest grade value found in the student's grade array. The function must accept at least the following parameters: Pointer to the array that contains the students' grades Pass by value an integer variable that holds the number of students Write a function lowest_grade that returns the lowest grade value found in the student's grade array. Pass any parameters needed. You will write a function that accepts the percentage score and will return the letter grade based on the following table: 90% and above A 80% to less than 90%- 70% to less than 80% - 60% to less than 70%- D 0% to less than 60% - F The main function that will: open the file answers.txt reads from the file the number of questions reads from the file the number of students declares a dynamic array that holds the student IDs declares a 1D dynamic character array to hold the answers key declares a 2D dynamic character array to hold the students' answers The sizes of the arrays should be created based on the values read from the files. You must fill the student ID and student answer arrays with the values read from the file. The main will then call the created functions in the previous sections to: calculate the student scores Display the highest grade on the screen Find the highest and lowest grade Save the student IDs and the calculated scores to a file Display the student IDs and the calculated scores to a file ****You may implement any additional functions if you wish. ***** It is required that your program includes: Proper comment for the code includes the functions. Each function comment should include description of the function, the input variables, and what the function returns. Meaningful variable names Make your operam easy to read Use proper indentation

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Administration The Complete Guide To Dba Practices And Procedures

Authors: Craig S. Mullins

2nd Edition

0321822943, 978-0321822949

More Books

Students also viewed these Databases questions

Question

1. List characteristics of effective controls.

Answered: 1 week ago

Question

Answered: 1 week ago

Answered: 1 week ago