wood burning stoves*
The moose likes Beginning Java and the fly likes average monthly temps and arrays Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "average monthly temps and arrays" Watch "average monthly temps and arrays" New topic

average monthly temps and arrays

dave hen

Joined: Mar 05, 2008
Posts: 6

Im having trouble with the code im doing below,basically im trying to get the average temp for each of the 12 months of the year, the average temp must be input by the user.

The programme then need to calculate the coldest,warmest and average monthly temp in both f and cels

My problem so far is my code is working but rather showing the month im showing the m onths number. in other words

ie the average temp for month 6 is 87c rather than the average temp for june is 87c

How do i get the code to show its june rather than a 6.

then when im printing out the coldest month it saids

the coldest month is 87c,how do i get it to say the coldest month is june which is 87c.

Here is my working code so far

Jeanne Boyarsky
internet detective

Joined: May 26, 2003
Posts: 30138

Do you have anything that maps a number to a month name? Maybe another array? If so (or if you write one), you could use that to get the month name.

[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
I agree. Here's the link: http://aspose.com/file-tools
subject: average monthly temps and arrays
Similar Threads
ArrayIndexOutOf Bounds Exception error
Could not find symbol class.
How to store ten scores in an array?
not sorting; getting null
Java Course help needed -Mortgage