Objective: Write a program that creates a class Apple and a tester to make sure the Apple class is crisp and delicious. Task: First create a class called Apple . . The class Apple DOES NOT HAVE a main method Some of the attributes of Apple are . Type: A string that describes the apple. It may only be of the following types: . . . Red Delicious Golden Delicious Gala . Granny Smith Weight: A decimal value representing the apple's weight in kilograms. The weight m be between 0kg and 2kg 0 Price: The price per apple. This must be a non-negative decimal value. Create the following Constructors 0 Default - sets everything to default values and has no parameters Accessors and Mutators for each variable CSCE 145: Algorithmic Design I 0 MAKE SURE THE MUTATORS CHECK FOR VALID VALUES! Finally create a class called Apple Tester Create the following Methods otoString: Returns a string with all of the instance variable values This class DOES HAVE a main method Create at least 3 different types of apples Test if the accessors, mutators, and other methods work as intended.

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
icon
Related questions
Question
100%
Write in Java
Objective:
Write a program that creates a class Apple and a tester to make sure the Apple class is crisp
and delicious.
Task:
First create a class called Apple
The class Apple DOES NOT HAVE a main method
Some of the attributes of Apple are
0
Type: A string that describes the apple. It may only be of the following types:
▪
Red Delicious
.
Golden Delicious
▪ Gala
Granny Smith
Weight: A decimal value representing the apple's weight in kilograms. The weight must
be between 0kg and 2kg
o Price: The price per apple. This must be a non-negative decimal value.
Create the following Constructors
Default sets everything to default values and has no parameters
Accessors and Mutators for each variable
MAKE SURE THE MUTATORS CHECK FOR VALID VALUES!
CSCE 145: Algorithmic Design I
Create the following Methods
toString: Returns a string with all of the instance variable values
Finally create a class called AppleTester
This class DOES HAVE a main method
Create at least 3 different types of apples
Test if the accessors, mutators, and other methods work as intended.
Transcribed Image Text:Objective: Write a program that creates a class Apple and a tester to make sure the Apple class is crisp and delicious. Task: First create a class called Apple The class Apple DOES NOT HAVE a main method Some of the attributes of Apple are 0 Type: A string that describes the apple. It may only be of the following types: ▪ Red Delicious . Golden Delicious ▪ Gala Granny Smith Weight: A decimal value representing the apple's weight in kilograms. The weight must be between 0kg and 2kg o Price: The price per apple. This must be a non-negative decimal value. Create the following Constructors Default sets everything to default values and has no parameters Accessors and Mutators for each variable MAKE SURE THE MUTATORS CHECK FOR VALID VALUES! CSCE 145: Algorithmic Design I Create the following Methods toString: Returns a string with all of the instance variable values Finally create a class called AppleTester This class DOES HAVE a main method Create at least 3 different types of apples Test if the accessors, mutators, and other methods work as intended.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Unreferenced Objects
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
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education