Write a program that grades an online quiz

Assignment Help C/C++ Programming
Reference no: EM131299554

Lab Flowchart

For this assignment, you will write a program that grades an online quiz. The program asks the student to enter his/her answer to 10 multiple-choice questions. The program stores the student's responses in an array and then compares those responses to the correct answers to determine the student's grade.

The correct answers are:
1 2 3 4 5 6 7 8 9 10
B C A D B A D C A B

Your program must use this main procedure. You must implement the inputAnswers and numCorrect procedures and test the program to make sure it works correctly.

For this program both correctAnswers and given are arrays of characters. Note that given is an out parameter to inputAnswers, and numRight is an out parameter to numCorrect.

Raptor makes this a little tricky because even if a user enters a single character as input, Raptor considers it a string instead of a character. To convert an input string to a character, I recommend this procedure.

Modify your program so that it adds an extra line after the quiz grade that displays which question numbers the student got wrong. It could look like this:

You answered the following questions incorrectly: 2 6

You may either include the extra credit in your initial submission, or in an additional submission.

Lab C++

Using the flowchart for Lab as a guide, write a C++ program that does the same thing. Your C++ program must also use two procedures (called functions in C++) to input the student responses and to determine how many answers were correct.

Remember Raptor arrays start at 1, but C++ arrays start at 0.

Here is what the function header for inputAnswers should look like;

void inputAnswers(char given[ ] )

The numRight function should return an int.

There is no extra credit for the C++ version of this assignment, but you may, if you wish, submit a program which is the C++ equivalent of the extra credit version of the Lab Flowchart.

Test your program to make sure it works properly, and then upload just the C++ code in the TurnItIn assignment.

Reference no: EM131299554

Questions Cloud

Prepare a consolidated statement of comprehensive income : The remaining life of these non-current assets is six years.- Prepare a consolidated statement of comprehensive income for the year ended 31 December 20X0.
Create javafx application named to animate man running laps : Create a JavaFX application named RunningMan.java to animate a man running laps. The man should run from left to right until the edge of the window is reached. The man should then begin running in the opposite direction.
Regulatory dimensions of derivatives and commodity markets : Evaluate the ethical, legal, and regulatory dimensions of derivatives and commodity markets.- Analyze major ethical dilemmas and decisions characteristic in derivatives and commodity markets.
What is the average cost of the firm : a. What is the average cost of the firm? b. What can you say about the marginal cost of the firm?
Write a program that grades an online quiz : For this assignment, you will write a program that grades an online quiz. The program asks the student to enter his/her answer to 10 multiple-choice questions.
Prepare a consolidation worksheet : ACCT302 Advanced Financial Accounting Assignment. Give all eliminating entries needed to prepare a consolidation worksheet for 20X9 assuming that Pie Co. uses the fully adjusted equity method to account for its investment in Strawberry Company
What is its percentageafter-tax cost of debt : Micro Spinoffs Inc. issued 20-year debt a year ago at par value with a coupon rate of 6%, paid annually. Today, the debt is selling at $1,130. If the firm's tax bracket is 30%, what is its percentageafter-tax cost of debt? Assume a face value of $..
Prepare a consolidated statement of comprehensive income : Prepare a consolidated statement of comprehensive income for the year ended 31 December 20X0.
Quantity reflects the marginal valuation : Consumer Surplus: The height of the demand curve at a given quantity reflects the marginal valuation of the last unit of that good consumed. For a normal good, an increase in income shifts the demand curve to the right and therefore increases its ..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Your city''s parking violation

Your city's Parking Violation Bureau wants you to write a program to compute fines for parking violations.

  Write function to accept character array

Write down the C++ function which will accept the character array of at most 30 cells. Your function must return true if string and its reverse are identical;

  Design a menu driven program for a florist

Design a menu driven program for a florist. The first screen asks the user to choose indoor plants, outdoor plants, nonplants items, or quit. When the user chooses indoor or outdoor plants, list at least three appropriate plants of your choice.

  Write a program to open a file for reading

Write a program to open a file for reading that has twenty (20) rows and in each row there are three (3) columns.

  Define a class called plot that has private members of lengt

Define a class called Plot that has private members of length and width. Include a constructor and a public function that calculates the area and the length of the boundary of the field.

  Function that returns the maximum value of the array

Arrays are collections of elements of the same type. The elements of the array can be accessed using their position (index) in the array.

  Composite data types (arrays & records)

Composite data types (arrays & records) can be a problem when they are passed as parameters or returned by functions. Why?

  Calculate federal and fica taxes withheld and calculate net

/this program will calculate federal and fica taxes withheld and calculate net pay//for an employee

  Write a program using the rand() function

Write a program using the rand() function and a large array to find the standard deviation, variance and mean as well as the min and max values of the array.

  Code a linked list with a node class

Code a linked list with a node class. The node class should keep a key and pointer as private variables. Make the needed getters and setters.

  User to enter a positive integer with 2 digits

It asks the user to enter a positive integer with 2 digits - If the entered number is out of range, the message "Too difficult!" is printed and the program terminates.

  Consider the following einf gramar for the simple calculator

Consider the following EINF gramar for the simple calculator language mentioned in class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd