Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Page 2 of 5 COP 3 0 2 2 Java Programming Programming Project 4 See Assignment for due date Project Outcomes: Create a Java application

Page
2
of 5
COP3022 Java Programming
Programming Project 4
See Assignment for due date
Project Outcomes:
Create a Java application that:
1. Implements file reading and writing
2. Implements API and user defined exceptions.
3. Catches and recovers from thrown exceptions
4. Develops a program with several classes.
5. JUnit Testing
6. Creates UML class diagrams.
Prep Reading
Zybooks Chapters 1-10
Project Requirements:
1. In this project you will implement a trivia game. It will ask random
trivia questions, evaluate their answers and keep score. The project
will also have an administrative module that will allow for managing
the question bank. Question bank management will include adding
new questions, deleting questions and displaying all of the questions,
answers and point values.
2. Project details
1. Create a class called GameAdministrator the question bank with
the following functionality:
1. Command line menu.
2. Stores question data in a text file (See details of file
structure below)
3. Enter new questions including answer and question point
value. Point value should be 1 to 5.
4. Display all of the questions, associated answers and point
value.
5. The question bank must be stored in a text file with the
following structure
1. Question Id
2. Question
3. Answer
4. Question point value (an int)
6. Create and use a user defined exception to ensure the
point value is between 1 and 5(inclusive)
7. For the purposes of this project the question bank will
contain at least 15 questions.
8. Example of text menu:
Trivia Game Administration
1. List all questions
2. Add question
3. Quit the Administrator
Enter choice:
2. Create a class called Player with the following functionality
1. Players real name
2. Players gamer nick name
3. Current total score. Total score is a summation of all the
Players game sessions.
4. Store the players information in a file named for the
players real name such as JohnSmith.txt (Suggest using a
text file)
5. Accessor methods for all instance fields.
6. Mutators for real name and nick name.
3. Create a class called Question including
1. A question ID, question, answer, point value (see sample
question file )
2. Accessor and mutator methods for all instance fields.
4. Create a class TriviaGame with the following functionality.
1. Reads the Questions file
2. Creates Questions object for each question
3. Stores the Question objects in collection of Question
objects. (Array)
4. Using random number generation, get a random question
for the player to answer and returns that question.
5. Evaluate the answer and returns the outcome. The
evaluation should ignore case.
5. Create a class to run the game
1. Command line
2. Ask if new player or existing player.
3. If new player create a player object and ask for required
player information(name, nick name, etc)
4. If existing player
1. prompt for player name
2. read player information from a text file that contains
the players information.
3. File format
1. comma delimited
2. name, nick name, total score.
4. If file not found handle exception robustly by
providing error message and asking again.
5. Create trivia game object
6. Start the game, the game sequence is
1. Display a question
2. Prompt for an answer
3. Evaluate the answer
4. Display the evaluation results
5. Update the players total score
6. Display the player current game score.
7. Continue to display new questions until current game
is over. (5 questions)
8. Once game is over
1. Display his nick name, current game score and
total score.
2. Write or overwrite the current player data to
the file.
9. Allow another player to play or quit the program.
10. Example text based game run after player
determined.
Question 1
Who is the president?
Obama
That is correct!
Your score is 1
Question 2
Who is buried in Grants tomb?
Grant
That is correct!
Your score is 4
Question 3
What is the capital of Connecticut?
New Haven
Wrong. The correct answer is Hartford
Your score is 4
6. Programmer Design information
1. As you may have noticed much of the details for this
project are left up to you.
2. You may create any additional classes, methods (especially
private utility methods) or instance fields you think may be
needed, however you will be graded on good object
oriented design, so points will be taken off for unnecessary
classes, methods or unused instance fields or instance
fields that should be local variables.
3. There is no need to add any additional functionality such
as checking for duplicate questions, or duplicate player
files etc, just focus on the required functionality.
3. JUnit Testing
1. Create a JUnit Test class for the Question Class
2. Test the constructors, accessor and Mutator methods.
4. Create 2 UML Class Diagram for this project.
1. Design Version - completed prior to coding the project to assist
with coding.
2. Final Version - completed after

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

13th Edition Global Edition

1292263350, 978-1292263359

More Books

Students also viewed these Databases questions

Question

Why it is not adequate simply to obtain competitive advantage?

Answered: 1 week ago