American Young Coder

AYC logo
Loading Events

« All Events

  • This event has passed.

9 AM – Intro To Java

April 25, 2021 @ 9:00 am - 10:00 am

  1. We continued with MonsterSystem program. We added the heal, damage and exit feature.
  2. We installed Android Studio.
  3. Homework:
    1. Continue with MonsterSystem program. Inside Monster.java do the following: create 3 methods:
      1. rangeDamage(int damage)
      2. melleDamage(int damage)
      3. magicDamage(int damage, String magicAttackType)
    2. For now in all of these 3 new methods, just do the same thing as we did with the damage(int damage) method, which is just to reduce the monster’s health by the damage point. Next week we will learn on how to improve this using inheritance.
    3. Change MonsterSystem second menu to be like this
      1. What do you want to do with the Troll:
        1. Magic attack
        2. Melle attack
        3. Range attack
        4. Heal
        Enter your selection: 2
        
        How much melle damage you want to do to Troll: 30
        You damaged the Troll and it has 10 healths remaining.
      2. For each of the attacks above, call the appropriate method in Monster. For example, if the user selected “2” for melle attack, you need to call melleDamage(int damage).
      3. For Magic attack, you need to ask the user 2 question, the damage and magic type. Look at below for example:
        1. What do you want to do with the Troll:
          1. Magic attack
          2. Melle attack
          3. Range attack
          4. Heal
          Enter your selection: 2
          
          What kind of magic attack you want to do:
          1. Fire magic - 10 damage
          2. Water magic - 10 damage
          3. Earth magic - 12 damage
          4. Wind magic - 8 damage
          Enter your selection: 1
          You damaged the Troll and it has 10 healths remaining.

Details

Date:
April 25, 2021
Time:
9:00 am - 10:00 am
Event Categories:
,