Instructions Today you will be given a Frult class. From this, you will subclass Frult to make an Lemon and Pear class. The Frult class has the following fields: - peel (boolean) : tells us if we can eat the skin (false) or must peel the fruit (true) - colour (String) : Colour of the outside of the fruit It has a constructor and five methods, including a toString() method, 2 getters and 2 setters. Frult boolean peel String colour boolean : getPeelO void : setPeel(boolean) String : getColour(] void : setColour(String) String : toString() Details Input The main method will be given the following input: - a String (fruitType): either "PEAR" or "LEMON" - this will determine which subclass of fruit is created. - a boolean (peelSkin): used to determine if one must peel the fruit before eating or not. - a String (skinColour): used to modify the skin colour set for the fruit. Processing - Create a Pear subclass - Set up the subclass so that new Pear objects are set up to have peel set to false (pear skin is edible!) and co - Create an Lemon subclass
Instructions Today you will be given a Frult class. From this, you will subclass Frult to make an Lemon and Pear class. The Frult class has the following fields: - peel (boolean) : tells us if we can eat the skin (false) or must peel the fruit (true) - colour (String) : Colour of the outside of the fruit It has a constructor and five methods, including a toString() method, 2 getters and 2 setters. Frult boolean peel String colour boolean : getPeelO void : setPeel(boolean) String : getColour(] void : setColour(String) String : toString() Details Input The main method will be given the following input: - a String (fruitType): either "PEAR" or "LEMON" - this will determine which subclass of fruit is created. - a boolean (peelSkin): used to determine if one must peel the fruit before eating or not. - a String (skinColour): used to modify the skin colour set for the fruit. Processing - Create a Pear subclass - Set up the subclass so that new Pear objects are set up to have peel set to false (pear skin is edible!) and co - Create an Lemon subclass
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Java.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education