Refer to the DND code (or you may refer to my solution). Rewrite the code such that each character has only one characte

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Refer to the DND code (or you may refer to my solution). Rewrite the code such that each character has only one characte

Post by answerhappygod »

Refer To The Dnd Code Or You May Refer To My Solution Rewrite The Code Such That Each Character Has Only One Characte 1
Refer To The Dnd Code Or You May Refer To My Solution Rewrite The Code Such That Each Character Has Only One Characte 1 (31.37 KiB) Viewed 20 times
Refer To The Dnd Code Or You May Refer To My Solution Rewrite The Code Such That Each Character Has Only One Characte 2
Refer To The Dnd Code Or You May Refer To My Solution Rewrite The Code Such That Each Character Has Only One Characte 2 (31.37 KiB) Viewed 20 times
Refer To The Dnd Code Or You May Refer To My Solution Rewrite The Code Such That Each Character Has Only One Characte 3
Refer To The Dnd Code Or You May Refer To My Solution Rewrite The Code Such That Each Character Has Only One Characte 3 (62.01 KiB) Viewed 20 times
Refer to the DND code (or you may refer to my solution). Rewrite the code such that each character has only one characteristic: Strength. You do NOT have to include the part about writing the file... you can omit that. Each character should just have one attribute: strength. Then, create another monster class that also has a strength characteristic. Use a loop to cycle through the characters, and output who will beat the monster based upon if the character or the monster has a higher strength value. Update the strength of the monster such that every time a character attacks the monster, the monster's strength is depleted by the strength of the character. The minimum value the monster strength can be is 0 . In the event of a tie, the character wins.

Please enter the number of characters you wish to hav Please enter a name: Will Please enter Will's strength: 7 Please enter a name: Mike Please enter Mike's strength: 4 Please enter a name: Dustin Please enter Dustin's strength: 9 Please enter a name: Lucas Please enter Lucas's strength: 6 Please enter the name of the monster: Demogorgon Please enter the monster's strength: 20 Please enter the monster's strength: 20 Will is fighting Demogorgon Demogorgon wins Monster strength: 13 Mike is fighting Demogorgon Demogorgon wins Monster strength: 9 Dustin is fighting Demogorgon Dustin wins Monster strength: 0 Lucas is fighting Demogorgon Lucas wins Monster strength: 0
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply