Question: Lab 4 - Assignment 2 Assignment Deadline: 0 8 March 2 0 2 4 , 1 1 : 5 9 PM Submission: 1 ) a
Lab Assignment
Assignment Deadline: March :PM
Submission: a cpp file with student ID and name, 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 to after start from A again or
reverse order from to after A start from 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 sequential order ie AZ or reverse order ie
ZA
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.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
