Create a project called the Gamers project. 1.1 Create a NGamer object class for beginners (novice gamers) who are joining the gamers club for the first time and an ExpGamers object clas experienced gamers. NGamer -code:string -name:string -dateReg:string -numNGamers:int +NGamer () +NGamer (name:string) +getNumNGamers ():int +getCode():string +getName():string -compileCode():void +setNumNGamers ():void -setDateReg():void +toString():string

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

java Programing language

Create a project called the Gamers project.
1.1 Create a NGamer object class for beginners (novice gamers) who are joining the gamers club for the first time and an ExpGamers object class for
experienced gamers.
NGamer
-code:string
-name:string
-dateReg:string
-numNGamers:int
+NGamer ()
+NGamer (name:string)
+getNumNGamers ():int
+getCode():string
+getName():string
-compileCode():void
+setNumNGamers ():void
-setDateReg():void
+toString():string
The code for the gamer must consist of the first and last character of the gamers' name. Both characters must be capital letters (HINT: Make use of
string methods like substring and toUpperCase)
The compileCode() method to compile the code must be called from the parameterised constructor.
The date must be a string in the format day/month/year (short date). The setDateReg() method to get the date must be called from the parameterised
constructor.
Increment the number of gamers in both constructors.
The toString() method must return a string with the code, name and date registered.
1.2
ExpGamers
-code:string
-name:string
-rating:int
-numEGamers:int
+ExpGamer ()
+ExpGamer (name:string)
+getNumEGamers ():int
+getCode():string
+getName():string
-compileCode():void
+setNumEGamers ():void
-setRating():void
+toString():string
The rating of the gamers must be generated using the Random class. The rating must be a random value in the range of 0 to 100. (HINT: First test your
code with a range of 0 to 10).
The code must consist of the first and last character of the gamers' name followed by the gamers' rating. Both letters of the alphabet must be capital
letters.
The compileCode() method to compile the code must be called from the parameterised constructor.
The date must be a string in the format day/month/year (short date). The setRating() method to generate the rating value must also be called from the
parameterised constructor.
Increment the number of gamers in both constructors.
The toString() method must return a string with the code, name and rating.
Note: The static variables/data fields and methods in UML class diagrams are underlined.
P Type here to search
a
») ENG
Transcribed Image Text:Create a project called the Gamers project. 1.1 Create a NGamer object class for beginners (novice gamers) who are joining the gamers club for the first time and an ExpGamers object class for experienced gamers. NGamer -code:string -name:string -dateReg:string -numNGamers:int +NGamer () +NGamer (name:string) +getNumNGamers ():int +getCode():string +getName():string -compileCode():void +setNumNGamers ():void -setDateReg():void +toString():string The code for the gamer must consist of the first and last character of the gamers' name. Both characters must be capital letters (HINT: Make use of string methods like substring and toUpperCase) The compileCode() method to compile the code must be called from the parameterised constructor. The date must be a string in the format day/month/year (short date). The setDateReg() method to get the date must be called from the parameterised constructor. Increment the number of gamers in both constructors. The toString() method must return a string with the code, name and date registered. 1.2 ExpGamers -code:string -name:string -rating:int -numEGamers:int +ExpGamer () +ExpGamer (name:string) +getNumEGamers ():int +getCode():string +getName():string -compileCode():void +setNumEGamers ():void -setRating():void +toString():string The rating of the gamers must be generated using the Random class. The rating must be a random value in the range of 0 to 100. (HINT: First test your code with a range of 0 to 10). The code must consist of the first and last character of the gamers' name followed by the gamers' rating. Both letters of the alphabet must be capital letters. The compileCode() method to compile the code must be called from the parameterised constructor. The date must be a string in the format day/month/year (short date). The setRating() method to generate the rating value must also be called from the parameterised constructor. Increment the number of gamers in both constructors. The toString() method must return a string with the code, name and rating. Note: The static variables/data fields and methods in UML class diagrams are underlined. P Type here to search a ») ENG
Increment the number of gamers in both constructors.
The toString) method must return a string with the code, name and rating.
Note: The static variables/data fields and methods in UML class diagrams are underlined.
For this task. you thus need to create two object classes.
1.3
• Create a testGamers class. Do the following:
• Declare two arrays - one for each type of gamers. The arrays must be able to keep 10 objects each.
• Use a while-loop to enter the information of gamers.
• First, indicate whether it is a new gamer (N) or an experienced gamer (E). Use X to quit input.
• Enter the name of the gamer. For each gamer, create the correct type of objects (decision structure - if statement) and save the object in the
correct array.
• Note: Each array must have its own counter variable
Enter type of gamers (N or E) x to quit:
Enter the nane of the gamer:
Peter
Enter type of ganers (N or E) X to quit:
Enter the name of the gamer:
John
Enter type of gamers (N or E) x to quit:
N
Enter the name of the gamer:
Samantha
Enter type of gamers (N or E) x to quit:
Enter the name of the gamer:
- .- .
Samantha
Enter type of gamers (N or E) x to quit:
N
Enter the name of the gamer:
Enter type of gamers (N or E) X to quit:
Enter the name of the gamer
David
Enter type of gamers (N or E) X to quit:
• Write a static method called displayNGamers() to receive the array and display a numbered list of the gamers using a for-loop and
the toString) method.
• In the main method, call the displayNGamers() method to display a numbered list of the new gamers.
List of new gamers
Code
Name
Date Registered
1
Samantha
e8/83/2020
Diane
88/03/2020
• Write a static method called displayEGamers() to receive the array and display a numbered list of the gamers using a for-loop and
the toString() method.
• Call the displayEGamers() method to display the numbered list of the experienced gamers.
List of experienced gamers
Code
Name
Rating
PR82
JN61
John
61
3
D03
David
Transcribed Image Text:Increment the number of gamers in both constructors. The toString) method must return a string with the code, name and rating. Note: The static variables/data fields and methods in UML class diagrams are underlined. For this task. you thus need to create two object classes. 1.3 • Create a testGamers class. Do the following: • Declare two arrays - one for each type of gamers. The arrays must be able to keep 10 objects each. • Use a while-loop to enter the information of gamers. • First, indicate whether it is a new gamer (N) or an experienced gamer (E). Use X to quit input. • Enter the name of the gamer. For each gamer, create the correct type of objects (decision structure - if statement) and save the object in the correct array. • Note: Each array must have its own counter variable Enter type of gamers (N or E) x to quit: Enter the nane of the gamer: Peter Enter type of ganers (N or E) X to quit: Enter the name of the gamer: John Enter type of gamers (N or E) x to quit: N Enter the name of the gamer: Samantha Enter type of gamers (N or E) x to quit: Enter the name of the gamer: - .- . Samantha Enter type of gamers (N or E) x to quit: N Enter the name of the gamer: Enter type of gamers (N or E) X to quit: Enter the name of the gamer David Enter type of gamers (N or E) X to quit: • Write a static method called displayNGamers() to receive the array and display a numbered list of the gamers using a for-loop and the toString) method. • In the main method, call the displayNGamers() method to display a numbered list of the new gamers. List of new gamers Code Name Date Registered 1 Samantha e8/83/2020 Diane 88/03/2020 • Write a static method called displayEGamers() to receive the array and display a numbered list of the gamers using a for-loop and the toString() method. • Call the displayEGamers() method to display the numbered list of the experienced gamers. List of experienced gamers Code Name Rating PR82 JN61 John 61 3 D03 David
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Introduction to computer system
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education