Cone's radius: 5.0 Cone's height: 3.0 Cone with radius 5.0 and height 3.0 is deallocated. 24 25 26 } 27 Cone::-Cone () { // Covered in section on Destructors. 28 cout << "Cone with radius " << radius << " and height " << height << " is deallocated." << endl; cout << "Cone's cout << "Cone's 29 } 30 31 int main() { 32 33 34 35 36 37 38 39 40 41 >> radius: " << fixed << setprecision (1) << radius << endl; height: " << fixed << setprecision (1) << height << endl; Cone myCones = nullptr; int count; int i; Y* Your code goes here */ delete[] myCones; return 0;

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Missing code
464730 3214874.4x3zqy7
Jump to level 1
Read an integer as the number of Cone objects. Assign myCones with an array of that many Cone objects. For each object, call
object's Read() followed by the object's Print().
Ex: If the input is 1 5.0 3.0, then the output is:
Cone's radius: 5.0
Cone's height: 3.0
Cone with radius 5.0 and height 3.0 is deallocated.
24 cout << "Cone's
radius: " << fixed << setprecision (1) << radius << endl;
25
cout << "Cone's height: " << fixed << setprecision (1) << height << endl;
26}
27 Cone::-Cone () { // Covered in section on Destructors.
28
cout << "Cone with radius " << radius << " and height << height << " is deallocated." << endl;
29 }
30
31 int main() {
32
33
34
35
36
37
38
39
40
41}
Cone myCones = nullptr;
int count;
int i;
*Your code goes here */
delete[] myCones;
return 0;
1
Check
Next level
CS Scanned
2
3
amScanner
"1
4
5
>
<
2
<
Enndhaal
Transcribed Image Text:464730 3214874.4x3zqy7 Jump to level 1 Read an integer as the number of Cone objects. Assign myCones with an array of that many Cone objects. For each object, call object's Read() followed by the object's Print(). Ex: If the input is 1 5.0 3.0, then the output is: Cone's radius: 5.0 Cone's height: 3.0 Cone with radius 5.0 and height 3.0 is deallocated. 24 cout << "Cone's radius: " << fixed << setprecision (1) << radius << endl; 25 cout << "Cone's height: " << fixed << setprecision (1) << height << endl; 26} 27 Cone::-Cone () { // Covered in section on Destructors. 28 cout << "Cone with radius " << radius << " and height << height << " is deallocated." << endl; 29 } 30 31 int main() { 32 33 34 35 36 37 38 39 40 41} Cone myCones = nullptr; int count; int i; *Your code goes here */ delete[] myCones; return 0; 1 Check Next level CS Scanned 2 3 amScanner "1 4 5 > < 2 < Enndhaal
Jump to level 1
Read an integer as the number of Cone objects. Assign myCones with an array of that many Cone objects. For each object, call
object's Read() followed by the object's Print().
Ex: If the input is 1 5.0 3.0, then the output is:
Cone's radius: 5.0
Cone's height: 3.0
Cone with radius 5.0 and height 3.0 is deallocated.
5 class Cone {
6
public:
7
8
Cone();
void Read();
void Print();
-Cone();
9
10
11
12
13
14 };
15 Cone::Cone() {
16
17
private:
double radius;
double height;
Obrak.
radius= 0.0;
height = 0.0;
18}
19 void Cone:: Read() {
20
cin >> radius;
21
cin >> height;
22}
23 void Cone::Print() {
CS Scanned with CamScanner
at level
4
5
>
1
<
2
<
3
>
4
5
Transcribed Image Text:Jump to level 1 Read an integer as the number of Cone objects. Assign myCones with an array of that many Cone objects. For each object, call object's Read() followed by the object's Print(). Ex: If the input is 1 5.0 3.0, then the output is: Cone's radius: 5.0 Cone's height: 3.0 Cone with radius 5.0 and height 3.0 is deallocated. 5 class Cone { 6 public: 7 8 Cone(); void Read(); void Print(); -Cone(); 9 10 11 12 13 14 }; 15 Cone::Cone() { 16 17 private: double radius; double height; Obrak. radius= 0.0; height = 0.0; 18} 19 void Cone:: Read() { 20 cin >> radius; 21 cin >> height; 22} 23 void Cone::Print() { CS Scanned with CamScanner at level 4 5 > 1 < 2 < 3 > 4 5
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Class
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education