Math 173 – Midterm 2
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
Math 173 – Midterm 2
Create a C++ class called ‘Factoring’ with these constructor, desctructor and function prototypes:
- Default constructor.
- User defined constructor with 2 parameters of type integer.
- User defined constructor with 3 parameters of type integer.
- A destructor.
- A static function called printHeader().
- A function called binomial() of type integer with 2 parameter of type int (this is the different of 2 squares)
- A function called trinomial() of type integer with 3 parameter of type int.
- A function called trinomialPlus() of type integer with 2 parameter of type int (This is the sum of 2 cubes)
- A function called trinomialMinus() of type integer with 2 parameter of type int (This is the difference of 2 cubes).
Create a function definition file (Factoring.cpp) with the above functions definition.
- A static function printHeader() to print the following:
*******************************************************
CS 173 – Introduction to Object Oriented Programming
(print your name here)
*******************************************************
- A function called binomial() of type integer with 2 parameter of type int (this is the different of 2 squares):
a2 – b2 = (a – b)(a + b)
ex:
4x2 - 9 = (2x – 3)(2x + 3)
- A function called trinomial() of type integer with 3 parameter of type int.
a2 + 2ab + b2 = (a + b)2
ex:
x2 - 6x + 9 = (x – 3)2
- A function called trinomialPlus() of type integer with 2 parameter of type int (This is the sum of 2 cubes)
a3 + b3 = (a + b)(a2 – ab + b2)
ex:
8 + 29 = 23 + 33
= (2 + 3)(4 - 6 + 9)
- A function called trinomialMinus() of type integer with 2 parameter of type int (This is the difference of 2
cubes).
a3 - b3 = (a - b)(a2 + ab + b2)
ex:
8 - 29 = 23 - 33
= (2 - 3)(4 + 6 + 9)
Create a test file to test all functions from the Factoring.cpp file.
2023-12-12
CS 173 – Introduction to Object Oriented Programming