Results 1 to 4 of 4

Thread: Temperature progam in java

  1. #1
    Join Date
    Oct 2009
    Posts
    82

    Temperature progam in java

    Hi
    I am not a java student, but I am still trying to solve this problem. I am new to java, plz help me. I am trying to write a temperature class that will represent temperature in degrees in both Celsius and Fahrenheit. Floating-point number for the temperature and a charter for the scale. I am trying to write four constructors one for the number of degrees, one for the scale, one for the both degrees and scale and default constructor. I am trying to create three comparison methods, one to test whether both temperatures are equal, second to test whether one temperature is grater than another , and third to test whether one temperature is less than another. Try to help me plz.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Temperature progam in java

    Hi
    You have posted your entire assignment without showing what work you have done, without asking a specific question. By this way it is hard for any one to post a correct reply to you. Be specific with your question or just past the code so that it can be easy for others to understand the problem. First you try a code your self, if you do not succeed or you have any problems then post and specify the problem. Ok, this may be the problem because you may be new to forums. do not worry it happens with every one in the starting.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Re: Temperature progam in java

    Hi
    Even I am new to java, a have started learning now. By your post I have tried this code. Just check it out.
    Code:
    public class Tempreture();
    {
    	private char sc;
    	private char obssc;
    	private double tmpdg;
    	private double cel;
    	private double fh;
    
    	public Tempreture ()
    	{
    		sc = 'C';
    		obssc = 'F';
    		tmpdg = 0.0;
    		cel = 0.0;
    		fh =0.0;
    		
    	}
    	
    	public void readInputs()
    	{
    		System.out.println("Enter the sc of the degree: ");
    		System.out.println("Enter the value of the Tempreture: ");
    	}
    	
    	public void writeOutputs()
    	{
    		System.out.println("The Tempreture degree in" + sc + " is: " + tmpdg);
    		System.out.println("It equles in" + obssc + ": " + tmpdg);
    	}
    	
    	public Tempreture numberOfDegree()
    	{
    		return tmpdg;
    	} 
    		public Tempreture sc;
    		{
    			return sc;
    		}
    	
    	public static double Celsius()
    	{
    		double result = 0;
    		if (sc == 'C')
    			tmpdg = cel;
    			result = ((9(cel)/5)+32);
    			result = fh;
    			fh = tmpdg;
    			return result;
    	}
    	public static double Fahrenhiet()
    		if (sclae == 'F' )
    			tmpdg = fh;
    			cel = (5(fh - 32)/9);
    			cel = tmpdg; 
    				return cel;
        } 
    }

  4. #4
    Join Date
    Oct 2009
    Posts
    82

    Re: Temperature progam in java

    hi
    Thanks for you program. I will study it throughly and if any query will post back again. First I will try to solve the problem by myself if it is no solved then I will post my program again.

Similar Threads

  1. Replies: 4
    Last Post: 04-09-2013, 11:04 PM
  2. CPU temperature monitor not displaying core temperature
    By Dakshesha in forum Motherboard Processor & RAM
    Replies: 5
    Last Post: 10-04-2011, 10:37 AM
  3. Q9550 temperature issue? Suggest if the temperature of my rig fine or not?
    By gaurav0110 in forum Motherboard Processor & RAM
    Replies: 6
    Last Post: 10-04-2011, 01:07 AM
  4. Core Temperature vs processor Temperature
    By Phaedra in forum Motherboard Processor & RAM
    Replies: 5
    Last Post: 11-12-2010, 07:28 PM
  5. CPU temperature and Motherboard temperature
    By SidharthGore in forum XP Hardware
    Replies: 2
    Last Post: 04-03-2008, 06:37 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,722,481.29083 seconds with 17 queries