Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c++ please add comments 1) The provided battle_with_fns.cpp has several common bugs, most of them for using functions. It is intended to be a very

c++ please add comments
image text in transcribed
image text in transcribed
1) The provided battle_with_fns.cpp has several common bugs, most of them for using functions. It is intended to be a very simple prototype for a role-playing game where a hero and an enemy take turns attacking each other until one side's life points reach 0 or less. Your job is to fix the bugs and submit the fixed program. Here are a couple sample runs for when you get things to work. Simulate a single battle in a rpg For testability, enter seed int: 0 The enemy lost 7 life points The enemy has 13 life points left The hero lost 8 life points The hero has 12 life points left The enemy lost 9 life points The enemy has 4 life points left The hero lost 6 life points The hero has 6 life points left The enemy lost 10 life points The enemy has -6 life points left The hero wins! Simulate a single battle in a rpg For testability, enter seed int: 2 The enemy lost 8 life points The enemy has 12 life points left The hero lost 7 life points The hero has 13 life points left The enemy lost 5 life points The enemy has 7 life points left The hero lost 10 life points The hero has 3 life points left The enemy lost 5 life points The enemy has 2 life points left The hero lost 5 life points The hero has -2 life points left The enemy wins! #include #include #include include

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_2

Step: 3

blur-text-image_3

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

How often is an identifying entity also a weak entity?

Answered: 1 week ago