Question: Consider the following C++ code representing a typical class specification: Write down the C++ main function to create three objects with names OB1,OB2 and OB3,

 Consider the following C++ code representing a typical class specification: Write

Consider the following C++ code representing a typical class specification: Write down the C++ main function to create three objects with names OB1,OB2 and OB3, belonging to the class CLS as specified above, and then perform the following tasks sequentially: (i) Initializes OB1 with the value of 7.5. (ii) Prompts the user to enter a value at the keyboard and assigns this value to OB2. (iii) Swaps the data of OB1 and OB2. (iv) Computes the sum of the data of OB1 and OB2, and stores the result in OB3. (v) Retrieves and displays the data of OB3 on the screen. 12 marks

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!