# Can anyone help me on this problem..(i'm a beginner so i don't know much about java )

• 03-13-2012, 09:48 AM
einjhelclint12
Can anyone help me on this problem..(i'm a beginner so i don't know much about java )
My instructor wants me to create a program ..here is the problem:

Design a Fruit class and its sub classes,Apple,orange,Banana,Strawberry.
Every fruit has a color.Apple and strawberry are red(no green apple),banana is yellow and the color of an orange is orange.
You may want to "peel " a fruit.when apple,orange or banana is peeled,.print out a message(like "Peeling a banana").When apple is peeled,its color becomes white.Peeling other fruits have no effect.

*It first reads from the user how many fruit will be entered.then the fruit are entered using their first letter(Ex: a,b,s,o)
*print out the color of the fruits(in the same order as they are entered)
*Print out the number of red colored fruit
*peel the fruits(in the same order they are entered)
*print out the number of red fruit again

Sample Run:
8
b
a
o
s
b
a
x
s
yellow
red
orange
red
yellow
red
unknown
red
There are 4 red colored fruit
peeling a banana
peeling an apple
peeling an orange
peeling a banana
peeling an apple
there are 2 red colored fruits

...hope u can help me...i'm not that good yet in java..
• 03-13-2012, 10:11 AM
ojn
Re: Can anyone help me on this problem..(i'm a beginner so i don't know much about ja
Help you with what? What have you tried and where are you stuck?

Asking a specific question = good
Dumping your homework hoping someone will do it for you = bad
• 03-13-2012, 01:02 PM
Fubarable
Re: Can anyone help me on this problem..(i'm a beginner so i don't know much about ja
Agree: this isn't a question but rather a homework dump and so will be locked. Original poster, if you truly need our help in the future, please show your work and ask a specific question. Don't just simply dump your assignment in here and walk away.