Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

[Java] [Strategy design pattern] The upcoming Guitar Hero XIII: Legends of Rock

ID: 3876885 • Letter: #

Question

[Java] [Strategy design pattern] The upcoming Guitar Hero XIII: Legends of Rock needs a player configuration system. Guitar Hero XIII lets you play three different characters (Slash, Jimi Hendrix, and Angus Young). Each character can play one of three available guitars (Gibson SG, Fender Telecaster or Gibson Les Paul) and perform a unique solo act (Put the Guitar on Fire, Jump off stage, Smash the Guitar).

1) Implement a player configuration system in Java using the Strategy design pattern.

2) Some guitar players trash their guitars on stage. Modify code so players can change guitars on the fly.

3) Draw a class diagram of the design.

Source code: drive.google.com/open?id=1uXEmGHVwIGr9Xo_-cNez3_gdFpFzWCwn

character guitar solo act Slash Gibson Les Paul Smash the Guitar Jimi Hendrix Fender Telecaster Guitar on fire Angus Young (AC/DC) Gibson SG Jump off stage

Explanation / Answer

1)

Here’s a class containing the Java Main method to help you on your way. Note that the contents of this class are not exhaustive with respect to your assignment -- add more features to the code below to fully test/demonstrate your solution.

public class GuitarHero {
    public static void main(String[] args) {
        GameCharacter player1 = new GameCharacterSlash();
        GameCharacter player2 = new GameCharacterHendrix();
        player1.playGuitar();
        player2.playGuitar();
        player1.playSolo();
        player2.playSolo();
    }
}

Hint1: You should use the Java Duck example from Chapter 1 of HFDP.
Hint2: It helps if you draw a class diagram *before* you start coding. (you can use a tool for this such as tinyUML -- the uml link on our website contains links to lots of lighweight UML editing programs)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote