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
icon
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
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-
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
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
User Defined DataType
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,