Suppose that you have the following declaration: stackType stack(50); double num; and the input is XXXXXXXXXX XXXXXXXXXX Write a C++ code that processes this input as follows: If the number is...


Suppose that you have the following declaration:


stackType stack(50);

double num;


and the input is 25 64 -3 6.25 36 -4.5 86 14 -12 9


Write a C++ code that processes this input as follows: If the number is nonnegative, it pushes the square root of the number onto the stack; otherwise it pushes the square of the number onto the stack. After processing these numbers write a C++ code that outputs the elements of the stack. (3)




May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here