Java Lab 4 Completion

posted in: Daily Update | 0


  1. Completed Java Lab 4: Stats Class explanation.


Today was a busy day because I had to take two long bus rides to long beach and back to attend an IEEE meeting. I had some spare time before the meeting so I began working on the website again by explaining the java lab 4’s code. I was almost done so when I got home, I decided to finish it. I also got the chance to bring back the line-following robot that I built during the year so that I can modify it and document it on this website. I can also use the parts from this line following robot to learn/practice the Arduino Servo library. On a quick note Java Lab 4: Stats class is a program that I did in my Java programming class and its purpose is to take user’s input for the # of items, the minimum and maximum possible numbers to create a list or an array. Then the program will prompt the user to select what he/she wants to do from the menu and the program will display what the user chose. The program’s menu options are:

  • Maximum of the list
  • Minimum of the list
  • Average of the list
  • Mode of the list
  • # of even numbers in the list
  • # of odd numbers in the list
  • A sample set output of all the numbers in the list
  • # Times a certain number occurs in the list

I hope this lab helps any person looking for a solution to a similar problem because there is a lot of logic and useful code in this program. The most difficult method that I wrote in this program had to be finding the Mode of a list of numbers because it required two arrays and one array has to be the size of the maximum possible number generated.

Leave a Reply