This week's book giveaways are in the AI and JavaScript forums.
We're giving away four copies each of GANs in Action and WebAssembly in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of GANs in ActionE this week in the AI forum
or WebAssembly in Action in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

average monthly temps and arrays

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

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

 
author & internet detective
Posts: 39789
797
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dave,
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.
 
You get good luck from rubbing the belly of a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!