Question: I need help with the C++ program. This assignment covers the following topics: - Pointers - Dynamic Memory Allocation: Id array - Vectors Students are

I need help with the C++ program.
I need help with the C++ program. This assignment covers the following
topics: - Pointers - Dynamic Memory Allocation: Id array - Vectors Students
are scheduled to take a multi-level test that provides them with an
opportunity to collect points towards their final grade in the course. The
test is designed in levels to allow students to be able to

This assignment covers the following topics: - Pointers - Dynamic Memory Allocation: Id array - Vectors Students are scheduled to take a multi-level test that provides them with an opportunity to collect points towards their final grade in the course. The test is designed in levels to allow students to be able to get a chance to answer more questions only after they qualify on the previous level. The more questions they get to answer, the more chance they get to collect points. Students will get to keep the points they earn during the different stages of the test. In order to simulate this process, we use random numbers and dynamic arrays. Each question is a multiple choice question with 3 choices numbered 1,2 , and 3 respectively. The key as well as the students' answers will be created randomly. In addition to generating output on the sereen and writing the report of students' points to an output file, we would like to create possibly four vectors consisting of students who completed the testing at different levels of 1,2,3 and 4. The following describes this "dynamic" test: Level 1: All students get to answer 10 questions, each worth 10 points. If they carn at least 50% of the credit, they advance to level 2. Level 2: Those who qualify for this level get to answer 40 more questions, each worth 2 points. The threshold for advancing to level 3 is at least 25% made at this level. Level 3: Qualified students will get to answer 100 more questions each worth 1 point. All students who get to this level will get a chance to answer additional number of question which is exactly 10% of the number of questions they answered correctly at this level 3 . So, for example if a student answered 70 out of 100 questions correctly, they will get to answer 7 more questions at level 4 : Level 4: Qualified students get to answer equivalent of 10% of the correctly answered questions on level 3. So, the size of the test for this level is truly "dynamic" and dependent upon the performance of the student on level 3. Each question in this level is worth 10 points. Notice the computation of number of questions for this level would be a round up of the result of the devision. For example, performance of 67 percent on level 3 will secure 7 more questions for this level. The maximum possible points across all levels of this test is 380 points. Here is the list of the mandatory functions for this assignment: int gradeTest ( int *, int ", int, int) , (Renceiven the key and teat arrayo, theit aite. and the point for each questlon, returns the tocal point: void dioplayVector ( veotor sting? ); //pjsplays the vector of nanes How to implement this simulation: In an input file called SP23 HWI.txt we have the names of 20 students (they all happen to be brilliant and famous people for some reason, specially the last one!). Prompt the user for the number of students, dynamically allocate an array of strings of that size. Populate this array called rosterptr via the input file. Notice that we may have different number of students in this file, that is why we prompt the user for the size, and therefore the dynamic nature of our array. For levels 1,2 , and 3 , declare and randomly populate regular arrays of sizes 10,40 and 100 with possible choices of 1,2 , or 3 representing the keys to these levels of test. Must use makeKeysAs function for this step. This is due to the fact that the size for these tests are known so we would like to take advantage of this certainty. Also, since every student will get to take the level 1 test, we can declare and randomly populate their individual tests using regular arrays as well. You still MUST call makeKeysAs function to populate these regular arrays. Only after level I, students will get to continue taking next level tests only if they qualify. So their test arrays must be dynamically allocated first and then randomly populated via makeKeysAs function. As you will see later, the key for level 4 must be dynamically allocated as well. So, the following steps will repeat for every student: For every student call makeKeysAs function to randomly populate their level 1 test array that is already declared. Call graderest function to receive their points, and check for the condition to advance to level 2 and take proper action. Refer to the sample run of the code provided in this document as a guideline. The names of those who will not advance to level 2 , must be added to leve11vec vector. On level 2 and ONLY for qualified students, you must dynamically allocate the TEST and populate it via call to makeKeysAs function. Next, grade their test, check their advancement status, and take proper action. The names of those who will not advance to level 3 , must be added to 1 eve 12Vec vector. For level 3, tests are dynamically allocated, populated and graded. For those whose testing adventure ends here, they must be added to the level 3vec vector. Notice this scenario happens only if students does not make enough points for level 3 's test for its 10% to be a viable size for a test, therefore they will be no longer able to answer additional questions on level 4 . For those who get to continue to level 4, we need to dynamically allocate both the KEY and the TESTS. Since the key of level 4 test could not have been created using regular arrays, as we do not know the size of the test prior to student taking the level 3 test. So both the test and the key will be dynamically allocated, populated and graded here. Again notice the size of the level 4 test is based on the student's performance on level 3. Those who get a chance to answer more questions on level 4, must be added to leve14vec vector. At every level, making/populating the test and the key must be done via call to makeKeys A s function, and computing the student's total point MUST be done via call to gradeTest function. At any stage that is the final stage of testing for a student you MUST write the name of the student along with their total points to an output file called SP23_HWI GradeReport. fxt. You MUST free the dynamic memory allocated throughout your program. I would like to see you use delete at the very first chance you see that the dynamically allocated memory can be freed without causing any disruption in your program. The timely placement of this statement will carry important points in this assignment. SO DO THE DELETE IN A PRECISELY TIMELY FASHION for the full credit. In order to increase the chance of randomness of your data, place the following two lines on top of the main function and not inside the makeKeysAs function. unsigned int seed = time (0); srand (seed); Refer to the sample run of this program for intermediate output that you are asked to generate throughout this simulation. The data provided for this simulation starts with a file that contains the full name of students per line. An example is given below: Car1 Friedrich Gauss Srinivasa Ramanujan Alan Turing The last page of this document lists a sample run of this program that you MUST follow as a guideline for the requirements of this assignment. Carl Friedrich Gauss Srinivasa Ramanujan Alan Turing Leonhard Euler Muhammad ibn Musa al-Khwarizmi Isaac Newton John von Neumann Joseph-Louis Lagrange Emmy Noether Pierre Simon Laplace Johannes Kepler Omar Khayyam Fibonacci Blaise Pascal Hypatia George Boole Henri Poincar Marie Curie Pierre de Fermat Your Name

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!