Completed

Java script micro project - 19/05/2020 10:56 EDT

Design an abstract class named Fruit that has the following fields:

 nameOfFruit for storing a fruit’s name

 fruitsCountry fruit’s origin country.

In addition, the class should have the following constructor and other methods:

 Constructor with arguments to initialize both data fields.

 A toString method to return a String containing the fruit’s data.

 An abstract method named color() for fruit’s color and hold a void type.

 An abstract method getInterExport() that hold an int type.

Then, design a class named Apple which extends the Fruit class. It declares three final integer fields with their values as: FUJI = 2000, GALA = 4500 and CAMEO = 3000.

These fields hold the total apples according to it types. The class also declares three integer fields to indicate the apples that have been allocated for local distribution. Declares the three fields as, localFuji, localGala and localCameo.

Next, provide the Apple constructor by calling the constructor of the superclass (Fruit) through the super keyword. After that, provide the mutator (set) methods to store values in localFuji, localGala and localCameo fields. Finally, Apple class will override:

o Abstract color() method defined in Fruit class. In this method, print the color of apple fruits as red sport, ultra red and red in one line.

o Abstract getInterExport() method defined in Fruit class. In this method, declare two integer variables called totalApple and totalExport. totalApple hold the total amount of apples and totalExport hold total apples to be exported after deduction with apples for local distribution. To calculate the totalApple, add all final integer fields. To calculate the totalExport, deduct totalApple with localFuji, localGala and localCameo. Return the totalExport.

o A toString method defined in Fruit class and also displays Fuji, Gala and Cameo apple for local distribution.

Provide ExportAppleDemo class to demonstrate the Fruit and Apple classes. Example of the program output is given:

Output:

Name of fruit: Apple New Varieties

Origin Country: New Zealand

Fuji apple for local distribution = 1200

Gala apple for local distribution = 900

Cameo apple for local distribution = 1500

Apples color: red sport, ultra red and red

Apples for international distribution: 5900

Skills: Java, JavaScript, Software Architecture, JavaFX, J2EE

See more: mini project using java script, free java script menu project, create html project java script, mini project java script, bca project java script using html source code, use java script scroll content code project, asp net web project loginvalidation java script, find elapsed project time java script, free java script code project asp net, free mathematical calculator project java script, hospital management project java script, java script college project, java script pop mouseover vb aspcode project, online airlines reservation system project java script database sql then create, project html java script validation, project java script php, project java script programing hospital, project jsp java script, project report java script quiz, school management project java script

About the Employer:
( 0 reviews ) Kajang, Malaysia

Project ID: #25587934

Awarded to:

Wawa27

Hello, I've been using Java for more 5+ years, I can make your project in no time, I've already done a lot similar projects before, Feel free to ask me anything, Thank you, Oualid H.

$15 USD in 1 day
(5 Reviews)
2.3

5 freelancers are bidding on average $27 for this job

thasleemkamila

I have well experienced in doing such kind of jobs................................................................

$50 USD in 2 days
(4 Reviews)
3.8
fredericomba

Hello. I'm knowledgeable about Java, and I'm confident that I can deliver this project to you in a brief amount of time. Let's chat so that we may reach an agreement.

$15 USD in 1 day
(8 Reviews)
2.5
farzanaiqbal

i will do my level best................................................................................................................................................................................................... More

$30 USD in 7 days
(0 Reviews)
0.6
Parekh1

Hi, I am a developer and designer with 5+ years of experience in C#, Excel, VBA, HTML, Css and javascript I am new to this freelancer platform but I can guarantee my work. Let's connect on chat for detail discussion More

$25 USD in 7 days
(0 Reviews)
0.0