Write a program that plays a simple trivia game

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

Question: Write a program that plays a simple trivia game. The game should have five questions. Each question has a corresponding answer and point value between 1 and 3 based on the difficulty of the question. Implement the game using three arrays. An array of type String should be used for the questions. Another array of type String should be used to store the answers. An array of type int should be used for the point values. All three arrays should be declared to be of size 5. The index into the three arrays can be used to tie the question, answer, and point value together. For example, the item at index 0 for each array would correspond to question 1, answer 1, and the point value for question 1. The item at index 1 for each array would correspond to question 2, answer 2, and the point value for question 2, and so forth. Manually hardcode the five questions, answers, and point values into your program using trivia of your choice. Your program should ask the player each question one at a time and allow the player to enter an answer. If the player's answer matches the actual answer, the player wins the number of points for that question. If the player's answer is incorrect, the player wins no points for the question. Your program should show the correct answer if the player is incorrect. After the player has answered all five questions, the game is over, and your program should display the player's total score.

Reference no: EM131609026

Questions Cloud

Plans a project that will generate revenues : Olin Inc plans a project that will generate revenues of $10 million. Calculate the amount of NWC the firm will need?
Define the major components of the criminal justice system : What are the major components of the criminal justice system, and do the components collaborate and cooperate to function as a system
What is involved in managing risks within a corporation : After reading chapters in Essentials of Risk Management, you should have a basic understanding of what is involved in managing risks within a corporation.
Explain concerning workplace violence : concerning workplace violence. Where and why does workplace violence occur. Employees in what professions are most susceptible
Write a program that plays a simple trivia game : The game should have five questions. Each question has a corresponding answer and point value between 1 and 3 based on the difficulty of the question.
Briefly outline the government response to terrorism : Distinguish between the different types of terrorism. Briefly outline the government response to terrorism.
Standard of living of people in an unimaginable way : How has Communication, with the recent advancement in the areas of computer technology, telecommunications technology, software and information technology
Explain the components of transportation decisions : Explain the components of transportation decisions in a supply chain and include in your post a description of the tradeoff between responsiveness.
Identify post-graduation professional goals : Explain how you will overcome threats from each of the five forces while achieving your professional goal(s) after graduation from the MS-IST Program.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write c programs to implement some of the functions

You are required to write a C program to translate LC-3's AND and ADD assembly language instructions into machine code. The detailed requirements are as below: The assembly instructions are stored in a file. Each line of the file stores exactly on..

  Find the sixth maclaurin polynomial for sin x

Find the sixth Maclaurin polynomial for sin x and use Chebyshev economization to obtain a lesser-degree polynomial approximation.

  Create the first part of a rock paper scissors game

Create the first part of a Rock, Paper, Scissors game.  Tell the user what you are playing and then ask them to choose either rock, paper or scissors.  After they choose tell them what they chose.  If they make an invalid choice, let them know.  Y..

  Give a recursive definition of s.

Let S be the set of positive integers that can be written as a sum of one or more 4's and/or 7's. For example, 7 ? S and 18 ? S (because 18 = 4 + 7 + 7)

  Public transport fare ticketing system

Implement and test a public transport fare ticketing system.

  Conditional jump statements causes a jump to dest

Determine whether each of the conditional jump statements causes a jump to dest.

  Write a matrix multiplication program

Write a C++, matrix multiplication program which you can instrument to monitor and measure execution time as a function of problem size. Make sure it works in Microsoft Visual Studio.

  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.

  Define write a c program to calculate the total running time

Write a C program to calculate the total running time for a collection of songs. The user enters the running times in the form 5:08 (five minutes and eight seconds), and enters 0:00 to indicate the end of input. (It is also valid for the data to r..

  Write functions which solve each of the following problems

write functions which solve each of the following problems. you must place all of your functions in one project. if you

  Calculates the equivalent total number of seconds

The program should declare 4 variables, hours, minutes, seconds, and totalSeconds, all of type int. You may declare at most 1 additional variable for temporary usage. No other variable are allowed.

  Lines starting from line number

Write a program in C with following operations on a file: 1. Display each line with line number. 2. Display m lines starting from line number n, where m and n are taken as input.

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