Question: Your friend is taking a math course and is having a hard time taking derivatives and integrals. You plan to help him out using a
Your friend is taking a math course and is having a hard time taking derivatives and integrals. You plan to help him out using a C program. Write a program called calculus.c, which should have the following functionality: - Ask the user for three integers, a, b, and c. These integers represent the coefficients of our quadratic equation: ax2 + bx + c. - Print the equation entered by the user. - Ask the user if they want to take the derivative or the integral. Based on the choice: o Print out the derivative for the equation. Hint: The derivative for the given equation is 2ax + b. Your program should perform any necessary calculation based on the input. So if the user had entered a as 2 and b as 3, it should print out, 4x + 3. See sample run below. o Print out the integral of the equation. Hint: For the quadratic equation, ax2 + bx + c, the integral is + + - Next ask the user for x. x could be any number not just an integer. So choose the appropriate variable type. - Print out the value of the derivative or the integral at the point chosen by the user. - Ask user, if they want to repeat. If they answer with y, the whole process should repeat. If they choose n, your program should finish.
Sample run: Enter a, b, and c: 2 1 3 Equation entered: 2x^2 + x + 3 What would you like to do? 1. Derivative 2. Integral Select option: 1
The derivative is 4x + 1 Enter x: 3 The derivative at x = 3 is 13.0 Do you want to repeat: y Enter a, b, and c: 3 2 3 Equation entered: 3x^2 + 2x + 3 What would you like to do? 1. Derivative 2. Integral Select option: 2 The integral is x^3 + 1 x ^2 + 4x Enter x: 1 The derivative at x = 1 is 6.0 Do you want to repeat: n Good bye!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
