Create a single array of five trivia objects

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

Question: Modify Programming Project to use a single array instead of three arrays. This can be accomplished by creating a Trivia object that encapsulates the question, answer, and point value for a particular trivia question. Next, create a single array of five Trivia objects instead of three separate arrays for the question, answer, and point values. This change will make your game more scalable if there were ever additional properties to add to a Trivia object (you would not need to add another array for each property). Although the program has internally changed to a single array of objects, the execution of the program should be identical to before

Programming Project: 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: EM131609078

Questions Cloud

What is the role of vision in successful leadership : What is the role of vision in successful leadership? What is the role of effective communication - Which competencies are most important in leadership
Challenges entrepreneurs face in the first : Based on what you have learned, what are some of the challenges entrepreneurs face in the first 2 years of a start-up?
Determine your non-negotiable items : Determine your non-negotiable items. Will it offer you opportunities to advance? Are you comfortable sitting at a desk all day, or do you prefer to travel?
What are pros and cons of using social media : What are pros and cons of using social media as school communication tool? Identify 2-3 common social media marketing mistakes that schools make.
Create a single array of five trivia objects : Modify Programming Project to use a single array instead of three arrays. This can be accomplished by creating a Trivia object that encapsulates the question.
Explain biochemical theories and criminal behaviors : Identify and explain at least two different biochemical theories and provide examples of criminal behaviors associated with each theory
The involvement of the criminal justice system : Evaluate the beginning and end of the involvement of the criminal justice system in this scenario.
Explain adults with regards to the criminal law system : What are the positive reasons for treating juveniles differently from adults with regards to the criminal law system and does the type of crime
Develop a positive relationship within the person : Start with an attention getter, and then build to your thesis statement - develop a positive relationship within the person

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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