Homework: Ultimate Battle


Scenario

You are programming a game where 2 objects of your choosing (e.g., Robots, Dinosaurs, People) battle. Each object has health and power.


Instructions

  1. Create a class representing your object with:

    Instance variables:

    • String name
    • int power
    • int health
    • MAKE YOUR OWN

    Static variables:

    • double fightDuration

    Instance methods:

    • void attack()
    • void printStatus()
    • MAKE YOUR OWN

    Class methods:

    • static int strongerFighter()
    • static void beginBattle()
    • MAKE YOUR OWN
  2. In main:

    • Create two objects.
    • Use instance methods to attack and print status.
    • Use static methods to compare, print a fact, and start the battle.
// Code Here