Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Conceptual Database Design An Entity Relationship Approach

Authors: Carol Batini, Stefano Ceri, Shamkant B. Navathe

1st Edition

0805302441, 978-0805302448

More Books

Students also viewed these Databases questions

Question

Evaluate the exponents:AppendixLO1 a. 2 23 b. 5

Answered: 1 week ago

Question

1. Which is the most abundant gas presented in the atmosphere?

Answered: 1 week ago

Question

Describe Table Structures in RDMSs.

Answered: 1 week ago