Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

import java.util.Scanner; public class RtView { // keeps the connection with the console private final Scanner scanner = new Scanner(System. in ); //stored here, so

import java.util.Scanner;  public class RtView { // keeps the connection with the console private final Scanner scanner = new Scanner(System.in); //stored here, so you we are re-accessing System.in every call /**  * Splash screen for the game. Must contain the words Knight Fight and Round Table Games  * Have fun!  *  * Example:  * ======== WELCOME ======  * = Round Table Games =  * = Introduces =  * = =  * = Knight Fight =  * = Quest for the Grail =  * = =  * =======================  */  public void splash() { //TODO Student  } /**  * Exit the game. Feel free to change, but leave the close() on the scanner  */  public void exitGame() { display("Thank you for playing! "); scanner.close();// leave here } /**  * Displays the dice in a graphical format based on the who is rolling, and the dice roll  * @param name name of the thing rolling dice  * @param roll the value of the roll (1-6 only for now)  */  public void displayRoll(String name, int roll) { //TODO by student  display(name + " rolls: "); } /**  * A string value representing a one on six sided dice  * @return string graphical representation  */  public String diceOne() { return "+---------+ " + "| | " + "| * | " + "| | " + "+---------+ "; } /**  * a string value representing a two on a six sided dice  * @return string graphical representation  */  public String diceTwo() { return "+---------+ " + "| * | " + "| | " + "| * | " + "+---------+ "; } /**  * a string value representing a three on a six sided dice  * example  * +---------+  * | * |  * | * |  * | * |  * +---------+  * @return string graphical representation  */  public String diceThree() { return null; //TODO by studewnt  } /**  * a string value representing a four on a six sided dice  * +---------+  * | * * |  * | |  * | * * |  * +---------+  * @return string graphical representation  */  public String diceFour() { return null; //TODO by student  } /**  * a string value representing a five on a six sided dice  * +---------+  * | * * |  * | * |  * | * * |  * +---------+  * @return string graphical representation  */  public String diceFive() { return null; //TODO by student  } /**  * a string value representing a six on a six sided dice  * +---------+  * | * * |  * | * * |  * | * * |  * +---------+  *  * @return string graphical representation  */  public String diceSix() { return null; //TODO by student  } // ----- do not edit below this line ---------- /**  * Simple prints to the screen. but used as a method in case the mode changes  * @param str value to print to the screen (no new lin)  */  public void display(String str) { System.out.print(str); } /**  * The main menu  * @return string value of the main menu  */  public static String mainMenuOptions() { return "========= Command Options ========= " + "= 1. (L)ist Knights = " + "= 2. (F)ight Monsters = " + "= 3. Get (T)arot Card = " + "= 4. E(x)it Game = " + "=================================== " + "Enter command name (list), letter or number"; } /**  * Prints out a question and gets the client input  * @param question the question to print  * @return the value lowerCase of the clients answer  */  public String getAction(String question) { display(question); String x = scanner.nextLine(); System.out.println(); return x.toLowerCase(); // to force case to be the same } /**  * displays the main menu  */  public void displayMainMenu() { display(mainMenuOptions() + " "); } } 

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

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

More Books

Students also viewed these Databases questions