Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN JAVA : create code similar to the sample output below Sample output: run: Generating the Fighter Cleric(329){Str=11(+0) Con=11(+0) Int=11(+0) Wis=16(+3) Dex=15(+2) Cha=11(+0)} {Fighter=305 Ranger=308

IN JAVA: create code similar to the sample output below

image text in transcribed

image text in transcribed

Sample output:

run: Generating the Fighter Cleric(329){Str=11(+0) Con=11(+0) Int=11(+0) Wis=16(+3) Dex=15(+2) Cha=11(+0)} {Fighter=305 Ranger=308 Mage=308 Cleric=329 Rogue=320 Bard=305} Rouge(376){Str=14(+2) Con=15(+2) Int=13(+1) Wis=11(+0) Dex=17(+3) Cha=15(+2)} {Fighter=365 Ranger=350 Mage=337 Cleric=331 Rogue=376 Bard=366} Mage(353){Str=16(+3) Con=10(+0) Int=16(+3) Wis=15(+2) Dex= 8(-1) Cha=12(+1)} {Fighter=320 Ranger=315 Mage=353 Cleric=332 Rogue=299 Bard=306} Bard(298){Str= 5(-2) Con=12(+1) Int=12(+1) Wis=12(+1) Dex= 9(+0) Cha=14(+2)} {Fighter=219 Ranger=261 Mage=290 Cleric=293 Rogue=239 Bard=298} Fighter(361){Str=18(+4) Con=11(+0) Int=14(+2) Wis=13(+1) Dex=12(+1) Cha=13(+1)} {Fighter=361 Ranger=330 Mage=341 Cleric=326 Rogue=341 Bard=326} Got one!! Fighter(361){Str=18(+4) Con=11(+0) Int=14(+2) Wis=13(+1) Dex=12(+1) Cha=13(+1)} {Fighter=361 Ranger=330 Mage=341 Cleric=326 Rogue=341 Bard=326} Generating the Ranger Ranger(376){Str=15(+2) Con=17(+3) Int=17(+3) Wis=12(+1) Dex=14(+2) Cha= 9(+0)} {Fighter=364 Ranger=376 Mage=350 Cleric=328 Rogue=364 Bard=318} Got one!! Ranger(376){Str=15(+2) Con=17(+3) Int=17(+3) Wis=12(+1) Dex=14(+2) Cha= 9(+0)} {Fighter=364 Ranger=376 Mage=350 Cleric=328 Rogue=364 Bard=318} Generating the Mage Mage(362){Str=14(+2) Con=15(+2) Int=18(+4) Wis=11(+0) Dex=12(+1) Cha=12(+1)} {Fighter=339 Ranger=347 Mage=362 Cleric=321 Rogue=345 Bard=336} Got one!! Mage(362){Str=14(+2) Con=15(+2) Int=18(+4) Wis=11(+0) Dex=12(+1) Cha=12(+1)} {Fighter=339 Ranger=347 Mage=362 Cleric=321 Rogue=345 Bard=336} Generating the Cleric
Cleric(355){Str=10(+0) Con=15(+2) Int=12(+1) Wis=16(+3) Dex=11(+0) Cha=13(+1)} {Fighter=300 Ranger=339 Mage=322 Cleric=355 Rogue=292 Bard=317} Got one!! Cleric(355){Str=10(+0) Con=15(+2) Int=12(+1) Wis=16(+3) Dex=11(+0) Cha=13(+1)} {Fighter=300 Ranger=339 Mage=322 Cleric=355 Rogue=292 Bard=317}
Generating the Rouge
Fighter(363){Str=17(+3) Con=17(+3) Int=10(+0) Wis= 8(-1) Dex=12(+1) Cha=11(+0)} {Fighter=363 Ranger=350 Mage=270 Cleric=286 Rogue=319 Bard=287} Ranger(322){Str=14(+2) Con=14(+2) Int=12(+1) Wis=11(+0) Dex= 9(+0) Cha=15(+2)} {Fighter=319 Ranger=322 Mage=310 Cleric=316 Rogue=289 Bard=319} Rouge(359){Str=12(+1) Con=12(+1) Int=17(+3) Wis=10(+0) Dex=16(+3) Cha=10(+0)} {Fighter=317 Ranger=306 Mage=338 Cleric=284 Rogue=359 Bard=321} Got one!! Rouge(359){Str=12(+1) Con=12(+1) Int=17(+3) Wis=10(+0) Dex=16(+3) Cha=10(+0)} {Fighter=317 Ranger=306 Mage=338 Cleric=284 Rogue=359 Bard=321}
Generating the Bard
Mage(322){Str=13(+1) Con=10(+0) Int=16(+3) Wis= 9(+0) Dex= 8(-1) Cha=13(+1)} {Fighter=280 Ranger=271 Mage=322 Cleric=271 Rogue=280 Bard=301} Bard(265){Str=10(+0) Con=12(+1) Int=11(+0) Wis= 8(-1) Dex=10(+0) Cha=11(+0)} {Fighter=259 Ranger=263 Mage=257 Cleric=247 Rogue=259 Bard=265} Bard(334){Str=11(+0) Con=13(+1) Int=14(+2) Wis=11(+0) Dex=13(+1) Cha=14(+2)} {Fighter=304 Ranger=308 Mage=326 Cleric=308 Rogue=320 Bard=334} Bard(373){Str=10(+0) Con=11(+0) Int=16(+3) Wis=13(+1) Dex=13(+1) Cha=17(+3)} {Fighter=296 Ranger=300 Mage=367 Cleric=335 Rogue=329 Bard=373} Got one!! Bard(373){Str=10(+0) Con=11(+0) Int=16(+3) Wis=13(+1) Dex=13(+1) Cha=17(+3)} {Fighter=296 Ranger=300 Mage=367 Cleric=335 Rogue=329 Bard=373}
Final Party: Fighter(361){Str=18(+4) Con=11(+0) Int=14(+2) Wis=13(+1) Dex=12(+1) Cha=13(+1)} {Fighter=361 Ranger=330 Mage=341 Cleric=326 Rogue=341 Bard=326} Ranger(376){Str=15(+2) Con=17(+3) Int=17(+3) Wis=12(+1) Dex=14(+2) Cha= 9(+0)} {Fighter=364 Ranger=376 Mage=350 Cleric=328 Rogue=364 Bard=318} Mage(362){Str=14(+2) Con=15(+2) Int=18(+4) Wis=11(+0) Dex=12(+1) Cha=12(+1)} {Fighter=339 Ranger=347 Mage=362 Cleric=321 Rogue=345 Bard=336} Cleric(355){Str=10(+0) Con=15(+2) Int=12(+1) Wis=16(+3) Dex=11(+0) Cha=13(+1)} {Fighter=300 Ranger=339 Mage=322 Cleric=355 Rogue=292 Bard=317} Rouge(359){Str=12(+1) Con=12(+1) Int=17(+3) Wis=10(+0) Dex=16(+3) Cha=10(+0)} {Fighter=317 Ranger=306 Mage=338 Cleric=284 Rogue=359 Bard=321} Bard(373){Str=10(+0) Con=11(+0) Int=16(+3) Wis=13(+1) Dex=13(+1) Cha=17(+3)} {Fighter=296 Ranger=300 Mage=367 Cleric=335 Rogue=329 Bard=373} Highest Rated: Ranger(376){Str=15(+2) Con=17(+3) Int=17(+3) Wis=12(+1) Dex=14(+2) Cha= 9(+0)} {Fighter=364 Ranger=376 Mage=350 Cleric=328 Rogue=364 Bard=318} Lowest Rated: Cleric(355){Str=10(+0) Con=15(+2) Int=12(+1) Wis=16(+3) Dex=11(+0) Cha=13(+1)} {Fighter=300 Ranger=339 Mage=322 Cleric=355 Rogue=292 Bard=317} BUILD SUCCESSFUL (total time: 0 seconds)
The setting: This program creates a party of 6 fantasy-adventure game characters. In the game, each character has 6 attributes called "stats". The 6 stats are: Strength, Constitution, Intelligence, Wisdom, Dexterity, and Charisma. These stats have values that range from 3 (terribly low) to 18 (amazingly high). The higher the stat, the better for that character. A character's collection of 6 stats is called the "stat block" for that character. In addition, each character must have a profession. There are six professions: Fighter, Ranger, Mage, Cleric, Rogue, and Bard. Stats and Professions: Each profession benefits from different stats. For example, Fighters benefit from a high Strength the most while Bards benefit from a high Charisma. Each profession has 1 primary stat, 2 secondary stats, 2 tertiary stats, and one "dump" stat. The primary stat is the most important while the dump stat is the least. Below is a chart of each profession and the stat combination that represents the stats' relative importance for that profession. In the chart, P" stands for primary, "S" for secondary, "T" for tertiary, and "D" for dump. Str Con Int Wis Cha Dex S P S D T T S T S T D Profession Fighter Ranger Mage Cleric Rouge Bard T D P S T S T S T D S S S D P T T T D S T S P Character stat block rating for each profession: To evaluate the quality of a stat block for a given profession, use this formula:((primary * 10) + (secondary1 * 5) + (secondary2 * 5) + (tertiary1 * 2) + (tertiary2 * 2) + dump). The ordering of the two secondary stats and the two tertiary stats is not important. This formula will give a maximum rating of 450 for a stat block of all 18's. The same formula applies to all professions, but each profession has a different combination of primary, secondary, tertiary, and dump stats, so the same stat block will usually have a different rating for different professions. Stat bonuses: Each stat has a bonus based on its value. A stat's bonus is calculated using the following formula: ((stat - 10)/2). Not that this bonus is always a whole number. Every bonus must be displayed with a positive or negative sign. Zero bonuses should be shown with a positive sign. Examples: the bonus for 18 is +4 ((18-10)/2), the bonus for 10 is +0((10-10) / 2), and the bonus for 7 is -1 ((7-10) / 2). Random stat generation: One common way to generate stats for characters is to roll dice. We will use the following technique: roll 4 six-sided dice and drop the lowest roll. This will result in a stat between 3 and 18, but will skew the average slightly higher than just rolling 3 six-sided dice. To generate a stat block, you must roll like this for each of the character's 6 stats. In order to simulate a die roll, create an object of Java's Random class (you will need to import java.util.Random) and use the nextInt() method. Here's an example: Declares an object of type Random Random rand = new Random(); int dieRoll Gets a random int between 0 and rand.nextInt (6) + 1; 5 and adds 1 making it random between 1 and 6 The task: You are to write a program that generates a party of 6 "powerful" characters. One character per profession must be generated. A "powerful" character is one with a rating of 350 or better in their highest rated profession. To do this: for each profession you must roll random stat blocks until you get one that is "powerful" in that profession. If you look at the sample output, notice how the program generates a Fighter for the party by rolling stat blocks until it gets one with Fighter as the highest rated profession and also that rating is 350 or higher Once the party is generated, display it followed by the highest and lowest rated members. Displaying a character: Each time you display a character, you must show it in the following format, but fit it on one line: Best profession with rating Stat block with bonuses Rouge (353) {Str=14(+2) Con=13(+1) Int=13(+1) Wis=14(+2) Dex=16(+3) Cha= 9(+0) } {Fighter=344 Ranger=337 Mage=318 Cleric=320 Rogue=353 Bard=303) All professions with ratings for each one In your output, make this one long line, not two as shown here een. Requirements: All output is to the scree Every character displayed must be on one line of output, not two (the line is too long for this document). Don't forget to turn in only.java files and don't forget your comment headers. Handling ties when comparing things: when comparing things for any reason, if there is a tie, choose just one of them. I don't care which you choose or how. Big Hint: Don't use the name Character for any entity class. Class Character is already used in Java! The setting: This program creates a party of 6 fantasy-adventure game characters. In the game, each character has 6 attributes called "stats". The 6 stats are: Strength, Constitution, Intelligence, Wisdom, Dexterity, and Charisma. These stats have values that range from 3 (terribly low) to 18 (amazingly high). The higher the stat, the better for that character. A character's collection of 6 stats is called the "stat block" for that character. In addition, each character must have a profession. There are six professions: Fighter, Ranger, Mage, Cleric, Rogue, and Bard. Stats and Professions: Each profession benefits from different stats. For example, Fighters benefit from a high Strength the most while Bards benefit from a high Charisma. Each profession has 1 primary stat, 2 secondary stats, 2 tertiary stats, and one "dump" stat. The primary stat is the most important while the dump stat is the least. Below is a chart of each profession and the stat combination that represents the stats' relative importance for that profession. In the chart, P" stands for primary, "S" for secondary, "T" for tertiary, and "D" for dump. Str Con Int Wis Cha Dex S P S D T T S T S T D Profession Fighter Ranger Mage Cleric Rouge Bard T D P S T S T S T D S S S D P T T T D S T S P Character stat block rating for each profession: To evaluate the quality of a stat block for a given profession, use this formula:((primary * 10) + (secondary1 * 5) + (secondary2 * 5) + (tertiary1 * 2) + (tertiary2 * 2) + dump). The ordering of the two secondary stats and the two tertiary stats is not important. This formula will give a maximum rating of 450 for a stat block of all 18's. The same formula applies to all professions, but each profession has a different combination of primary, secondary, tertiary, and dump stats, so the same stat block will usually have a different rating for different professions. Stat bonuses: Each stat has a bonus based on its value. A stat's bonus is calculated using the following formula: ((stat - 10)/2). Not that this bonus is always a whole number. Every bonus must be displayed with a positive or negative sign. Zero bonuses should be shown with a positive sign. Examples: the bonus for 18 is +4 ((18-10)/2), the bonus for 10 is +0((10-10) / 2), and the bonus for 7 is -1 ((7-10) / 2). Random stat generation: One common way to generate stats for characters is to roll dice. We will use the following technique: roll 4 six-sided dice and drop the lowest roll. This will result in a stat between 3 and 18, but will skew the average slightly higher than just rolling 3 six-sided dice. To generate a stat block, you must roll like this for each of the character's 6 stats. In order to simulate a die roll, create an object of Java's Random class (you will need to import java.util.Random) and use the nextInt() method. Here's an example: Declares an object of type Random Random rand = new Random(); int dieRoll Gets a random int between 0 and rand.nextInt (6) + 1; 5 and adds 1 making it random between 1 and 6 The task: You are to write a program that generates a party of 6 "powerful" characters. One character per profession must be generated. A "powerful" character is one with a rating of 350 or better in their highest rated profession. To do this: for each profession you must roll random stat blocks until you get one that is "powerful" in that profession. If you look at the sample output, notice how the program generates a Fighter for the party by rolling stat blocks until it gets one with Fighter as the highest rated profession and also that rating is 350 or higher Once the party is generated, display it followed by the highest and lowest rated members. Displaying a character: Each time you display a character, you must show it in the following format, but fit it on one line: Best profession with rating Stat block with bonuses Rouge (353) {Str=14(+2) Con=13(+1) Int=13(+1) Wis=14(+2) Dex=16(+3) Cha= 9(+0) } {Fighter=344 Ranger=337 Mage=318 Cleric=320 Rogue=353 Bard=303) All professions with ratings for each one In your output, make this one long line, not two as shown here een. Requirements: All output is to the scree Every character displayed must be on one line of output, not two (the line is too long for this document). Don't forget to turn in only.java files and don't forget your comment headers. Handling ties when comparing things: when comparing things for any reason, if there is a tie, choose just one of them. I don't care which you choose or how. Big Hint: Don't use the name Character for any entity class. Class Character is already used in Java

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

2. Describe how technology can impact intercultural interaction.

Answered: 1 week ago