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 2 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 discount(s).
It will have: instance variables: genre (String) and baseGameCost (int),2-arg 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 0 if the parameter is less than 0 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 $[baseGameCost]"(without the brackets), void hostCompetitiveTournament(Gamer[]) method,If any of the gamers doesnt own the game, it will print in its own line (using
println),"We 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 5. If the popularity drops below 0, it should be set to 0
Otherwise, it will do the following
Increase the games popularity by 10
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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!