Answered step by step
Verified Expert Solution
Link Copied!

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 5- 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 6 legs and 4
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",
1000, and 0 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 1000 legs and wings.
This is a Spider. It has 8 legs and wings.
The golden orb weaver has a mild venom that is not poisonous to humans.
Submission:
Submit your Python scripts (i.e., 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 _ str__in 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:
5 points
10 points
12 points
10 points
3 points
15 points
18 points
15 points
12 points
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Logistics Lifeline Supply Chain Strategies

Authors: Ehsan Sheroy

1st Edition

7419377502, 978-7419377503

More Books

Students also viewed these Databases questions

Question

=+60-3 Describe the four components of emotional intelligence.

Answered: 1 week ago

Question

Understand the different approaches to job design. page 167

Answered: 1 week ago