For this assignment, you are required to develop a non-scientific calculator using C. Your calculator should only solve
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
For this assignment, you are required to develop a non-scientific calculator using C. Your calculator should only solve
For this assignment, you are required to develop a non-scientific calculator using C. Your calculator should only solve summation, subtraction, division, product, square root and square expressions. Utilizing the math.h header for your program, your calculator should start by prompting the user to enter a two-or-more-operand mathematical equation just like how you would using a non-scientific calculator. Your program should then display the correct answer and the user will have the choice to either continue using the calculator with the current answer to perform further calculations or end the program. Your program should also have a help function to display all the functions of the calculator. A sample output of the program when the user enters "help" is shown below: Type "HELP" or enter a mathematical expression Calc:\> help Exits this program. EXIT HELP MEMORY Displays information about this program. As part of a mathematical expression the term MEMORY is substituted by the value stored in memory. Otherwise, the value stored in memory is displayed on-screen. Erases stored memory and returns calculator to its initial 'start-up' node. RESET STORE Saves current answer to memory. OPERATOR DESCRIPTION SYNTAX [a+bi+a] addition subtraction [a bi-al bia] [a bi/a] multiplication [a division sqr(x) sqrt(x) a#l Example: a^ +b#/ MEMORY 3+2 Answer: 5 Calc:\> +6 Answer: 11 Calc: store ANSWER STORED in MEMORY Calc:\> 4/memory Answer: 0.363636 Calc:\> Type "HELP" or enter a mathematical expression Calc:\> 3.5+6^ Answer: 39.500000 Calc:\> 6# Answer: 2.449490 Calc:\> Type "HELP" or enter a mathematical expression Calc: +64 Answer: 64 Calc:\> store ANSWER STORED in MEMORY Calc: 1/2 *3-9+.000001 Answer: -7.499999 Calc:\> menory# Answer:\> 8 Calc:\>