Question: Problem 1. Modify class DnDCharacterSheet. Include a second String instance variable that represents the name of the character's player. Provide a set method to change

Problem 1. Modify class DnDCharacterSheet. Include a second String instance variable that represents the name of the character's player. Provide a set method to change the character's player name and a get method to retrieve it. Modify the constructor to specify two parameters one for the character name and one for the character's player. Modify method displayMessage such that it first outputs the welcome message and character name, then outputs "This character belong to: " followed by the character's player. Modify the test application to demonstrate the classs old and new capabilities.

Sample Output

Welcome to the Character Sheet for

John

This character belongs to: Smith

Changing player name to Paul

1 CSC 110 Software Design and Programming I

Welcome to the Character Sheet for

John

This character belongs to: Paul

Changing character name to Bill

Welcome to the Character Sheet for Bill

This character belongs to: Paul

Problem 2. Create a class called Champion that includes four pieces of information as instance variablesa Champion Name (type String), a Champion Summoners Name (type String), the max hit points (type int) and the current hit points (type int). Your class should have a constructor that initializes the four instance variables. Provide a set and a get method for each instance variable. If the max hit points are not positive, set them to 1. If the current hit points are not positive set them to 0. The current hit points cannot be more than the max hit points, if the current hit points are more than the max hit points, set them to max hit points. Write a test application named ChampionTest that demonstrates class Champions capabilities. Create two Champion objects and display the Champion, Summoner, max and current hit points for each object. Then give each Champion a 10% increase on their max hit points and current hit points as a result of a global buff and display each Champions max and current hit points again. Finally deal 500 damage to all champions as a result of a global ultimate ability. Display each Champions max and current hit points again.

What to turn in?

Problem 1

Source code of your DnDCharacterSheet and DnDCharacterSheetTest classes.

Screen shots of a sample execution.

A report that explains how your class works and observations you may have from the execution of DnDCharacterSheetTest, as well as things that may have been surprising. Explain what tests you run in order to make sure that the methods you introduced worked correctly.

Problem 2

Source code of your Champion and ChampionTest classes.

Screen shots of a sample execution.

A report that explains how your class works and observations you may have from the execution of ChampionTest, as well as things that may have been surprising.

Explain what tests you run in order to make sure that the methods you introduced worked correctly.

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!