Reference no: EM13936605
Implement "Statistician" at the end of Chapter 2, #2 in your text and #3 plus what is below. (Note: do NOT use an array to hold the sequence of input data. You need only the data members - length, sum, mean, smallest number, and largest number as stated in the text. You must be able to handle an empty Statistician.
You are to add the following to you Statistician program.
Two constructor methods that initialize your statistician objects: One is the default and one to initialize a statistician with the value of another statistician. The second constructor is called a copy constructor. Ex. "Statistician stat1;" declares an object as you normally do. The second one "Statistician stat2(stat1);" declares stat2 and initializes stat2 to the values (data member values) in stat1. So if you print stat2 and stat1, both would have the same values.
The copy constructor would look like
Statistician ( statistician s ) //where 's' is the argument 'stat1' above.
{ Several assignments of the data members}
An overloaded (<<) output method using the "friend" attribute.
The output should look something like the following where you print out of the data members with some labeling:
sum = xxx
len = xxx
....
An overloaded (+) as a function outside the class.
An overloaded (==) and (!=) as methods.
Add a 'erase' function member that resets a Statistician object.
Use the following input to test you program.
Data for statistician1: 5.5, 6.6, 8.8, -3.4, -0.5, 4.7, 9.1
Print out: the Sum, length and average only for statistica1 (you'll need getter functions for these)
add to statistician1: 5.2 - 3.3 - 8.5 3.2 5.5
Print out: statistician1 using the << operator.
Data for statistician2: initialize statistician2 with the value of statistician1 on declaration of statistician2.
Print out: statistician 1 and statistician2 using the << operator.
add to statistician2: 13 21 71 47 12 25 24 23 24 32
Print out: the Sum, length and average only for statistica2
Print out: statistician 1 & statistician2 using the << operator.
I got to here::::>>>>>> Add To add two statisticians together. The results should add the sums, the lengths and determine which of the two are the largest and the smallest of the new statisticians form the two inputs. ex statistician3 largest is the
largest of statistican1 and statistician 2 for the statement below
statistician3 = statistician1 + statistica2;
Print out: statistician1 & statistician2 & statistician3 using the << operator.
Erase statistician2: Reset statistica2 to its initial declaration by calling the function member 'erase'.
Print out: statistician1 & statistician2 & statistician3 using the << operator.
Attachment:- statheader.zip
Determinants of the price of a bond
: What are the three most important determinants of the price of a bond? Describe the effect of each on the price of a bond.
|
How human population growth issue will impact our ecosystem
: What is the current estimate of the worldwide human population at this moment? Describe how this number is changing moment-to-moment, day-to-day, and from one year to the next.
|
Human nature is the single greatest vulnerability
: Human nature is the single greatest vulnerability in any control system and cannot be ignored. Organizations should always take human behavior into account when designing access plans and strategies. Human beings can pose unintentional threats when t..
|
Explain why the biosphere is considered closed and patchy
: Using the ecosystem of a suburban area, explain how the following abiotic factors influence plant growth and adaptability: sunlight, water, temperature changes, soil type, and winds.
|
Write a program to perform statistics calculation
: The results should add the sums, the lengths and determine which of the two are the largest and the smallest of the new statisticians form the two inputs. ex statistician3 largest is the
|
Explain the basic primary tasks
: Explain the basic primary tasks, high-level investigation processes, and challenges of a computer forensics specialist.Provide an overview of how computing devices are used in crimes of today and how these crimes can affect a company's data and infor..
|
Is debs speech to the jury similar to his speech in canton
: Which is more critical of the United States - Debs' speech in Canton or DuBois' editorial in The Crisis? Is Debs' speech to the jury similar to his speech in Canton? Different? In what way(s)
|
Paper with current event about cpital punishment
: Ethics Paper with current event about cpital punishment by lethal injection
|
Describe what you feel is a content delivery system
: Describe what you feel is a content delivery system. find at least two examples of content delivery system on the internet and provide URL to these examples in your response to this question.
|