Question: Create a new text file named ex 1 _ 1 . cpp and enter the following lines as comments. Be sure to replace YourFullName with

Create a new text file named ex1_1.cpp and enter the following lines as comments. Be sure to replace
YourFullName with your real full name.
/*
* Filename: ex1_2.cpp
* Programmer: YourFullName
*/
2. Next to the above lines, create a simple class named Quadratic that has the following members.
three public variables of int type, a, b, and c. Set the value of a to 2, b to -3, and c to 15.
one public function named func() of double type that takes one parameter named x of double type and
performs a calculation based on func(x)= ax2+bx+c.
3. In the main() function, create an instance of the Quadratic class named q1 and then use it to call the
func() function by passing four values: 3,3.14,-3, and -3.14. Make sure the output looks similar to the
following.
x value
324
3.1425.2992
-342
-3.1444.1392

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!