Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise C6 The class Demo2 is defined as follows: class Demo2 public: void setValues (double num I, double num2); // to set the values of

image text in transcribed
Exercise C6 The class Demo2 is defined as follows: class Demo2 public: void setValues (double num I, double num2); // to set the values of both member variables double getValuel(void): // to return the value of member variable vall double gerValue2(void): // to return the value of member variable val2 double getAverage(): // to compute the average of the values of both variables private: double vall: // the first data member double val2: // the second data member -- function setValues() -- /* set the values of the member variables to the given values void Demo2:: setValues(double num], double num2) vall = num; val2 num2; ----- function getValuel() --- /* returns the value of the first member variable double Demo2::getValue l(void) return vall): --- function gerValue2() -- /* returns the value of the second member variable double Demo2::getValue2(void) return (val2); function getAverage /* compute the average of both values and return it double Demo2:: getAverage(void) return( (valul + valu2)/2): 2011 Gilbert Ndjatou Page 63

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

Excel 2024 In 7 Days

Authors: Alan Dinkins

1st Edition

B0CJ3X98XK, 979-8861224000

More Books

Students also viewed these Databases questions

Question

6. Identify characteristics of whiteness.

Answered: 1 week ago

Question

e. What are notable achievements of the group?

Answered: 1 week ago