Question: INSTRUCTIONS: Write a short paragraph for each question. C) Explain the difference between class and object D) Explain the difference between const int getAge(); and
INSTRUCTIONS: Write a short paragraph for each question.
C) Explain the difference between class and object
D) Explain the difference between const int getAge(); and int getAge() const;
INSTRUCTIONS: Draw a UML class diagram for one of the classes below.
A) Design a class Binomial Distribution. This class must have the following members:
- A private attribute for the parameter n (a natural number greater than zero) - A private attribute for the parameter p (a real number between zero and one) - A protected attribute for the name of the distribution (a constant string) - A default constructor which initializes n, p and name with "Binomial" - Observers and mutators - A public method mean which returns (n*p) - A public method variance which returns (n*p)*(1-p)
B) Design a class Uniform Distribution. This class must have the following members:
- A private attribute for the parameter a (a real number) - A private attribute for the parameter b (a real number greater than b) - A protected attribute for the name of the distribution (a constant string) - A default constructor which initializes a, b and name with "Uniform" - Observers and mutators - A public method mean which returns (b+a)/2.0 - A public method variance which returns (b-a)*(b-a)/12.0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
