Results 1 to 7 of 7
  1. #1
    DarkGranite is offline Member
    Join Date
    Jul 2009
    Posts
    3
    Rep Power
    0

    Unhappy I need some help with a Program

    I am new to java, and i am taking a class in school. the professor wants us to write a program but i have no idea what i am doing.

    Here is what is asked of me:

    Write i program called temperatures.java that would prompt users to enter five (5) integer temperature values into an array of five integers. The program would then display back
    a. all values entered
    b. the sum of all numbers
    c. and their average with two decimal points.

    The program should be written with the class Temperatures, that would have the following data members:

    int[] temperatures = new int[5];
    int total;
    double average;

    and the following methods:

    public void getData(), that would prompt users to enter 7 temperature values
    public void computeSum(), that would sum up all the values and store the result into the total variable
    public void computeAverage(), that would compute the average and store the result into the average variable
    public void displayData(), that would display all the values from the array, the total and the average

    Write a separate program with the main function, called TemperaturesTest.java,
    that would call the methods getData(), computeSum(), computeAverage(), and displayData() from the class program Temperatures.java.
    Put the program into an indefinite loop until a "n" is entered at the prompt "Continue?[y/n]".

    please i need the help. badly:confused::(

  2. #2
    angryboy's Avatar
    angryboy is offline Senior Member
    Join Date
    Jan 2009
    Posts
    742
    Rep Power
    6

    Default

    How is this "advanced" and what have you tired?
    How To Ask Questions The Smart Way
    USE CODE TAGS--> [CODE]...[/CODE]
    Get NotePad++ (free)

  3. #3
    DarkGranite is offline Member
    Join Date
    Jul 2009
    Posts
    3
    Rep Power
    0

    Default

    Because its too "advanced" for me right now. Java is pretty hard to those who arent computer savy

  4. #4
    dlorde is offline Senior Member
    Join Date
    Jun 2008
    Posts
    339
    Rep Power
    6

    Default

    So what have you got so far (post the code), and which part are you stuck on, or having trouble understanding?

  5. #5
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Location
    VA
    Posts
    1,323
    Rep Power
    6

    Default

    You posted this in the wrong section. angryboy is right, just because something is hard for you doesn't make it advanced. This is a beginner question which should be posted in the "New to Java" forum, hence the name. You'll have better luck getting someone to take you seriously there.

  6. #6
    CJSLMAN's Avatar
    CJSLMAN is offline Moderator
    Join Date
    Oct 2008
    Location
    Mexico
    Posts
    1,159
    Rep Power
    7

    Default Moving to "New to Java" sub forum

    Moving to the "New to Java" sub forum...

    CJSL
    Chris S.
    Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.

  7. #7
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Location
    VA
    Posts
    1,323
    Rep Power
    6

Similar Threads

  1. Execute A program from a Program!
    By Moncleared in forum Advanced Java
    Replies: 2
    Last Post: 02-22-2009, 04:17 PM
  2. Executing a program within a program
    By gibsonrocker800 in forum New To Java
    Replies: 5
    Last Post: 05-12-2008, 08:24 AM
  3. Replies: 0
    Last Post: 04-04-2008, 02:40 PM
  4. Replies: 0
    Last Post: 10-04-2007, 09:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •