Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The primary purpose of this lab is to give you an opportunity to work with strings and dynamic memory allocation. This is to be compiled

The primary purpose of this lab is to give you an opportunity to work with strings and dynamic memory allocation.

This is to be compiled in C not C++.

Your assignment is to write a program which will grade a series of True False test results.

NOTE: YOU CANNOT USE GLOBAL VARIABLES IN THIS PROGRAM! YOU WILL GET A 0 IF YOU DO!

Problem Description

The user will enter the number of students who have taken the test and the number of questions on the test. The user will then enter a string that contains a series of Ts and Fs which is the answer key for the test. An example answer key would be:

TTFFTFFTFT

This would indicate that there were 10 questions in this test. The number of students can be any number > 0. The number of questions can be any number > 0. If either of these inputs are

The user will then enter the following information for each student:

1.A 10 character student ID which contains any combination of letters and numbers.

2.One or more blank spaces.

3.A string of Ts and Fs and Xs which represent the students answers to the test question. An X means that the student left the answer blank. This string will have the same length as the answer key.

The program must read in the data for each student. The students answers are compared to the answer key, and the students ID and grade (percentage correct) are then output.

After all the tests have been graded, the overall class average is output.

In addition to grading all the tests and calculating the class average, the overall performance on each test question must be displayed. That is, for each question determine and display what percentage of the class answered the question incorrectly.

The following is an example illustrating how the program must work.

image text in transcribed

Requirements

1.)Your program will need arrays to read in the answer key, the student id, and the student answers. Only the length of the student id is fixed. Therefore, the other arrays MUST be dynamically allocated.

2.)You will also need an array to keep track of how many students get each question wrong. This array MUST be dynamically allocated.

3.)You MUST use scanf_s for reading the strings into the character arrays.

4.)You must comment each significant part of your program!!!

this is due tonight and the code i have doesnt work how the example code works, definetly need help. I WILL RATE and thank you in advance.

CAWrightStatel CEG2170 Fall 2018)Labs1Solutions\Lab 101De... - Enter the number of students and the number of questions on the test: 5 1e Enter grade key: TTFFTTFFTF Enter student id and student answers for all students WD12345678 TTFFTFTFTF WD 12345678 scored 88.00% ST43243256 TFTFTFTFTF ST4324 3256 scored 68.00% GP99883344 TTFFTTFFTT GP99883344 scored 96.00% RT85746321 TFTFTFTTF RT85746 321 scored 48.00% KW12321231 TTFFTTFFT KW|2321231 scored 106.00% The average test grade was 74.08% Question 1 missed by 0.00% of students Question 2 missed by 48.00% of students Question 3 missed by 48.00% of students Question 4 missed by 0.00% of students Question 5 missed by 0.00% of students Question 6 missed by 68.00% of students Question 7 missed by 68.00% of students Question 8 missed by 28.00% of students Question 9 missed by 28.00% of students Question 10 missed by 28.00% of students Press any key to continue CAWrightStatel CEG2170 Fall 2018)Labs1Solutions\Lab 101De... - Enter the number of students and the number of questions on the test: 5 1e Enter grade key: TTFFTTFFTF Enter student id and student answers for all students WD12345678 TTFFTFTFTF WD 12345678 scored 88.00% ST43243256 TFTFTFTFTF ST4324 3256 scored 68.00% GP99883344 TTFFTTFFTT GP99883344 scored 96.00% RT85746321 TFTFTFTTF RT85746 321 scored 48.00% KW12321231 TTFFTTFFT KW|2321231 scored 106.00% The average test grade was 74.08% Question 1 missed by 0.00% of students Question 2 missed by 48.00% of students Question 3 missed by 48.00% of students Question 4 missed by 0.00% of students Question 5 missed by 0.00% of students Question 6 missed by 68.00% of students Question 7 missed by 68.00% of students Question 8 missed by 28.00% of students Question 9 missed by 28.00% of students Question 10 missed by 28.00% of students Press any key to continue

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_2

Step: 3

blur-text-image_3

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

SQL Server T-SQL Recipes

Authors: David Dye, Jason Brimhall

4th Edition

1484200616, 9781484200612

More Books

Students also viewed these Databases questions