Results 1 to 7 of 7
Thread: I need some help with a Program
- 07-21-2009, 12:21 AM #1
Member
- Join Date
- Jul 2009
- Posts
- 3
- Rep Power
- 0
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::(
- 07-21-2009, 12:34 AM #2
How is this "advanced" and what have you tired?
How To Ask Questions The Smart WayUSE CODE TAGS--> [CODE]...[/CODE]
Get NotePad++ (free)
- 07-21-2009, 01:27 AM #3
Member
- Join Date
- Jul 2009
- Posts
- 3
- Rep Power
- 0
Because its too "advanced" for me right now. Java is pretty hard to those who arent computer savy
- 07-21-2009, 01:00 PM #4
Senior Member
- Join Date
- Jun 2008
- Posts
- 339
- Rep Power
- 5
So what have you got so far (post the code), and which part are you stuck on, or having trouble understanding?
- 07-26-2009, 05:04 PM #5
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.
- 07-29-2009, 03:19 AM #6
Moving to "New to Java" sub forum
Moving to the "New to Java" sub forum...
CJSLChris S.
Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.
- 07-29-2009, 03:43 AM #7
Similar Threads
-
Execute A program from a Program!
By Moncleared in forum Advanced JavaReplies: 2Last Post: 02-22-2009, 04:17 PM -
Executing a program within a program
By gibsonrocker800 in forum New To JavaReplies: 5Last Post: 05-12-2008, 08:24 AM -
How to execute an External Program through Java program
By Java Tip in forum java.ioReplies: 0Last Post: 04-04-2008, 02:40 PM -
How to execute an External Program through Java program
By JavaBean in forum Java TipReplies: 0Last Post: 10-04-2007, 09:33 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks