Quadratic expression is of the form

Assignment Help Basic Computer Science
Reference no: EM131092784

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

Reference no: EM131092784

Questions Cloud

Calculate the density of the mixture : Atmospheric air at a pressure of 760 mm Hg has a temperature of 32oC and a percentage saturation asdetermined from a psychrometric chart of 52%.
Find and write out the regression line : Find and write out the regression line - What is the Coefficient of Determination? What is the Coefficient of Determination adjusted for degrees of freedom?
Flavor deterioration of a food product : Flavor deterioration. The results shown below were obtained in a small-scale experiment to study the relation between 0 F of storage temperature (X) and number of weeks before flavor deterioration of a food product begins to occur (Y).
Example of multi domestic strategy : Which of the following is an example of a multi domestic strategy?
Quadratic expression is of the form : 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 funct..
Technical paper-object-oriented programming : Technical Paper: Object-oriented Programming (OOP) / Event-Driven Programming (EDP) versus Procedural Programming (PP)
Filter the appropriate traffic : Case Project 4-2: Creating ACLs You have been assigned to create access control lists to filter specific traffic on a Cisco router. Provide the commands needed to filter the appropriate traffic in each of the following ACLs.
Determine the rate of heat transfer : Steam enters a long, horizontal pipe with an inlet diameter of D1 = 12 cm at 1 MPa and 300°C with a velocity of 2 m/s. Farther downstream, the conditions are 800 kPa and 250°C, and the diameter is D2 = 10 cm
Tourist in singapore : Emphasizing both the theoretical and applied aspects planning and development, you will explore conceptual and practice issues facing the public and private sectors when dealing with the Development of tourism.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Give the average number of byte-order conversions needed

Give the average number of byte-order conversions needed for both big-endian network byte order and receiver-makes-right, for p = 0.1, p = 0.5, and p = 0.9.

  Find an efficient algorithm to determine

Find an efficient algorithm to determine

  Write the document''s topic as the document''s header

Write the document's topic as the document's header. On the document's first page, insert a list of the document's paragraph names. The paragraph names briefly describe the paragraphs' contents. Add a hard page break to the first page to make sure th..

  Discuss at last three advantages of a hard-wired lan

Discuss at last three advantages of a hard-wired LAN compared to a wireless LAN (WLAN) and visa-versa

  Data structures are supported by the library

What data structures are supported by the library? What types of data are recommended for use with each data structures object? Which classes contain which data structures, and what methods does the library provide?

  Explaining ethical issues related to it

Ethics is "a set of principles of right conduct". Main ethical issues related to IT are accuracy, privacy,  property (including intellectual property), and accessibility to information.

  Consider a relation that is fragmented horizontally

Assume each fragment has two replicas: one stored at the Los Angeles site and one stored locally at the plant site. Describe a good processing strategy (in outline, not SQL) for the following queries entered at the Baltimore site and say why you thin..

  What does it mean for a problem to be well posted

What does it mean for a problem to be (i) well-posed?, (ii) ill-conditioned? Explain.

  Research online sources best video gaming monitor

Research online sources (e.g., Amazon, eBay, ect.), for video display monitor and card combinations to satisfy a rich gaming experience in your home. Select the combination that your believe is of greatest value when considering the cost of each ..

  Class templates are typically used to replace overloaded

1.How would you overload the comparison operators == and !=? What is the format to overload these operators? 2. Class templates are typically used to replace overloaded functions. Can you compare the two?

  Does it improve the predictions

Does it improve the predictions?

  Smallest exponent that can be stored using this 16 bit stand

storing number in a string of 16 bits, the first bit is used for the sign of the number, and the next 5 bits store the exponent plus the bias, and the remaining 10 bits store the mantissa.  The bias is 15. What is the smallest exponent that can be st..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd