Using C + + programming language , You are required to implement a prototype quiz / game
Fantastic news! We've Found the answer you've been seeking!
Question:
Using C programming language You are required to implement a prototype quizgame in which the user is repeatedly presented with the name of a river and must guess which of four continents it is in Europe Asia, Africa or South America At the prototype stage, the following functionality should be implemented:
The program should read the four text files provided, containing rivers from each continent and store the data using a suitable data structure. All file reads must be implemented in the constructor method of the River class in accordance with the RAII design pattern. File reads must not occur elsewhere.
Implement a method which returns a randomly chosen river
Implement a method which returns the correct continent for a given river. This should return the empty string if the input is not a valid river.
Implement a method which takes two river parameters and returns a Boolean indicating whether or not they are in the same continent. This should return false if either parameter is not a valid river.
Implement a method which will provide the user with input and output for a single round of the game. This should include:
a The names of two rivers output on separate lines. These should be the first two lines of output and nothing else should appear on either of them.
b An opportunity for the user to enter their response user instructions are already provided by a template UI so there is no need for any additional prompts here
c The words correct or incorrect after user input. Inputs other than sd or q should be considered incorrect. Scores and totals should be updated appropriately.
d The name of the correct continent for each river.
e The method should return false if the user quits q and true otherwise
Examples of acceptable output can be found at the end of this brief. Keep it simple.
Implement further methods to return the score number of correct answers and total number of questions asked, as well as to reset the scores at the end of a game.
A template Visual Studio project will be provided with the necessary text files included, as well as the starter code for the project. This project has a Feedback configuration which provides you with details of any issues you need to fix as well as awarding a provisional mark out of for requirements It is unlikely that this mark will be changed after submission but the markers reserve the right to change it if you have done something particularly unusual or unexpected with your code.
The game should work seamlessly once all the issues are resolved so you should spend most of your time running the feedback configuration. You should notice when running the debug configuration that the template project has an embryonic UI in place. Only the methods in parts and need to be completed to finish the quiz UI
Implementation code for should be written in the rivers.cpp and rivers.h files. Implementation code for and should be written in the game.cpp and game.h files. In part it is very important that you use the two parameters in and out instead of cin and cout for the playRound method. The relevant tests will fail and UI marks will not be awarded otherwise.
Each method signature in riversh contains a comment which you must complete, identifying the worst case time complexity of each of the methods as you have implemented them. You should complete these comments using O notation, where n is the number of rivers in the quiz in other words, you can consider a rivers name to have a constant worst case length Please consider Data class implementation, UI implementation, Time complexity, The program need to read the data from which is not provided.
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date: