CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   Java and JSP (http://www.codingforums.com/forumdisplay.php?f=54)
-   -   Java Programming please help! (http://www.codingforums.com/showthread.php?t=287613)

coolcod 02-14-2013 04:00 AM

Java Programming please help!
 
dsafsfv

xelawho 02-14-2013 05:10 AM

Quote:

Originally Posted by coolcod (Post 1313250)
The problems i am having are:
1. I need to keep track of the maximum and minimum temperature in the weather-short.csv file and compare it with the max or min global variables in the compare method, what is the way to do it?
2. How should I then link this code in the html file?

Can I add:

3. Don't know the difference between java and javascript

?

coolcod 02-14-2013 05:20 AM

sorry i didnt get you

low tech 02-14-2013 05:24 AM

Hi

Quote:

... trying to make a website that uses a java program ...
java and javascript are not the same

you are in the javascript forum

request a moderator to move this thread to the JAVA forum

LT

Fou-Lu 02-14-2013 01:54 PM

This codes a bit tough to trace since you don't have indentation here.
The CSV is logically a two dimensional array or a collection of collection. So you could just split the readTextFile entries up into a collection. Problem is I have no idea what is in that collection, so I can't really tell you what to do with it.
You can write a simple CSV interpreter by simply splitting the string on the delimiter. A good one would need to also determine enclosure characters since a string in a csv file could include the delimiter character as well. If its something like a CSV of numbers, than a simple tokenizer on the delimiter would be sufficient. Collections can then determine min and max very easily using the Collections.min and Collections.max methods.


All times are GMT +1. The time now is 08:43 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.