Solved

# Learning Java ColdWeatherDay

Posted on 2008-11-03
Medium Priority
408 Views
Any suggestions that would get this run , I would greatlya appreciated it.

*********************************
package coldweathertester;
public class ColdWeatherDay
{
public ColdWeatherDay(double inittemp, double initvelocity)
{

{
temp = inittemp;
velocity = initvelocity;
}

// public double getTemperature()
// {

//  }
public double getVelocity()
{
return velocity;

}
public void changeVelocity(double newSpeed)
{

}
public findWindChill()
{
double windchill = 35.74 + 0.6215*t + (0.4275*t - 35.75) * Math.pow(v, 0.16);
return windchill;
}
private double temp;
private double velocity;
private double windchill;

}

}
********************************

package coldweathertester;
import javax.swing.JOptionPane;

public class ColdWeatherTester
{
public static void main(String[] args)
{
double temp = 5.0;
double velocity = 10.0;

ColdWeatherDay day = new ColdWeatherDay(temp, velocity);

System.out.println("Wind Speed: " + day.getVelocity());
System.out.println("Temp is: " + day.findWindChill());

//Add Code that prompts the user to enter a new wind speed
// and then changes the wind speed of the day to the value entered.

input = JOptionPane.showInputDialog("Enter in a new wind speed");
temp = Double.parseDouble(input);

System.out.println("Wind Speed: " + day.getVelocity());
System.out.println("Temp is: " + day.getfindWindChill);

}

}

0
Question by:ca1358
• 2

LVL 86

Accepted Solution

CEHJ earned 2000 total points
ID: 22865375
You need to plug the correct variable names into the formula - you've left the original symbols
0

Author Comment

ID: 22865480
Thank you for pointing that out.  I am finding this so much harder VB.  Just not getting the flow of these variables.
I will close this question, I have been at this 8 hours and since I am onlly going to be gettng 3 hours of sleep before I have to go to work.

I appreciated you time very much!!
0

LVL 86

Expert Comment

ID: 22887856
:-)
0

## Featured Post

Question has a verified solution.

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

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
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 will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
###### Suggested Courses
Course of the Month12 days, 22 hours left to enroll