Question: Lab 4 - Assignment 2 Assignment Deadline: 0 8 March 2 0 2 4 , 1 1 : 5 9 PM Submission: 1 ) a

Lab 4- Assignment 2
Assignment Deadline: 08 March 2024,11:59PM
Submission:1) a cpp file with student ID and name, 2) a screenshot of result and code
Problem: Print a tree
Problem description
Alice wants to draw a Christmas tree. Could you help her to draw and print it use a computer
with different height of branch? The requirements are as follows.
The tree consists of branch and trunk (see the figure below). The height of trunk is half of
that of branch.
The tree is formed by sequential capital letters (from A to Z, after Z start from A again), or
reverse order (from Z to A, after A start from Z again) depending on user's choice.
The order of letters in branch is from left to right line by line; while the order in trunk is
from up to down as shown in the figure.
Input & output requirements
Input a choice to indicate (1) sequential order (i.e., A->Z), or (2) reverse order (i.e.,
Z->A).
Input one even integer number to specify the height of branch. The output should
follow the format as shown in sample results.
No input validation is needed for this lab and assignment.
Two sample results are attached next page.
 Lab 4- Assignment 2 Assignment Deadline: 08 March 2024,11:59PM Submission:1) a

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!