Question: Instructions Write a Java project called Week2_Ass_GamerCode and a class called testGCode Gamer codes must be entered and validated. For valid gamer codes, the status
Instructions Write a Java project called Week2_Ass_GamerCode and a class called testGCode Gamer codes must be entered and validated. For valid gamer codes, the status of the player, the gamer's ranked position and level of game play must be displayed. The gamer code (e.g. NPREP#211) must be entered in the main method. Write a method called isValid() that will receive the input string and test for validity. The code is valid if the first 5 characters are alphabetical characters, followed by a hash character and a maximum number of 3 digits. The first character can only be the letter N, I or P Return a boolean value (True if the input is valid or False if the input is invalid) Write a method called determineStatus() that will receive the first character of the code and determine and return the status of the player. The following applies: N - Novice I - Intermediate P - Professional Write a method called determineLevel() that will receive the ranked position of the gamer and return a description of the level of play of the gamer. 1 to 20 : Expert 21 to 50 : Advanced 51 to 100 : Competent > 100: Beginner The two "determine"-methods can only be executed if the gamer code that was entered, is valid. If the code is invalid, make use of a loop in the main method to ask the user to keep on entering a gamer code again and again until the code is valid. Sample run 1: Enter a gamer code: NCOOL#211 The code is valid The status of the gamer is Novice The gamer is ranked as number 211 - Beginner Sample run 2: Enter a gamer code: PJAK#13 The code is invalid. Please try again. Enter a gamer code: PJAKE#1300 The code is invalid. Please try again. Enter a gamer code: PJAKE#13 The status of the gamer is Professional The gamer is ranked as number 13 - Expert Sample run 3: Enter a gamer code: ITJAP41 The code is invalid. Please try again. Enter a subject code: ITJAP#41 The status of the gamer is Intermediate The gamer is ranked as number 41 - Advanced
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
