Question: Write a driver program that will create 2 warrior objects, have the user enter their information (and thus set the Warriors private data fields by

Write a driver program that will create 2 warrior objects, have the user enter their information (and thus set the Warriors private data fields by way of constructor or set methods) and then have the warriors fight to the death. Heres how you determine the winner: The warrior with the higher strength wins, unless the other warriors IQ is more than 20 points higher, in which case the smarter warrior outsmart their opponent and wins.

Given the following:

Warrior 1 Warrior 2

IQ strength IQ strength

100 34 90 65 Warrior 2 wins on strength

130 34 90 65 Warrior 1 wins by IQ

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!