Question: C++ as simple as possible. Exercise 12.1 Define a class Area that has two private variable members: units of type string. area_value of type float.

C++ as simple as possible.

C++ as simple as possible. Exercise 12.1 Define a class Area that

has two private variable members: units of type string. area_value of type

float. Modify the P12_1a.cpp program to create a dynamic variable of type

Exercise 12.1 Define a class Area that has two private variable members: units of type string. area_value of type float. Modify the P12_1a.cpp program to create a dynamic variable of type Area, then: 1. Input from the keyboard the area_value and its units. Compute one-half and one-quarter of the area and display the results. 2. Destroy the dynamic variable at the end. Call your new program ex12_1.cpp Let us look at P12_1a.cpp to see how this is done. 4. | 1. 1/P12_1a.cpp . This program illustrates dynamic variables 2. #include 3. using namespace std; 5. int main() 6. { 7. int *p1; pl = new int; // Variables created using the new operator are called dynamic variabl 8. 9. es 10. 11. cout > *p1; 13. *p1 = *p1 + 7; 14. cout

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 Databases Questions!