A one-variable quadratic expression

Assignment Help Basic Computer Science
Reference no: EM13167943

A one-variable quadratic expression is an arithmetic expression of the form ax^2+bx+c, where a,b, and cc are some fixed numbers (called the coefficients) and x is a variable that can take on different vaues. Specfy, design, and implement a class that can store information about a quadratic expression; The default constructor should set all three coefficients to zero, and another member function should allow you to change these coefficients. There should be constant member functions to retreve the current values of the coefficients. There should also be a member function to allow you to "evaluate" the quadratice expression at  particular value of x(i.e. the function has one paramter x, and returns the value of the expression ax^2+bx+c).

Also overloa the following operators ( as non member functions) to perform these indicated operations:

quadratic operator+ (

const quadratic& q1,

const quadratic& q2

);

// Postcondition : The return value is the quadratic expression obtained by adding q1 and 12. For example, ther c coefficient of the //return vvalue is the sum of q1's c coefficient and q2's c coefficient.

quadratic operator *(

double r,

const quadratic& q

);

//Post condition: The return a value is the quadratic expression obtained by multiplying each of q's coefficients by the number r.

Notice that the left argument of the overloaded operator * is a double number (rather than a quadratic expression). This allows expression such as 3.14* q, where q us a quadratic expression.

Reference no: EM13167943

Questions Cloud

Explain and identify the type of interactions : Identify the type of interactions involved in each of the following processes taking place during the dissolution of sodium chloride in water. -Interactions between water molecules
Historical crimes have changed the culture : Determine if these historical crimes have changed the culture or ethics associated with computers and information management. Explain the effectiveness of existing computer crime detection methods and technologie
Write a class and client class that stores hotels ratings : Write a class and client class that stores hotels ratings over the years. The number of stars represents hotel ratings. Use a two dimensional integer array to represent the years and hotels
Explain the enthalpy of vaporization of water : how much heat is released when 75.0 g of steam at 100.0°C is cooled to ice at -15.0°C? The enthalpy of vaporization of water is 40.67 kJ/mol
A one-variable quadratic expression : A one-variable quadratic expression is an arithmetic expression of the form ax^2+bx+c, where a,b, and cc are some fixed numbers (called the coefficients) and x is a variable that can take on different vaues
Explain natural water was determined by precipitation : The iron (55.847 g/mol) in a 700.0 mL sample of a natural water was determined by precipitation of the cation as hydrated Fe2O3. The precipitate was filtered
Explain how many moles of oxygen are needed to react : How many moles of oxygen are needed to react with 5.0 moles of ammonia? In the above reaction, how many moles of water can be produced from 256 grams of oxygen?
Write a java program that finds the temperature : Write a JAVA program that finds the temperature that is the same in both Celsius and Fahrenheit
Explain the use of an ftir transducer has never become : The use of an FTIR Transducer has never become commonly used as a detector for HPLC because?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Express problem as ilp constraints

Each will receive exactly 7. Additionally, each individual must receive the same quantity of wine. Express the problem as ILP constraints, and find a solution.

  Create worksheet using excel having different columns

Create a worksheet using excel having different columns depicting the Serial Number, Name of the Student, Marks obtained in various subjects i.e. English, Maths, and Science.

  Thread problem

Implement what is kind of the inverse of our Producer - Consumer, where many Producers supply a limited capacity consumer.

  Describe and discuss

Describe and discuss how the redesigned network needs to operate, the possible network design solutions and why the new design is more suitable for the introduction of mobile devices.

  Fork function

Create a C program that takes an integer argument from the command line and outputs sum of all digits of the integer. For example, the result of the invocation sum of digits 12345 should be fifteen.

  Describe retail events in terms of pci compliance standard

You visit retail establishment, shop around, and ultimately carry several products to one of the point of sale. Document each main events just explained and describe them in terms of PCI compliance standard.

  Dss inc. is an electronics company with production facility

DSS Inc. is an electronics company with production facilities located in Atlanta, Boston, and Chicago. Components produced at these facilities may be shipped to the firm's regional warehouses that are located in Edison and Fargo.

  Interactive java program that asks a user for some interest

Create an interactive Java program that asks a user for some text of interest and then displays the first email address found in that text. (This is the basis for one of the programs that spammers use to mine text, such as email messages, Web pages, ..

  Analyze hardware virtualization

Determine if you would prefer a virtualized environment to a non-virtualized environment for a midsized business or organization and explain why or why not. Compare the cloud computing cost models used by Amazon EC2 and Microsoft Azure.

  Lid technology approach to stormwater management

LID technology is the alternative comprehensive approach to stormwater management. It can be utilized to address wide range of Wet Weather Flow (WWF) issues.

  Create the data model segment for business rules

The FlyRight Aircraft Maintenance (FRAM) division of FlyRight Company (FRC) does all maintenance for FRC's aircraft. Create the data model segment which reflects the following business rules.

  Write a program calculates and displays the pay to workers

Create 3 workers and initialize their member variables with any data you choose. Store the workers in a Linked List. Write a function that will traverse the list of workers calculating and displaying the amount of pay each worker has earned.

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