Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

getWeight - Value - returning function to return the weight getHeight - Value - returning function to return the height Default constructor - Sets name

getWeight-Value-returning function to return the weight
getHeight-Value-returning function to return the height
Default constructor - Sets name to the empty string and age, weight, and height to 0
Constructor with parameter - Sets the values of the instance variables to the values specified by the user
Write the definition of these member functions of the class secretType.
b) Write the main class that creates at least two different instances of the secretType class. (Please play around with the member functions for this task, e.g., the first instance can be created from the constructor with parameter and the second instance can have its information from the functions setName, setAge, setweight, setHeight). Then print out the information (i.e., member variables) of these instances.
Part B: 30 points. Lab 1 PartB.cpp graded out of 25 points if not submitted during lab time.
Check to see what value the function mystery returns when called with a value of 4. int mystery(int number)
{
)(1
else
return number ' mystery(number -1):
Write the similar function mystery but using the while ' or 'for' loop instead.
image text in transcribed

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

Building The Data Warehouse

Authors: W. H. Inmon

4th Edition

0764599445, 978-0764599446

More Books

Students also viewed these Databases questions