Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: URGENT: help with program (eclipse)

  1. #1
    Junior Member
    Join Date
    Apr 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation URGENT: help with program (eclipse)

    thermostat-sim.doc

    help? i got the vague idea but i cant put it as a program.
    URGENT

    My program so far

    import java.util.*;
    public class HanLee_Thermostat {

    public static void main(String[] args) {
    double temp=setTarget();
    double change=tempDrift();
    int val= setNumSimulations();
    double initial=temp;
    String status;
    }

    public static String display(double temp, double initial, double change, int val, String status){
    if(initial==temp){
    status="None";
    for(int i=0; i<=val; i++){
    System.out.println("-----------------------------");
    System.out.println( initial+ "degrees F");
    System.out.print("Currently running: " + status);
    System.out.println("-----------------------------");
    }
    }
    else{

    }

    }

    public static double setTarget(){
    Scanner key=new Scanner(System.in);
    System.out.print("Enter desired temperature: ");
    double temp=key.nextDouble();

    return temp;
    }

    public static int setNumSimulations(){
    Scanner key=new Scanner(System.in);
    System.out.print("Enter desired number of simulated intervals: ");
    int inter=key.nextInt();
    return inter;

    }

    public static double checkSystem(double tartemp){
    double curtemp= tartemp;

    }

    public static double tempDrift(){
    Random generator=new Random();
    double change=generator.nextDouble()*3;
    return change;
    }

    public void displaySummary(){
    System.out.print("Summary Data");
    System.out.print("--------------");

    }

    }


  2. #2
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: URGENT: help with program (eclipse)

    Hi nanairo and welcome to the forum.

    Please edit your post and wrap your code with code tags:
    [code=java]
    <YOUR CODE HERE>
    [/code]
    to get highlighting and preserve formatting.

    If you have a question please post it with your code and the full text of any error messages you may have.

Similar Threads

  1. Program to calculate pay and total sum with daily increment. Urgent!
    By ePerKar3 in forum What's Wrong With My Code?
    Replies: 11
    Last Post: December 5th, 2011, 01:20 PM
  2. Need urgent help regarding java word wrap function.. URGENT
    By coldice in forum What's Wrong With My Code?
    Replies: 3
    Last Post: August 16th, 2011, 05:43 AM
  3. In eclipse how do you get the runtime of your program?
    By beginnerprogrammer in forum Java Theory & Questions
    Replies: 5
    Last Post: May 22nd, 2011, 03:19 PM
  4. (URGENT) Plz help me with the black jack program.
    By diogo in forum What's Wrong With My Code?
    Replies: 2
    Last Post: April 4th, 2011, 04:08 AM
  5. Need a program using only for loop its urgent
    By pokuri in forum Object Oriented Programming
    Replies: 2
    Last Post: January 14th, 2011, 05:13 AM

Tags for this Thread