Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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_2

Step: 3

blur-text-image_3

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

Database Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

More Books

Students also viewed these Databases questions

Question

Evaluate the Riemann sum for f(x) = 2 x2, 0 Answered: 1 week ago

Answered: 1 week ago

Question

=+ (c) Show that this P is countably additive if 02 is uncountable.

Answered: 1 week ago

Question

3. Identify cultural universals in nonverbal communication.

Answered: 1 week ago