Question: In this Lab assignment, you need to define the following THREE functions: Define a function bool create _ PowerOfTwoMinusOne ( int num, int& goal )
In this Lab assignment, you need to define the following THREE functions:
Define a function bool createPowerOfTwoMinusOne int num,
int& goal that decides if num is a "Power of Two Minus One number" as
you have solved in Lab If it is return true; otherwise return false. At the same
time, your function needs to set up goal to the closest "Power of Two Minus
One number" which is less than or equal to num. For example, if num is after
calling createPowerOfTwoMinusOne num goal it should return true
and goal will be set to ; if num is after calling
createPowerOfTwoMinusOne num goal it should return false and
goal will be set to ; if num is after calling
createPowerOfTwoMinusOne num goal it should return false and
goal will be set to
Define a function void drawTri int n that prints a triangle which
contains one little star asterisk symbol at the first line, three starts at the second
line, and so on till little stars at the line, and it is symmetric. For
example, the triangle with is shown in the following:Define a function void drawTriRint n that prints a triangle obtained
after rotating the original triangle from calling drawTri degrees
clockwise. For example, the triangle with is shown in the following:
drawTriR is equal to:
after degree rotation clockwise from the original pattern by calling drawTri
Write a program that repeatedly asks the user to enter a Positive integer as the input,
until the user enters to quit the program. Each time after the user inputs a valid
positive integer, it then prints:
Decide whether the userinput Positive number, say input, is a "Power of Two
Minus One" by calling the function
createPowerOfTwoMinusOne input goal;
It prints the triangle pattern in which the last row of stars matches the value of
goal from step then prints the triangle pattern after rotating degrees
clockwise.
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
