Solved

Need Java Program

Posted on 2011-09-13
7
305 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

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 21

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
allswap challenge 6 80
Java array passed to SQL where clause 23 64
Java and GPO 11 73
egit plugin on eclipse 8 41
Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
The purpose of this article is to demonstrate how we can use conditional statements using Python.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

863 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

25 Experts available now in Live!

Get 1:1 Help Now