Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

By using Java OOP language please solve the question below, also please share the code's itself in a digital form so that I can copy

By using Java OOP language please solve the question below, also please share the code's itself in a digital form so that I can copy the code and study on it.

image text in transcribed

Write a class named Averager containing: - An instance variable named sum of type integer, initialized to 0. - An instance variable named count of type integer, initialized to 0. - A method named getSum that returns the value of sum. - A method named add that accepts an integer parameter. The value of sum is increased by the value of the parameter and the value of count is incremented by one. - A method named getCount that accepts no parameters. getCount returns the value of the count instance variable, that is, the number of values added to sum. - A method named getAverage that accepts no parameters. getAverage returns the average of the values added to sum. The value returned should be a value of type double (and therefore you must cast the instance variables to double prior to performing the division)

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

Advances In Databases 11th British National Conference On Databases Bncod 11 Keele Uk July 7 9 1993 Proceedings Lncs 696

Authors: Michael F. Worboys ,Anna F. Grundy

1993rd Edition

3540569219, 978-3540569213

More Books

Students also viewed these Databases questions

Question

Graph each rational function. x2 9 f(x) x + 3

Answered: 1 week ago

Question

Evaluating Group Performance?

Answered: 1 week ago