Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SPRING 2017. CS 231. Programming ll. Test# 2 Dr. Badi, A. 90 minutes March 30, 2017 Name 100 This is an open book and open

image text in transcribed
image text in transcribed
SPRING 2017. CS 231. Programming ll. Test# 2 Dr. Badi, A. 90 minutes March 30, 2017 Name 100 This is an open book and open notes programming test. Answer all questions. Forpartial credit, show your work, The figure below shows the Animal & Plant classes and the Edible interface hierarchies. These classes are the parents of the classes described below: Plant Edible (interface) String getName O (abstract) string getName String getGroup (abstract) int get HeartRate 0 String get Taste E boolean is Seeded Okra string get Habitat The Animal class is Don-abstract and defines two functions getNameo getHeart Rareo.as shown in the figure above. The Plant class defines two abstract functions getNaneo s getGroup o.This class also defines one non: abstract function isseeded as shown in the figure. The Animal class has two non-abstract child classes:Ant, and shrimp. The Ant class defines asingle function: getHabitato, as in the figure. The Plant class has one non-abstract child class, okra. -Interface Edible defines a single function: getTasteo, as in the figure. The classes shrimp & okra implementthe Edible interface, as shown in the figure. From the description, above, complete the following: In your development environment, create a new directory, called 2. Using function and class names exactly as given Test to design and represent this hierarchy. description and figures above, create lava classes for this test, there Place these files inside the Test 2 directory. Besides the files created should be no other files of any type in the Test 2 directory. 2. For each class, define two constructors: a default, no-argument constructor, and a construct that assign values to all the member variables, including the variables defined in the class's parent if any

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

Step: 3

blur-text-image

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

Database Technology And Management Computers And Information Processing Systems For Business

Authors: Robert C. Goldstein

1st Edition

0471887374, 978-0471887379

More Books

Students also viewed these Databases questions

Question

13. You always should try to make a good first impression.

Answered: 1 week ago