American Young Coder (AYC)

AYC logo
Loading Events

« All Events

  • This event has passed.

5 PM – Intro to Java – William

July 28, 2023 @ 5:00 pm - 7:00 pm

Today we did:
  1. Reviewed HW and Practice Quiz
  2. Quiz 🙂
  3. Started MonsterInheritance
    1. Created run() method
Homework:
  1. Create a Monster class:
    1. Monsters should have 3 attributes:
      1. String species
      2. int health
      3. int maxAttack
    2. Create getter and setter methods
    3. Create a constructor
    4. Create a doDamage() method:
      1. Has 1 int parameter that subtracts specified value from the monster’s health
    5. Create a heal() method:
      1. Same as doDamage() but adds to monster’s health
  2. Implement listAllMonsters() in MonsterInheritanceMain.java:
    1. For each monster, if the Monster is dead (health is <= 0), then print: “- (monster species) – Dead”
    2. Otherwise print “- (monsterspecies) – (monster health) health”
  3. Create a main() method that calls run()

Might be hard to test this week’s homework, so don’t worry if you can’t 🙂

If you have any questions, please email me at williamsmith@ayclogic.com

Details

Date:
July 28, 2023
Time:
5:00 pm - 7:00 pm
Event Categories:
,
Verified by MonsterInsights