Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This question is supposed to be a C++ program. 1.[10 pts) Write a program that takes four command line arguments: a, b, c and x
This question is supposed to be a C++ program.
1.[10 pts) Write a program that takes four command line arguments: a, b, c and x that are values of parameters in the quadratic expression: a*r?+b+x+c. Assume all the parameters are integers. Your program take the values of the parameters as command line arguments. For the given values of a, b, c and x it should compute what the quadratic expression evaluates to and display the result to standard output. Print an appropriate error message to standard error if the user does not provide the correct number of arguments to the program. Below are a few example runs of the program assuming it was compiled to the executable. / quadratic $./quadratic Usage: ./ quadratic a b cx $. / quadratic 4 2 10 3 4*pow (3, 2) + 2*3 + 10 evaluates to 52 $ ./ quadratic 3 4 5 1 3*pow(1, 2) + 4*1 + 5 evaluates to 12 Note that for full credit your output should be exactly as shown above. It is not sufficient to just print the value of quadratic expression. Your implementation must contain a main function. You may use the math function pow (x, y) to compute the value of x to the power of y. Include the header file cmathStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started