Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write the definition of the class OurClass with the following member functions: - The default constructor: it sets the first data member to 0 ,

image text in transcribed

Write the definition of the class OurClass with the following member functions: - The default constructor: it sets the first data member to 0 , and the second to ' A '. - The constructor with parameters. - The set functions: setFirst( ) for data member first, and setSecond( ) for data member second. - The get functions: getFirst( ) for data member first, and getSecond () for data member second. - The function read ( ) that reads the values for the two data members. - The function print( ) that outputs the values of the two data members. 2. Write the following two functions: - Function maxObj( ) that receives as arguments two objects of the class OurClass and returns another object of the class OurClass such that the value of each of its member variables is the maximum value of the corresponding member variables of its arguments. - Function incrObj( ) that receives as argument an object of the class OurClass and add 1 to the value of its first member variable. 3. Write the declaration of the following objects of the class OurClass: - Objects objA and objB with their member variables set to the default values. - Object objC with its member variables set to 100 and ' P ' respectively. 4. Write the statements to do the following: a. Read the values for the two member variables of object objA. b. Set the value of the first member variable of object objB to 15 . c. Add 10 to the value of the first member variable of object objA. d. Output the values of the member variables of object objC. e. Call function maxObj( ) with the objects objA and objB as arguments. f. Call function incrObj() with object objC as argument

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

Beginning VB.NET Databases

Authors: Thearon Willis

1st Edition

1594864217, 978-1594864216

More Books

Students also viewed these Databases questions

Question

3. Design a program for preparing for cross-cultural assignments.

Answered: 1 week ago

Question

2. Develop a program for effectively managing diversity.

Answered: 1 week ago

Question

7. What is coaching? Is there only one type of coaching? Explain.

Answered: 1 week ago