Im working with java. Thank you so much for helping me. I need to…
Question Answered step-by-step Im working with java. Thank you so much for helping me. I need to… Im working with java. Thank you so much for helping me. I need to make a code with this requirement In this part you will write a complete class called RacquetBallMatch. Here are the details of the program requirement: RacquetballMatch.Programming Assignment:Racquet Ball Match Problem Statement:Problem Statement:This assignment will acquaint you with the use of while loops and boolean expressions. You will create a program that acts as a score keeper of a racquet ball game between two players. The program will continually ask the user who the winner of every point is as the game is played. It will maintain the scores and declare the match is over, using these rules:(1) A game is over whena. one of the players wins 7 points or,b. one of the players wins 3 points while the other player has 0 points.(2) The match is over when one of the players wins 2 games.The program will run a single match. See sample runs belowWrite a complete class called RacquetBallMatch that has the following:• (8 points) playGame method: that plays one full game of 7 points between two players Allen and Bob.This method accepts a Scanner object and returns the name of the winner of this game.Specifically, this method repeatedly asks the user “who the winner of the next point is” until the game is over by following the rules mentioned above.The user is expected to enter the first letter of the player’s names, i.e. A for Allen and B for Bob. (Make the input case insensitive) See sample runs below.• (2 points) printGameScores method: accepts points of two players and prints the scores. See sample runs below.• (2 points) printMatchScores method: accepts game counts of two players and prints the scores. See sample runs below.• (5 points) main method: o Welcomes the user. o Declares and initializes a Scanner object to be used throughout to read user input. oCalls the playGame method repeatedly until the winner of a 3-game set can be declared. For example, if Bob wins the first 2 games, he would be declared the match winner and the program would stop.• (3 points) Include appropriate program documentation and formatting including: Your first and last name, the date of submission, code comments necessary to explain the operation of your program, and proper indentation of the code, etcNotes:• For each of the methods, think about the following:What is the return type, what parameter(s) will it need to perform the task, and accordingly decide the method signature for each.• Don’t use static variables (variables that are declared outside of all the methods).It is ok to have class constants (variables declared with final keyword). • Use while-loops to handle the repetition. • Make sure there is no code-duplication.• Use a Boolean variable that captures the winning condition for a game or the match and use it in the while-loop conditions.Sample run 1 (text in orange is what user has entered as input): —-jGRASP exec: java RacquetBallMatch.******************************************************************Welcome to The All NorthWest Racquet Ball TournamentToday’s Players: Allen and Bob******************************************************************Playing game #1Game Score Allen Bob0 0Winner of the next point (A for Allen/B for Bob): bGame Score Allen Bob 0 1Winner of the next point (A for Allen/B for Bob): bGame Score Allen Bob 0 2Winner of the next point (A for Allen/B for Bob): BGame Score Allen Bob 0 3 Game #1 over! Bob won game #1. ******************************************************************Match score (# of games won): Allen 0, Bob 1******************************************************************Playing game #2Game Score Allen Bob0 0Winner of the next point (A for Allen/B for Bob): aGame Score Allen Bob 1 0Winner of the next point (A for Allen/B for Bob): bGame Score Allen Bob 1 1Winner of the next point (A for Allen/B for Bob): AGame Score Allen Bob 2 1Winner of the next point (A for Allen/B for Bob): bGame Score Allen Bob 2 2Winner of the next point (A for Allen/B for Bob): bGame Score Allen Bob 2 3Winner of the next point (A for Allen/B for Bob): aGame Score Allen Bob3 3Winner of the next point (A for Allen/B for Bob): bGame Score Allen Bob 3 4Winner of the next point (A for Allen/B for Bob): bGame Score Allen Bob 3 5Winner of the next point (A for Allen/B for Bob): bGame Score Allen Bob 3 6Winner of the next point (A for Allen/B for Bob): bGame Score Allen Bob 3 7Game #2 over!Bob won game #2.******************************************************************Match score (# of games won): Allen 0, Bob 2******************************************************************—-jGRASP: operation complete.Sample run 2 (text in orange is what user has entered as input):—-jGRASP exec: java RacquetBallMatch******************************************************************Welcome to The All NorthWest Racquet Ball TournamentToday’s Players: Allen and Bob******************************************************************Playing game #1Game Score Allen Bob 0 0Winner of the next point (A for Allen/B for Bob): aGame Score Allen Bob 1 0Winner of the next point (A for Allen/B for Bob): AGame Score Allen Bob 2 0Winner of the next point (A for Allen/B for Bob): aGame Score Allen Bob 3 0Game #1 over! Allen won game #1.******************************************************************Match score (# of games won): Allen 1, Bob 0******************************************************************Playing game #2Game Score Allen Bob0 0Winner of the next point (A for Allen/B for Bob): bGame Score Allen Bob 0 1Winner of the next point (A for Allen/B for Bob): BGame Score Allen Bob0 2Winner of the next point (A for Allen/B for Bob): bGame Score Allen Bob 0 3Game #2 over!Bob won game #2.******************************************************************Match score (# of games won): Allen 1, Bob 1******************************************************************Playing game #3Game Score Allen Bob0 0Winner of the next point (A for Allen/B for Bob): aGame Score Allen Bob 1 0Winner of the next point (A for Allen/B for Bob): bGame Score Allen Bob 1 1Winner of the next point (A for Allen/B for Bob): aGame Score Allen Bob 2 1Winner of the next point (A for Allen/B for Bob): bGame Score Allen Bob 2 2Winner of the next point (A for Allen/B for Bob): bGame Score Allen Bob 2 3Winner of the next point (A for Allen/B for Bob): bGame Score Allen Bob 2 4Winner of the next point (A for Allen/B for Bob): AGame Score Allen Bob 3 4Winner of the next point (A for Allen/B for Bob): bGame Score Allen Bob 3 5Winner of the next point (A for Allen/B for Bob): bGame Score Allen Bob 3 6Winner of the next point (A for Allen/B for Bob): BGame Score Allen Bob 3 7Game #3 over!Bob won game #3.******************************************************************Match score (# of games won): Allen 1, Bob 2******************************************************************Congratulations! Bob won the match!******************************************************************—-jGRASP: operation complete. Computer Science Engineering & Technology Object-Oriented Programming Share QuestionEmailCopy link Comments (0)


