Question: You will write 2 classes, each in their own file ( named accordingly ) You must use constructor chaining when it s applicable. Visibility for
You will write classes, each in their own file named accordingly
You must use constructor chaining when its applicable.
Visibility for required elements:
o All classes, constructors, and methods should be public.
o All variables should be private.
You may add to aid you if you want
o Methods, if they are private
o Variables, if they are private static final
You may not add any other classes or constructors
GameGenre
It represents a genre of games, along with the cost of games in that genre before discounts
It will have: instance variables: genre String and baseGameCost intarg constructor that takes a String and an int in that order and sets the instance variables, Getters for both instance variables, Setter for baseGameCost. The setter should set the variable to if the parameter is less than else it should be the value from the parameter, toString method to provide a String representation of instances of the class, with the format genre games start at $baseGameCostwithout the brackets void hostCompetitiveTournamentGamer method,If any of the gamers doesnt own the game, it will print in its own line using
printlnWe cannot host the tournament, not all gamers have the game!"
Otherwise, if less than two players are in the tournament, it will decrease the
games popularity by If the popularity drops below it should be set to
Otherwise, it will do the following
Increase the games popularity by
Have each of the gamers play the game note that this should further
increase the games popularity and increase each gamer skill level as
expected
Print in its own line the winner of the tournament, determined by the
gamer with the highest skill level. In case of a draw, the first gamer in
the array that has the highest skill level wins.
o Format for the line: gamer name wins the tournament!"
You must use constructor chaining when its applicable.
Visibility for required elements:
o All classes, constructors, and methods should be public.
o All variables should be private.
You may add to aid you if you want
o Methods, if they are private
o Variables, if they are private static final
You may not add any other classes or constructors
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
