Question: I need help with this program, i need to modify it. Can some one show me step by step how to do it? Please enter:
I need help with this program, i need to modify it. Can some one show me step by step how to do it?

Please enter:
+ to add two numbers.
- to subtract two numbers.
* to multiple two numbers.
/ to divide two numbers. ^ for the exponent x^y where x and y are the two numbers q exit the program 2. Get the operation symbol (change to char from int) and verify that it is a valid operation symbol. Repeat the above step if it is not. Use a while loop until the user enters a valid operation.
3. Using your if-else structure, decide which operation to perform. If the user enters "q" for the operation, exit the program. Ask for the two operands (one only for the factorial) and verify they are valid - you can't divide by zero or take the negative factorial. Use while loop to repeat until the operands are correct.
4. Do the calculation and print out the results
5. Add a while loop surrounding the code your created above, keep repeating until the user enters 'q'. The structure of this code is almost identical to the structure you created for the guessing game though for this one, a do-while loop is a better choice than the regular while loop.
Implement the exponent operation with a for loops
If you used variables operand1 and operand2, compute the value of operand1^operand2. DO NOT USE THE LIBRARY FUNCTION FOR POWER (there is a function called "pow(parameter1, parameter2) in the math library but I want you to create the operation yourself).
You must support negative exponents. For example 2^2 is 4 and 2^(-2) is 0.25
To compute the exponent, use a for-loop. For example, to compute 3^4 by hand you would follow these steps
1. Start with 3^0 which is 1 (actually any number^0 is always 1)
2. Multiply 3*1 to get 3 (step 1)
3. Multiply 3 from the previous step - 3*3 to get 9 (step 2)
4. Multiply 9 from the previous step - 9*3 to get 27 (step 3)
5. Multiply 27 from the previous step - 27*3 to get 81 (step 4)
How many times did you multiply? How does that relate to 3^4? What was the starting value? What did you multiply? by the first operand or the 2nd operand?
For a negative exponent are you multiplying or dividing repeatedly?
# include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
