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

  Android activity program

Design an app with a single activity that shows the following information about that activity every time that activity is visible to the user. This information should be shown in the layout of that activity

  Deal two cards at a time

Deal two cards at a time, print them out.- Check if they are identical, have just the same rank or just same suit or are completely.different. Print out a message indicating the result of your comparison.

  Display an error message and prompt the user again

Write an application that creates a quiz, which contains at least 5 questions about a hobby, popular music, astronomy, or any other personal interest.

  Write a loop that read positive integers from standard input

Any value that is the same as the immediately preceding value is considered a CONSECUTIVE DUPLICATE. In this example, there are three such consecutive duplicates: the 2nd and 3rd 5s and the second 6. Note that the last 3 is not a consecutive dupli..

  Need c++ solution to cover the final stage of euro 2012

From Group Fase to elimination fases, it´s not the user who defines teams, because that must be made automatically according to classification in group fase - considering regulations.

  Write a program to create 100 real random numbers

Write a program to create 100 real random numbers and store it into a 1-D array.

  Assume that section

Assume that section _1 seats are in front of the stage, and the price is expensive. say, each seat in the 1st three rows is $180.00, and each seat in the last two rows is 10% less;

  Prepare a program to palindrome function.

A palindrome is a string whose reversal is identical to the original string.  How many strings using decimal digits (0,1,2,.....,9) of length n are palindromes?

  Takes n number of element from user

Write a C program which takes n number of element from user (where, n is specified by user) and stores data in an array. Then, this program displays the largest element of that array.

  What happens if you use larger numbers to declare thearrays

What happens if you change the NUMMONTHS and NUMYEARS de finitions to other values? Be sure to use both lower and higher values. Describe what happens if you use larger numbers to Declare thearrays.

  8-bit or 16-bit mode, and the prescaling ratio

8-bit or 16-bit mode, and the prescaling ratio. You can assume XTAL = 10M Hz or at the frequency you specify.

  You will write a program that reads a text file

You will write a program that reads a text file, counts the number of words in the file, and the number of occurrences of each character. It will print to a file the number of words, and the number of occurrences of each character, as well as the ..

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