Make a C++ program with class, object, constructor, data member with access modifier and member function overloading. FileName: Data.cpp The program must have the following data members and formula. All data members are private. Data Member Formula area3 cube (initial value is Zero) cylinder (initial value is Zero) rectangle (initial value is Zero) sphere (initial value is Zero) |(pi)r²h Lwh 4(pi)r3 3 pi (value is 3.1416) None The C++ program have the fix main() function. int main (){ Formula shape; shape.compute (20);//for cube - shape.compute (12.75, 10);//for cylinder - one fractional and one whole number shape.compute (5, 7, 15);//for rectangle - three whole number shape.compute (25.50);//for sphere - one fractional number one whole number Expected Output: The

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
Member Lengths
Members Sections
Load Diagram
4000 mm
6000 mm
5000 mm
100.000 N
4000 mm
6000 mm
5000 mm
70.00 EN
4000 mm
6000 mm
5000 mm
Rect 0.40x0.40
Rect 0.30x0.20
Rect 0.40x0.25
Rect 0.50x0.50
ww 000c
ww 000v
ww 000
ww 000r
ww 000s
ww 00
ww 000
ww 000c
ww 000f
ww 000
Transcribed Image Text:Member Lengths Members Sections Load Diagram 4000 mm 6000 mm 5000 mm 100.000 N 4000 mm 6000 mm 5000 mm 70.00 EN 4000 mm 6000 mm 5000 mm Rect 0.40x0.40 Rect 0.30x0.20 Rect 0.40x0.25 Rect 0.50x0.50 ww 000c ww 000v ww 000 ww 000r ww 000s ww 00 ww 000 ww 000c ww 000f ww 000
Make a C++ program with class, object, constructor, data member with access modifier and
member function overloading.
FileName: Data.cpp
The program must have the following data members and formula. All data members are
private.
Data Member
Formula
area3
cube (initial value is Zero)
cylinder (initial value is Zero)
rectangle (initial value is Zero)
sphere (initial value is Zero)
(pi)r?h
Lwh
4(pi)r³
pi (value is 3.1416)
None
The C++ program have the fix main() function.
int main(){
Formula shape;
shape.compute (20);//for cube -
shape.compute (12.75, 10);//for cylinder - one fractional and one whole number
shape.compute (5, 7, 15);//for rectangle - three whole number
shape.compute (25.50);//for sphere - one fractional number
one whole number
Expected Output:
The shape is a cube with an area of 8000
The shape is a cylinder with an area of 5107.06
The shape is a rectangle with an area of 525
The shape is a sphere with an area of 69456.1
Transcribed Image Text:Make a C++ program with class, object, constructor, data member with access modifier and member function overloading. FileName: Data.cpp The program must have the following data members and formula. All data members are private. Data Member Formula area3 cube (initial value is Zero) cylinder (initial value is Zero) rectangle (initial value is Zero) sphere (initial value is Zero) (pi)r?h Lwh 4(pi)r³ pi (value is 3.1416) None The C++ program have the fix main() function. int main(){ Formula shape; shape.compute (20);//for cube - shape.compute (12.75, 10);//for cylinder - one fractional and one whole number shape.compute (5, 7, 15);//for rectangle - three whole number shape.compute (25.50);//for sphere - one fractional number one whole number Expected Output: The shape is a cube with an area of 8000 The shape is a cylinder with an area of 5107.06 The shape is a rectangle with an area of 525 The shape is a sphere with an area of 69456.1
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Reference Types in Function
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