Solved

Learning Java ColdWeatherDay

Posted on 2008-11-03
3
388 Views
Last Modified: 2012-05-05
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
Comment
Question by:ca1358
  • 2
3 Comments
 
LVL 86

Accepted Solution

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

Author Comment

by:ca1358
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

by:CEHJ
ID: 22887856
:-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Java asynchronous logging 4 50
what is the difference between "sudo su" and "su - root" 6 104
Error with Java/Cache JDBC Classpath 2 30
Java - Why doesn't this JFrame work 3 41
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now