Wednesday, January 11, 2012

Tutorial: Simple Statistics Calculator in Java

by eturo


Today, I will show you a simple Statistics Calculator Java program that allows the user to input any numbers then the program will display the total counts or number inputted, sum of all the numbers,  the smallest and largest number, the average and its Standard Deviation.

Here, I used the implementation of  polymorphism using different methods, with or without parameters (setting and getting), passing of variables, creating of object and the relationship of classes (inheritance).

The Design:

In designing the program, I create two classes: SimpleStatistics (the main program/class) and StatisticsCalculator (the subclass). The main program will served as the trigger to display the output of the program while the subclass is where we place the algorithm in setting and getting the data by passing it to the different methods we are going to create. The broken line indicates a relationship of each two classes where the subclass inheriting some attributes of the main class.




The image below is an example of the output dialog of the program. Lets see how this program works.






























Joke Time: Ang Huling Paalam (Mi Ultimo Adios)

The following joke is rated PG. Parental Guidance is not adviced. Dahil ang isang ito ay para sa lahat. Pawang i-rerepost ko lang! Galing lang ito sa isang taong mahilig gumawa ng patamang joke. (Bato bato sa langit, ang matatamaan siyempre magkakaroon ng BUKOL...hehe)
Ang mag-asawang FGMA (First Gentleman Mike Arroyo) at FPGMA (Former President Gloraia Macapagal-Arroyo) ay nag-uusap tungkol sa kanilang mga huling habilin...



FPGMA: Darling. kung mamamatay man ako, gusto ko hindi R.I.P ang nakasulat ha?

FGMA: Bakit naman? Pede ba yun darling... So, ano gusto mo?

FPGMA: Gusto kong ilagay mo, JESUS...

FGMA: Ano na naman bang gimik yan, darling? Ano ba meron sa JESUS?

FPGMA: Eh di, Joseph Estrada See yoU Soon! Oh di ba ang astig?

FGMA: Grabe ka naman darling, 3 Kings palang ngayon. Huwag naman ganyan. I will suggest na mas ok darling kung BAYAN ang isusulat natin?

FPGMA: Ano naman ibig sabihin nun darling?
FGMA: Ano pa nga ba, eh di Benigno Aquino You Are Next!

FPGMA: ngek!


(natawa ako dito) Tayong mga Filipino talaga mahilig gumawa sa mga ganitong klaseng jokes kahit na nasa gitna tayo ng kahirapan at mga problema. Siguro, ayos na rin ito para naman kahit papaano maibsan or mabawasan konti yung ating mga dinaranas dito sa bansa natin. At tsaka, ok lang itong mga ganitong banat, dahil sila-sila rin naman ang minsang dahilan or major major dahilan kung bakit tayo naghihirap ngayon. Sila ang nag-aaway dahil na rin sa kapangyarihan sa politics, pero kahit wala tayo sa pulitika, tayong mga ordinaryong tao at simple ang pamumuhay ay nadadamay. Kelan kaya mawawala......(period)

Photo courtesy from: http://gmaresign.blogspot.com/

Like Us on Facebook

Related Posts Plugin for WordPress, Blogger...