Programming 1 IA 01. Create a Java class called GameCharacterthat hasthe following attrbutes: The class should have the following methods: getName(): This method should return the name of the character. setName(String name): This method should set the name of the character. getHitPoints(): This method should return the current hit points of the character, setHitPoints(int hitPoints): This method should set the hit points of the character getDamagePoints: This method should return the damage points of the character. setDamagePoints (int damagePoints): This method should set the damage points of the character. attack(GameCharacter character): This method should subtract the character's damage points from the target character's hit points. Create a Player class that extends the Game Character class and has the following attributes: level (an integer) experiencePoints (an integer) The class should have the following methods: Create an Enemy class that extends the Came Character lass and has the following attributes: The class should have the following methods; from the enemy's hit points and print a message indicating how much damage was dealt. In the Main class, create a Player object and an Enemy object, set their attributes, and have them attack each other until one of them has no more hit points. Print a message indicating which character won the fight. Q2. Using Python, create an abstract class called BankAccountwith the following attributes and Create two classes called CheckingAccount and SavingsAccountthat inherit from BankAccount. The CheckingAccount class should have a method called withdraw that allows the account holder to Withdraw money, but charges a transaction fee of GHS 0.50 per withdrawal. The SavingsAccount class should have a method called withdraw that allows the account holder to withdraw money, but only if there is sufficient balance in the account. Q3. Create a PHP class called "StudentRegistration" with the following properties: The class should have the following methods: Create a new instance of the "StudentRegistration" class and set its properties to some values Then, use the "setStudentName()", "setRegistrationDate()", "getStudentName()" "getRegistrationDate()", and "daysSinceRegistration()" methods to perform some operations and print out the results..
Programming 1 IA 01. Create a Java class called GameCharacterthat hasthe following attrbutes: The class should have the following methods: getName(): This method should return the name of the character. setName(String name): This method should set the name of the character. getHitPoints(): This method should return the current hit points of the character, setHitPoints(int hitPoints): This method should set the hit points of the character getDamagePoints: This method should return the damage points of the character. setDamagePoints (int damagePoints): This method should set the damage points of the character. attack(GameCharacter character): This method should subtract the character's damage points from the target character's hit points. Create a Player class that extends the Game Character class and has the following attributes: level (an integer) experiencePoints (an integer) The class should have the following methods: Create an Enemy class that extends the Came Character lass and has the following attributes: The class should have the following methods; from the enemy's hit points and print a message indicating how much damage was dealt. In the Main class, create a Player object and an Enemy object, set their attributes, and have them attack each other until one of them has no more hit points. Print a message indicating which character won the fight. Q2. Using Python, create an abstract class called BankAccountwith the following attributes and Create two classes called CheckingAccount and SavingsAccountthat inherit from BankAccount. The CheckingAccount class should have a method called withdraw that allows the account holder to Withdraw money, but charges a transaction fee of GHS 0.50 per withdrawal. The SavingsAccount class should have a method called withdraw that allows the account holder to withdraw money, but only if there is sufficient balance in the account. Q3. Create a PHP class called "StudentRegistration" with the following properties: The class should have the following methods: Create a new instance of the "StudentRegistration" class and set its properties to some values Then, use the "setStudentName()", "setRegistrationDate()", "getStudentName()" "getRegistrationDate()", and "daysSinceRegistration()" methods to perform some operations and print out the results..