Solved

Need Java Program

Posted on 2011-09-13
7
304 Views
Last Modified: 2013-11-24
If there's anyone out there familiar with Java, I am in serious need of some help. I need a program that does a few simple tasks. It must ask the user for an input file. The input file I am using is a basic txt file that has 100 integers. These integers range from -9 to 9 including 0. Then it must calculate and display the mode (the integer that occurs the most.) If possible, I'd like it to have at least one method that it calls upon somewhere in the program. And that's it. Hopefully someone can help. Attached is the txt file I am using. We were told, if done correctly, this code can be written in 15-20 lines, so I can't imagine this being complicated.  Lab0-input.txt
0
Comment
Question by:Nox_31
7 Comments
 
LVL 47

Expert Comment

by:for_yan
ID: 36531631

>we were told

Is that a some kind of academic assignemnt ?
0
 

Author Comment

by:Nox_31
ID: 36531643
It's a hw assignment for a programming class.
0
 
LVL 47

Expert Comment

by:for_yan
ID: 36531656

At EE we are not allowed towrite the programs for your accademica assignemnt
Try to write some draft - we can help you to improve it
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:Nox_31
ID: 36531668
I'll take my business elsewhere then, thanks.
0
 
LVL 10

Expert Comment

by:gordon_vt02
ID: 36538607
If you're not planning on doing the work, get out of the class.  As a professional developer, I don't want you anywhere near my code or anyone else's if you can't/won't learn how to do it yourself.
0
 
LVL 20

Accepted Solution

by:
Amitkumar Panchal earned 500 total points
ID: 36555588
Agreed with for_yan and gordon_vt02. But you can use the given hint and reference.


1. Read your file and store the data in an Array (Refer http://www.roseindia.net/java/beginners/java-read-file-line-by-line.shtml)
2. Calculate Mode based on the values stored in an Array (http://stackoverflow.com/questions/4191687/how-to-calculate-mean-median-mode-and-range-from-a-set-of-numbers)
0
 

Author Comment

by:Nox_31
ID: 36555647
It's an elective course it's totally optional. As a professional smart ass, I pay close attention to detail and no where in my post does it say anything about having someone else write the code...it simply asks for help. Which has been given to me by amit. Thank you. Issue has been resolved. Case closed.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now