Question
This assignment is about objects, instance variables, methods and encapsulation. You will create two classes to simulate the world of ParrotCraft a simple game world
This assignment is about objects, instance variables, methods and encapsulation. You will create two classes to simulate the world of ParrotCraft a simple game world loosely based on MineCraft Parrot objects. In graphical applications, programmers often separate the model from the view. The model keeps track of the internal state of the program, and the view is in the middle between the user and the model. It talks to the user through a user interface, and it talks to the model by calling its methods and interpreting the return values from those methods. The model never talks directly to the user. This is not a graphical application. In this assignment, the Parrot class is the model and the ParrotCraft class implements a view that consists of a text-based conversation with the user. If you implement the model well, it should be easy to re-use it later in a graphical view.
please use java for coding
Step 1: Design and UML Your first step should be to create a UML class diagram to represent a Parrot. You should create this diagram using UML software like UMLet or draw.io (links on Canvas). Don't use a plain word processor like Microsoft Word. If you want to use a different piece of software, you must check with the instructor first. UML Diagrams that are generated automatically from code are also not allowed. - A Parrot has a name, an integer number of hearts that represent its health, and the amount of cracker crumbs in its stomach, in grams. A Parrot can be tamed or untamed, it can be dead or alive, and it can be flying or sitting. - You can feed a Parrot some cracker crumbs. Its health goes up by 1 (maximum 3) every time you feed it. The amount of cracker crumbs in its stomach rises also. - When you feed a Parrot, there is a chance that the parrot will become tamed. The percentage chance of taming is 20 crumbs, where crumbs is the amount of cracker crumbs in kilograms you just fed it. - A Parrot can also eat too much and make itself sick. When a Parrot has more than 2.5kg of cracker crumbs in it's stomach its health (hearts) will go do down by 2 . If the health (hearts) becomes 0 , the Parrot becomes dead. - You can command a tamed Parrot to stay or fly. An untamed Parrot is always flying. - You can give a tamed Parrot a different tamed Parrot to play with. But the Parrots will rediscover the joy of their own species, making both of them untamed. - You can hit a Parrot and make its health go down by 1 (minimum 0). Hitting a Parrot always makes it untamed and sometimes makes it dead (if it has 0 health). 1 - Dead Parrots can't be fed, can't be told to stay or move, and can't play with other Parrots. 2 - When a Parrot is "born" (i.e., an instance created) it alive and untamed and flying with 3 health. By default, its name is "Julius" and it has 0.1kg of cracker crumbs in its stomach, but you can change its name and the amount of cracker crumbs in its stomach after you create the Parrot. (By using setters) - There should be a tostring method that returns a full report on a Parrot. 3 It is completely up to you what the return value of toString looks like, but don't just use the default from IntelliJStep 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