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

Principles of Information Systems (MindTap Course List)
12th Edition
ISBN:9781285867168
Author:Ralph Stair, George Reynolds
Publisher:Ralph Stair, George Reynolds
Chapter6: Telecommunications And Networks
Section: Chapter Questions
Problem 5SAT
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
Principles of Information Systems (MindTap Course…
Principles of Information Systems (MindTap Course…
Computer Science
ISBN:
9781285867168
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning