Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Lab 5 - Bug Exhibit Purpose: A natural habitat museum is looking to develop software to track animals presented in various exhibits. One of the
Lab Bug Exhibit
Purpose:
A natural habitat museum is looking to develop software to track animals presented in various exhibits.
One of the first exhibits the museum wants to transfer to this new system will be an everglade that
includes various bugs, bird, and other animals. You will prepare some of the initial code related to this
exhibit.
One of the first parts of this exhibit will be the bugs found in the everglades. To get started, you will
prepare a class that provides the common functionality for all of the various kinds of bugs. One of these
kinds of bugs is provided for reference, and you will prepare another class for another kind of bug.
Task:
Design the prototype of this system mentioned above using Python. The Bug class will be the superclass
that contains the common functionalities for all of the other classes. The Spider class is provided for
reference when developing the subclasses. You will also prepare the Grasshopper class as another
subclass of Bug.
For the Bug class, you will need an instance method to specify the name, number of legs, and number of
wings. You should also include methods to access or modify these three properties.
The last method for the Bug class will be This is used to return a string that describes the state of
an object. In this case, return a string that indicates the name, number of legs, and number of wings of a
bug.
After completing the Bug class, refer to the Spider class for an example of how a subclass of Bug will be
implemented. Based on that example, implement the Grasshopper class. A grasshopper has legs and
wings. Similar to the Spider class, you will also need to include some fact about grasshoppers found in
the everglades.
Once you have implemented all three of those classes, you will need a Tester class. In this class, you will
construct three objects: one from each of the other three classes. For the Bug object, use "Millipede",
and as the arguments. For the Spider and Grasshopper objects, you will not need to provide any
arguments the call to the superclass constructor will handle that for you
You then need to print out the information about each object. Since these classes are implementing the
method, you will only need to pass in the variables that hold these objects to the print method.
The following is part of the output for the objects constructed using the Bug and Spider constructors:
This is a Millipede. It has legs and wings.
This is a Spider. It has legs and wings.
The golden orb weaver has a mild venom that is not poisonous to humans.
Submission:
Submit your Python scripts ie the py file in Blackboard.
Criteria:
Comments describing the program:
Properly defining the constructor for Bug:
Properly defining the getters and setters for the properties:
Properly defining strin Bug:
Properly setting Grasshopper as a subclass of Bug:
Properly defining the constructor for Grasshopper:
Properly defining in Grasshopper:
Properly constructing the three objects:
Properly printing the state of the three objects:
points
points
points
points
points
points
points
points
points
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