Create dungeons and dragons character sheet code. Create one class "Character" so that each character only has one attri

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: 899603
Joined: Mon Aug 02, 2021 8:13 am

Create dungeons and dragons character sheet code. Create one class "Character" so that each character only has one attri

Post by answerhappygod »

Create dungeons and dragons character sheet code. Create oneclass "Character" so that each character only has one attribute -Strength. Then, create another "Monster" class so that each monsteronly has a Strength attribute also. Use a loop to cycle through thecharacters, and output who for each character if they will beat themonster based on whose Strength attribute is higher. Update thestrength of the monster such that every time a character attacksthe monster, the monster's strength is depleted by the character.The monster's minimum strength value is 0. In the event of a tie,the character should win. See the desired output below:
Create Dungeons And Dragons Character Sheet Code Create One Class Character So That Each Character Only Has One Attri 1
Create Dungeons And Dragons Character Sheet Code Create One Class Character So That Each Character Only Has One Attri 1 (232.03 KiB) Viewed 31 times
Please enter the number of characters you wish to have: 4 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 wins Monster strength: 9 Dustin is fighting Demogorgon Dustin wins Monster strength: 0 Lucas is fighting Demogorgon Lucas wins Monster strength: 0 Demogorgon
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply