Write an "Are you a fan?" quiz program. The program will quiz the user on a topic music (keep the topic appropriate!!!).  Note: Please cite all the sources you use in your code. Program Details The quiz program MUST include three types of questions: A. Multiple Choice (5 options a-e) The user enters in a character 'a' through 'e' for their answer. Example: 1) The population of Spokane is roughly what? Please enter a character a-e. a) 215k b) 20k c) 105k d) 400k e) 550k Please enter a character a-e: B. Numeric Response The user enters a numeric response to an open-ended question. I recommend prompting the user to enter an integer. If you choose to use floating-point numbers, be specific to the user about how they should enter their response (i.e. rounded and/or a certain number of decimal places). Example: How many students are enrolled in this class? Please enter an integer: C. True/False (String) The user enters the string "true" or "false" in response to a statement. Example: North Idaho College used to be called "Coeur d'Alene Junior College"? Please enter true or false: Program Requirements  Your quiz MUST contain 10 questions. These 10 questions include at least 2 of each type of question:  For each question: Explicitly tell the user the format in which they should enter their response. Number each question. Always tell the user if they answer correctly or incorrectly. If the user answered incorrectly, provide the correct answer. Use a if/else structure to do this.  Count the number of correct answers (this is the user's quiz score).  At the end of the quiz, tell the user their final score, plus a fun statement about how much of a "fan" they are of the quiz topic (use an if/else if/else structure (multiple alternatives if), which means you need at least 3 different fun statements based on the user's score).  Students MUST adhere to the CS150/CS151 style guideLinks to an external site.. Here are common ones:  File header comment  In-line comments  The proper naming convention of your variables, function names, constant variables, or all identifiers. They should be descriptive of the value they are storing.  Proper indentation!!! Example Run Here is a shortened example run of a quiz based on Game of Thrones. Credit for much of the content goes to these two online quizzes: Q1Links to an external site. and Q2Links to an external site.. Welcome to the Game of Thrones Quiz!! 1) Which Dire-wolf belonged to Robb? a) Lady b) Summer c) Grey Wind d) Nimeria e) Ghost Please enter a character a-e: b Sorry, that is wrong. The answer is c) Grey Wind. 2) How many dragons does Daenerys own? Please enter an integer: 3 You are correct! [output removed for brevity] 9) Drogon is one of Daenerys' dragons? Please enter true or false: false You need to read the book again! Daenerys actually had three dragons, Drogon, Rhaegal and Viserion. 10) Who wins the Kingsmoot on the iron isles? a) Asha Greyjoy b) Reek c) Balon Greyjoy d) Euron Greyjoy e) Ramsay Bolton Please enter a character a-e: d Woohoo, look at you go! You scored 9 questions correctly. Wow, you know your Game of Thrones! Final Requirement  Refactor your code by creating the function below. Then, call this function instead to print out the multiple-choice questions in main.  What the function does?  Displays the question number, question, and choice.  If there are only three choices, pass an empty string to the rest of the choices and this function should not print those choices.  This function SHOULD NOT handle any user input. void multipleChoice(int num, string question, string chA, string chB, string chC, string chD, string chE); int num is the question number string question is the multiple-choice question string ch# are the parameters for the different choices, where chA is for choice a), chB is for choice b), so on...

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Write an "Are you a fan?" quiz program. The program will quiz the user on a topic music (keep the topic appropriate!!!). 

Note: Please cite all the sources you use in your code.

Program Details

The quiz program MUST include three types of questions:

A. Multiple Choice (5 options a-e)

The user enters in a character 'a' through 'e' for their answer.

Example:

1) The population of Spokane is roughly what? Please enter a character a-e. a) 215k b) 20k c) 105k d) 400k e) 550k Please enter a character a-e:

B. Numeric Response

The user enters a numeric response to an open-ended question. I recommend prompting the user to enter an integer. If you choose to use floating-point numbers, be specific to the user about how they should enter their response (i.e. rounded and/or a certain number of decimal places).

Example:

How many students are enrolled in this class? Please enter an integer:

C. True/False (String)

The user enters the string "true" or "false" in response to a statement.

Example:

North Idaho College used to be called "Coeur d'Alene Junior College"? Please enter true or false:

Program Requirements

  •  Your quiz MUST contain 10 questions. These 10 questions include at least 2 of each type of question:
  •  For each question:
    1. Explicitly tell the user the format in which they should enter their response.
    2. Number each question.
    3. Always tell the user if they answer correctly or incorrectly.
      1. If the user answered incorrectly, provide the correct answer.
      2. Use a if/else structure to do this.
  •  Count the number of correct answers (this is the user's quiz score).
  •  At the end of the quiz, tell the user their final score, plus a fun statement about how much of a "fan" they are of the quiz topic (use an if/else if/else structure (multiple alternatives if), which means you need at least 3 different fun statements based on the user's score).
  •  Students MUST adhere to the CS150/CS151 style guideLinks to an external site.. Here are common ones:
    •  File header comment
    •  In-line comments
    •  The proper naming convention of your variables, function names, constant variables, or all identifiers. They should be descriptive of the value they are storing.
    •  Proper indentation!!!

Example Run

Here is a shortened example run of a quiz based on Game of Thrones. Credit for much of the content goes to these two online quizzes: Q1Links to an external site. and Q2Links to an external site..

Welcome to the Game of Thrones Quiz!! 1) Which Dire-wolf belonged to Robb? a) Lady b) Summer c) Grey Wind d) Nimeria e) Ghost Please enter a character a-e: b Sorry, that is wrong. The answer is c) Grey Wind. 2) How many dragons does Daenerys own? Please enter an integer: 3 You are correct! [output removed for brevity] 9) Drogon is one of Daenerys' dragons? Please enter true or false: false You need to read the book again! Daenerys actually had three dragons, Drogon, Rhaegal and Viserion. 10) Who wins the Kingsmoot on the iron isles? a) Asha Greyjoy b) Reek c) Balon Greyjoy d) Euron Greyjoy e) Ramsay Bolton Please enter a character a-e: d Woohoo, look at you go! You scored 9 questions correctly. Wow, you know your Game of Thrones!

Final Requirement

  •  Refactor your code by creating the function below. Then, call this function instead to print out the multiple-choice questions in main.
  •  What the function does?
    •  Displays the question number, question, and choice.
    •  If there are only three choices, pass an empty string to the rest of the choices and this function should not print those choices.
    •  This function SHOULD NOT handle any user input.
void multipleChoice(int num, string question, string chA, string chB, string chC, string chD, string chE);
  • int num is the question number
  • string question is the multiple-choice question
  • string ch# are the parameters for the different choices, where chA is for choice a), chB is for choice b), so on...
Expert Solution
steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education