Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

To exemplify pointers, we will be doing quadratics. Remember that a quadratic expression is of the form: ax2 + bx + c where a, b, c are constant and a is not 0. You will scan in the values a, b, and c. With these values, you will write three functions:

quadraticFormula
quadraticVertex
quadraticInfo

The first function will preform the quadratic equation to find the roots of the expression. The return value of the function will be an int that signifies how many REAL roots there are. You do not need to worry about imaginary numbers. 

The second function is used to find the vertex of the expression. There is no return value for this function. Remember, there is an x and a y component to vertex.

The third function function is to find the directrix and the direction the graph of the function is facing. There is no return value for this function. The direction of the graph will be represented by a char that will either be 'U' for up or 'D' for down. 

All of your printing and scanning should be done in main. You are scanning in integers, but you should be holding values in floats because precision is important. When printing the roots, there are three cases. You will have two roots and will print two roots. You will have one root and will print that one. Or you will have no real roots (probably resulting in some weird data in your variables) and will just print "No real roots". You will be using pointers to pass around to functions to hold values that are calculated. Print all floats to 2 decimal places. Scan all of your coefficients on one line separated by spaces.

Sample Output:

Enter coefficents a, b, and c: 3 18 -48
f(x) = 3x^2 + 18x + -48
Roots: 2.00 and -8.00
Vertex: (-3.00, -75.00)
Directrix: y = -75.08
The graph is facing up

Enter coefficents a, b, and c: 2 24 72
f(x) = 2x^2 + 24x + 72
Root: -6.00
Vertex: (-6.00, 0.00)
Directrix: y = -0.12
The graph is facing up

Enter coefficents a, b, and c: 1 4 5
f(x) = 1x^2 + 4x + 5
No real roots
Vertex: (-2.00, 1.00)
Directrix: y = 0.75
The graph is facing up

Enter coefficents a, b, and c: -1 4 5
f(x) = -1x^2 + 4x + 5
Roots: -1.00 and 5.00
Vertex: (2.00, 9.00)
Directrix: y = 9.25
The graph is facing down

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91835475
  • Price:- $25

Priced at Now at $25, Verified Solution

Have any Question?


Related Questions in Computer Engineering

A shipment of 15 televisions sets contains 3 defective sets

A shipment of 15 televisions sets contains 3 defective sets. A hotel purchases 9 of these televisions sets. What is the probability that the hotel receives at least one of the defective sets?

Question 1you want a list of products whose product lines

Question 1 You want a list of products whose product lines contain the term  Classic  or  Vintage.  please pick up best option from the following. a. SELECT productline FROM products WHERE MATCH(productline) AGAINST('Cla ...

1 a consumer has 300 to spend on goods x and y the market

1. A consumer has $300 to spend on goods X and Y. The market prices of these two goods are Px $15 and Py $5. a. What is the market rate of substitution between goods X and Y? b. Show how the consumer's opportunity set ch ...

Technology certainly does play a large role in our lives

Technology certainly does play a large role in our lives and this has happened in a very short period of time. It has impacted the way we activities professionally, personally, and academically. For example, online educa ...

Please discuss the design principles that guide the authors

Please discuss the design principles that guide the authors of instruction sets in making the right balance. Provide examples of application of each of the three design principles while designing instruction sets.

Lnguage isnbspcgenerate a sparse vector class with

Language is  C++ Generate a sparse vector class with * operator, such as  Vector Vector::operator * (Vector& param) A multiplication (*) operators returns element-wise multiplication of two vectors in another vector. Giv ...

What are content management systems cms describe the

What are Content Management Systems (CMS). Describe the challenges in implementing and maintaining CMS. Can internet search engines be considered as Content Management Systems - explain your answer.

Question suppose that nickels and pennies disappear from

Question : Suppose that nickels and pennies disappear from the currency system and we have only dimes and quarters. Obviously any product that costs 15 cents can not be exactly paid for using only dimes and quarters. Sho ...

Costs are rising for all kinds of medical care the mean

Costs are rising for all kinds of medical care. The mean monthly rent at assisted living facilities was reported to have increased 27% over the last five years to $3886 (the wall street journal, October 27, 2012. aussume ...

Access your browsers security settings and configure the

Access your browser's security settings and configure the browser to refuse all cookies or to prompt you before allowing a cookie. Restart the browser; then visit several different Web sites. Be sure to visit popular sit ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As