?
Solved

Need Java Program

Posted on 2011-09-13
7
Medium Priority
?
313 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

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 2000 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

This article will show, step by step, how to integrate R code into a R Sweave document
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Suggested Courses

777 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