Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 14th, 2012, 08:57 PM
maskdesmith maskdesmith is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2012
Posts: 37 maskdesmith User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 30 sec
Reputation Power: 1
Homework help setting up something

The code isn't correct (I know that much) but here's some info:

I need to pass the temperatures of 80 degrees to 105 degrees through something that lets me know what the heat index is at 40, 60 and 80% humidity.

(Heat Index Temperature = C1 + C2 * Temperate + C3 * humidity + C4 * temperature * humidity + C5 * temperature * temperature
+ C6 * humidity * humidity + C7 * temperature * temperature * humidity + C8 * temperature * humidity * humidity + C9 * temperature * temperature * humidity * humidity)

Here's the basic's of the equation.

And here's the variables:
public static final int MIN_TEMPERATURE = 80; //degrees F
public static final int MAX_TEMPERATURE = 105; //degrees
public static final int LOW_HUMIDITY = 40;
public static final int MED_HUMIDITY = 60;
public static final int HIGH_HUMIDITY = 80;
public static final double C1 = -42.379;
public static final double C2 = 2.04901523;
public static final double C3 = 10.14333127;
public static final double C4 = -0.22475541;
public static final double C5 = -6.83783E10-3;
public static final double C6 = -5.481717E10-2;
public static final double C7 = 1.22874E-3;
public static final double C8 = 8.5282E-4;
public static final double C9 = -1.99E-6;

i've been told I need to use a loop in the main method to call this method with the specified temperature (loop control variable) and
humidity (3 calls in the loop, one for each humidity value).

How should I start going about this?

Reply With Quote
  #2  
Old September 15th, 2012, 07:47 AM
NormR's Avatar
NormR NormR is offline
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Aug 2010
Location: SW Missouri
Posts: 2,956 NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 2 h 56 m 11 sec
Reputation Power: 345
Quote:
need to use a loop in the main method to call this method

Where are the methods defined that you are talking about?
The code you posted just defines a bunch of variables and assigns them initial values.

Can you post the code with the methods?

Reply With Quote
  #3  
Old September 15th, 2012, 07:55 AM
maskdesmith maskdesmith is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2012
Posts: 37 maskdesmith User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 30 sec
Reputation Power: 1
Quote:
Originally Posted by NormR
Where are the methods defined that you are talking about?
The code you posted just defines a bunch of variables and assigns them initial values.

Can you post the code with the methods?


That's the thing. I don't know where to begin yet so I haven't set up any methods.

Reply With Quote
  #4  
Old September 15th, 2012, 08:07 AM
NormR's Avatar
NormR NormR is offline
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Aug 2010
Location: SW Missouri
Posts: 2,956 NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 2 h 56 m 11 sec
Reputation Power: 345
Start by reading the tutorial on how to define a method:
http://docs.oracle.com/javase/tutor...OO/methods.html

Then write the code in steps. Define a skeleton for the method,
code a call to the method and compile that.
Fix the errors and recompile. continue until the errors are fixed.


When the skeleton compiles ok, then work on putting the logic in the method to do the job it is supposed todo.

Last edited by NormR : September 15th, 2012 at 08:10 AM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > Homework help setting up something

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap