Question: This is java In this program, you are going to read a file called flowers.txt. Each flower is described by the number of petals and

This is java

In this program, you are going to read a file called flowers.txt. Each flower is described by the number of petals and its name. You may notice that each petal number associates with a number in the Fibonnaci sequence. Cool right?

1. You are to read in the file

2. Separate the lines into tokens and store the Flower objects into a Flower Stack using the built-in Stack ADT implementation in Java.

3. As you off each Flower Object, use the number of petals to recursively run through a Fibonacci algorithm to determine its (Ordinal) position in the sequence.

4. Assume the sequence starts here: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34 5. So, for example, if the number of Petal is 2, then the Ordinal value is 4 Your final output should show each number, the flowers associated to that number and the position in the sequence.

This is a console application.

Flowers.txt

5 petals: buttercup, wild rose, larkspur, columbine (aquilegia), pinks 89 petals: michaelmas daisies, the asteraceae family 3 petals: lily, iris 21 petals: aster, black-eyed susan, chicory 8 petals: delphiniums 34 petals: plantain, pyrethrum 13 petals: ragwort, corn marigold, cineraria, some daisies 55 petals: michaelmas daisies, the asteraceae family

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!