Question: The Utopian Tree grows exactly 1 cm for the first three years, and after that it grows by 2 cm every year, this is a

The Utopian Tree grows exactly 1 cm for the first three years, and after that it grows by 2 cm every year, this is a simple implementation of the algorithm. You will need to use loops to create it.

Show 10 years of growth of the Utopian Tree.

Hint: you might want to create 3 variables and use if else inside of this while loop :)

Output:

year 1 - growth 1 cm

tree size: 1cm

year 2 - growth 1 cm

tree size: 2cm

year 3 - growth 1 cm

tree size:3cm

year 4 - growth 2 cm

tree size: 5cm

year 5 - growth 2 cm

tree size: 7cm

year 6 - growth 2 cm

tree size: 9cm

... until you reach year 10

---------------------------------------------

class Main { public static void main(String[] args) {

// your code

} }

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!