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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started