Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You have been asked to write a program to grade several multiple-choice exams. The exam has 20 questions, each answered with a letter in the

You have been asked to write a program to grade several multiple-choice exams. The

exam has 20 questions, each answered with a letter in the range of a through f. The

answers key is declared in the program as constant of type string. An example of answer

key is abcdefabcdefabcdefab. Your program should work for any other answer key.

The program should first ask users for the number of students to be graded. Then it

should have a while loop in the main function. For each student, the loop repeatedly asks

users to enter a student ID number and a string of characters representing the answers of

the student. The student ID number is of type string and should contain exactly 7 digits

(each digit between 0 and9). If a student ID number is incorrect, the program displays

and error message and prompts the user to re-enter that student information. If a student

gives more answers than necessary (more than 20 in our case), the program automatically

truncates the extra answers. On the other hand, if a student provides less number of

answers, the remaining unanswered questions are considered as being answered wrongly.

If for a given answer, the user enters a letter other than a, b, c, d, e, or f then the

question is considered as being wrongly answered.

Furthermore, in each while loop in the main routine, your program should compute a

percentile score for the student by comparing the answers for that student to the answers

key, and a curved grade in A though F based on the following:

>=90

A

<90 and>=80

B

<80 and>= 70

C

<70 and>= 60

D

<60 and>= 50

E

<50

F

The results of each student are displayed by the student in the format: percentile score

and a curved grade in A though F.

The program should also compute and display the following statistics for the graded

answers: Average score, Maximum score, and Minimum score.

2

Use the following inputs to test your program:

Answer key = abcdefabcdefabcdefab

abbcdaefcdffbceffadbc

Please enter the number of students to be graded: 5

For each of the following students, enter the Student ID and answers:

Student 1: 1234567 abcdefabcdefabcdefab

Score: 100% A

Student 2: 9876543 abddefbbbdefcbcdefac

Score: 75% C

Student 3: 555444656 abcdefabcdefabcd

ERROR in the Student ID number. Please re-enter Student 3 information:

Student 3: 5554446 abcdefabcdefabcd

Score: 80% B

Student 4: 4445556 abcdefabcdefabcdefabcdaedf

Score: 100% A

Student 5: 5551112 abbcdaefcdffbceffadbc

Score: 30% F

Statistics:

Average Score: 75%

Minimum Score: 100%

Maximum Score: 30%

The score of student 5 is 30% (6/20). Student 5 gives 21 answers, compared to 20

answers in the key. We discard any extra answers, which are more than 20.

To provide solutions to this project, you need to deliver the following components on the

basis of principles in software engineering.

Component 1: Software System Design

Use the function decomposition method to describe all functions that you will implement

in this project. Use arrow lines to indicate the relationship among all functions, and their

calling sequence. Compare the merits of alternative designs.

Component 2: Software Debugging

Record the major debugging history when you implement your design. The following

table is a format that you need to use in this project.

Error Type Tool Used Correction

Error type includes compilation error and run-time error.

Specify which debug tool you use in finding each bug. Possible tools include manual step-wise trace, break point, conditional break point. If you use MS VC++, make sure to set your project as a debug version (Win32 Debug) instead of a release version in the projection setting of VC++ development studio. In addition, you need to set theoptimization option in the C/C++ panel of projection setting to Default and check on the Generation browse info. The debug info should be set to Program Database for Edit and Continue. In the Link panel of the project setting, check on the Generate debug info and Link incrementally.

Provide a correction solution to each bug in the third column of the above table.

Component 3: Assurance of Software Correctness

Find out a set of preconditions and postconditions for each function in this project. In your implementation, use assert( ) to accomplish the goal of software correctness assurance. Summarize the result in the following table.

Function Name Precondition Postcondition

Component 4: Software Testing

Design a complete suite of test cases for all possible scenarios in using your program. Summarize your test plan in the following table.

Reason for Test Case Input Value Expected Output Observation

Component 5: Software Documentation

Provide the following standard information for each function that will be created in your

project:

// Purpose: ...

// Author: ....

// Creation Date: ...

// Modification Date: ...

// Input: ...

// Output: ...

// Precondition:

// Postcondition:

// Keyword:

6

Component 6: Screen Shots

Create a number of screen shots to demonstrate the running results of your program. You can use Shift+PrtSc to grab a screen shot and then use Microsoft Paint program to convert it to an image file, which can then be inserted into your Word document.

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 And Expert Systems Applications 23rd International Conference Dexa 2012 Vienna Austria September 2012 Proceedings Part 1 Lncs 7446

Authors: Stephen W. Liddle ,Klaus-Dieter Schewe ,A Min Tjoa ,Xiaofang Zhou

2012th Edition

3642325998, 978-3642325991

More Books

Students also viewed these Databases questions

Question

How can I improve my sensitivity to diversity issues?

Answered: 1 week ago

Question

Describe the new structures for the HRM function. page 676

Answered: 1 week ago