Two integers are read as the base and the height of a Triangle object. Assign pointer myTriangle with a new Triangle object using base and the height as arguments in that order. the Ex: If the input is 23 37, then the output is: Triangle's base: 23 Triangle's height: 37 1 #include 2 using namespace std; 3 4 class Triangle { 5 public: 6 Triangle(int baseValue, int heightValue); void Print (); private: 7 8 9 10 11 }; 12 Triangle::Triangle(int baseValue, int heightValue) { 13 14 int base; int height; base= baseValue; height = heightValue; 15 } 16 void Triangle::Print() { 17 18 cout << "Triangle's base: " <
Two integers are read as the base and the height of a Triangle object. Assign pointer myTriangle with a new Triangle object using base and the height as arguments in that order. the Ex: If the input is 23 37, then the output is: Triangle's base: 23 Triangle's height: 37 1 #include 2 using namespace std; 3 4 class Triangle { 5 public: 6 Triangle(int baseValue, int heightValue); void Print (); private: 7 8 9 10 11 }; 12 Triangle::Triangle(int baseValue, int heightValue) { 13 14 int base; int height; base= baseValue; height = heightValue; 15 } 16 void Triangle::Print() { 17 18 cout << "Triangle's base: " <
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter10: Classes And Data Abstraction
Section: Chapter Questions
Problem 17PE
Related questions
Question
What would be the missing code
![Two integers are read as the base and the height of a Triangle object. Assign pointer myTriangle with a new Triangle object using
the base and the height as arguments in that order.
Ex: If the input is 23 37, then the output is:
Triangle's base: 23
Triangle's height: 37
1 #include <iostream>
2 using namespace std;
3
4 class Triangle {
5
public:
6
Triangle(int baseValue, int heightValue);
void Print ();
7
8
9
10
11 };
12 Triangle:: Triangle(int baseValue, int heightValue) {
13 base baseValue;
14
height = heightValue;
15}
16 void Triangle::Print() {
17
18
private:
1
int base;
int height;
cout << "Triangle's base: " <<base << endl;
cout << "Triangle's height: << height << endl;
Check
Next level
CS Scanned Wi
2
3
4
5
Feedback?
2
3](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Ff8c67d92-2376-430d-971a-91f6c41cd4dc%2Fd6ed124e-d4d4-4ab5-8790-eeee692b172b%2Fqhypqv3_processed.jpeg&w=3840&q=75)
Transcribed Image Text:Two integers are read as the base and the height of a Triangle object. Assign pointer myTriangle with a new Triangle object using
the base and the height as arguments in that order.
Ex: If the input is 23 37, then the output is:
Triangle's base: 23
Triangle's height: 37
1 #include <iostream>
2 using namespace std;
3
4 class Triangle {
5
public:
6
Triangle(int baseValue, int heightValue);
void Print ();
7
8
9
10
11 };
12 Triangle:: Triangle(int baseValue, int heightValue) {
13 base baseValue;
14
height = heightValue;
15}
16 void Triangle::Print() {
17
18
private:
1
int base;
int height;
cout << "Triangle's base: " <<base << endl;
cout << "Triangle's height: << height << endl;
Check
Next level
CS Scanned Wi
2
3
4
5
Feedback?
2
3
![Two integers are read as the base and the height of a Triangle object. Assign pointer myTriangle with a new Triangle object using
the base and the height as arguments in that order.
Ex: If the input is 23 37, then the output is:
Triangle's base: 23
Triangle's height: 37
CS
17
18
19 }
20
21 int main() {
22
23
24
25
26
27
28
29
30
31
32
33
34 }
cout << "Triangle's base: " <<base << endl;
cout << "Triangle's height: " << height << endl;
Check
Triangle myTriangle = nullptr;
int baseValue;
int heightValue;
cin >> baseValue;
cin >> heightValue;
Y* Your code goes here *7/
myTriangle->Print();
return 0;
Next level
2
Scanned with Cam
3
5
Feedback?
LED-D-](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Ff8c67d92-2376-430d-971a-91f6c41cd4dc%2Fd6ed124e-d4d4-4ab5-8790-eeee692b172b%2Fdnwmq4r_processed.jpeg&w=3840&q=75)
Transcribed Image Text:Two integers are read as the base and the height of a Triangle object. Assign pointer myTriangle with a new Triangle object using
the base and the height as arguments in that order.
Ex: If the input is 23 37, then the output is:
Triangle's base: 23
Triangle's height: 37
CS
17
18
19 }
20
21 int main() {
22
23
24
25
26
27
28
29
30
31
32
33
34 }
cout << "Triangle's base: " <<base << endl;
cout << "Triangle's height: " << height << endl;
Check
Triangle myTriangle = nullptr;
int baseValue;
int heightValue;
cin >> baseValue;
cin >> heightValue;
Y* Your code goes here *7/
myTriangle->Print();
return 0;
Next level
2
Scanned with Cam
3
5
Feedback?
LED-D-
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,