American Young Coder Academy – Indo

Loading Events

« All Events

  • This event has passed.

5 PM – Python OOP – Bill

July 19, 2022 @ 5:00 pm - 6:00 pm

Gamas substitute

Today We Do
  1. We finished with the Book system.
Homework
  1. Create a new project in Pycharm “MonsterInheritance”. If you are having problem creating a new Pycharm project, no worries, you can do this homework inside Book System project
  2. Create a new file monster.py. Inside the file, create a new Monster class with the following attributes:
    • species
    • health
    • max_attack
  3. Inside Monster class, create a new method get_info(self) which will RETURN (not print) like this “<species> – <health> healths – <max_attack> Max attack points.”
  4. Create a new file monster_system.py. Inside create MonsterSystem class.
  5. Inside MonsterSystem class, create application_loop(self) which will continuously display the following menu and get input from user. If user enter “exit”, stop the loop.
  6. Call the MonsterSystem application_loop method to run the program.
  7. Welcome to AYCLOGIC Adventure game.
    
    Your have 200 health remaining.
    Please choose your monster: 
    - Troll - 50 healths - 30 Max attack points.
    - Water Golem - 30 healths - 20 Max attack points.
    - Dragon - 100 healths - 50 Max attack points.
    Enter your selection (enter "exit" to quit): asdfasdf
    You have entered an invalid selection. Please try again
    
    Your have 200 health remaining.
    Please choose your monster: 
    - Troll - 50 healths - 30 Max attack points.
    - Water Golem - 30 healths - 20 Max attack points.
    - Dragon - 100 healths - 50 Max attack points.
    Enter your selection (enter "exit" to quit): exit
    Thank you for playing AYCLOGIC Monster Adventure

     

Details

Date:
July 19, 2022
Time:
5:00 pm - 6:00 pm
Event Categories:
,
Verified by MonsterInsights