Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Project: Kotlin Classes Create a program which implements the following Kotlin Classes to store object information. (DO NOT USE DATA CLASSES) Write some Kotlin statements
Project: Kotlin Classes
Create a program which implements the following Kotlin Classes to store object information. (DO NOT USE DATA CLASSES)
Write some Kotlin statements that exercise the class by creating an object, set attributes, get attributes, print attributes, and execute each of the class methods.
Submit ONE file (.kt) for this assignment. Put all the classes and code in this single file. There should be NO user input. All code will be "hard-coded" with your own examples for testing the code.
Person Class: Attributes: firstName, lastName, age, hairColor, eyeColor Methods: getter and setter for each attribute (May be implied) .toString() - print out a nice representation of the attributes of this person class Address Class: Attributes: line1, line2, city, state, zip Methods: getter and setter for each attribute (May be implied) .toString() - print out a nice representation of the attributes of this address class. Character Class: Attributes: name, race, hitPoints, gold, weapons (MutableList of weapon names), clothing (MutableList of clothing item's names) Methods: getter and setter for each attribute except for weapons and clothing (Use the 4 methods below for setting/getting those attributes) toString() - print out a nice representation of the attributes of this Character class .addWeapon( weapon_name ) .dropWeapon( weapon_name ) .addClothing( item ) .dropClothing( item )
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started