Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(1) Modify the above program to ask the user to specify a number of tree trunk levels (Enter trunk height: ), then use a loop

(1) Modify the above program to ask the user to specify a number of tree trunk levels (Enter trunk height: ), then use a loop to draw that many levels.

(2) Modify the program again to ask the user to specify a number of tree trunk *s per level ("Enter trunk width: ), then use a loop to draw that many *s per level.

Youll need to use a nested loop in which the inner loop draws the *s, and the outer loop iterates a number of times equal to the number of tree trunk levels.

(3) Modify the program so that it only accepts odd numbers for the trunk width. Use a loop to continue prompting the user for a width until the number is odd.

(4) Modify the program to ask the user to specify a number of tree leaves levels (Enter leaves width: ), then use a nested loop to draw that many levels.

Youll need two inner loops for drawing the leaves: one for outputting spaces and one for outputting *s. The outer loop iterates a number of times equal to the number of tree leaves levels.

The top level of the leaves must have at least one *. in C++ pleaseimage text in transcribed

#include using namespace std; int main() { // Draw leaves cout

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

Semantics Of A Networked World Semantics For Grid Databases First International Ifip Conference Icsnw 2004 Paris France June 2004 Revised Selected Papers Lncs 3226

Authors: Mokrane Bouzeghoub ,Carole Goble ,Vipul Kashyap ,Stefano Spaccapietra

2004 Edition

3540236090, 978-3540236092

More Books

Students also viewed these Databases questions

Question

Explain the sources of recruitment.

Answered: 1 week ago

Question

Differentiate sin(5x+2)

Answered: 1 week ago

Question

Compute the derivative f(x)=1/ax+bx

Answered: 1 week ago

Question

What is job enlargement ?

Answered: 1 week ago

Question

Discuss five types of employee training.

Answered: 1 week ago

Question

Identify the four federally mandated employee benefits.

Answered: 1 week ago