Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This program is in C++ This is the sample output: Length: 20 ft Width: 3.78 in Depth: 12 in Material: steel Name: Length: 40 ft

This program is in C++

image text in transcribed

This is the sample output:

Length: 20 ft

Width: 3.78 in

Depth: 12 in

Material: steel

Name:

Length: 40 ft

Width: 4.41 in

Depth: 14 in

Material: Steel

Name: Kevin

In this assignment, you have to create a class and one object named beam. Beam has multiple properties such as length, width depth, and material. Width is a function of depth with the following relationship: width = 0. 315 * depth You need to write functions named setLength and setdepth for assigning the length and respectively (there must also be functions to return their values. Define getLength and getDepth functions) Material can be either "steel" or "aluminum" A new beam must be defined that consists of two original beam. For that purpose, you have to overload the operator to be able to add the beam object to each other, making a new object, then name this new beam as you wish. Finally, a function named printStats is required to display the class properties You will add some additional functionality the b to class adding additional functions and/or attributes to the files beam.cpp and beam.h. Your program must have or do the following: An additional (overloaded) constructor function that takes 2 float parameters of length and depth and sets those instead of the default values. Everything else will be the same as the default case. A new function called setDepth (float depth). Be sure to correctly set the width within this function. A new operator

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases On The Web Designing And Programming For Network Access

Authors: Patricia Ju

1st Edition

1558515100, 978-1558515109

More Books

Students also viewed these Databases questions

Question

5. What determines consumption and investment?

Answered: 1 week ago