Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

I need some help with JAVA... Its not so hard to do it but im a noob a


  • Please log in to reply

#1
BloodyChuck

BloodyChuck

    New Member

  • Member
  • Pip
  • 5 posts
I need some help with this project.... Its easy to do Im sure, but im new at this ...

can somebody explain to me how to do this(or do it for me, and show me how you did it):

Write an application that reads four doubles as its input. The program then displays as its output the maximum integer of the four, the minimum integer of the four, and the average of the four doubles. (Hint: the Java method Math.max (resp., Math.min) will return the maximum (resp., minimum) of two doubles, e.g., Math.max(3.2, -4.0) computes 3.2 as its answer.)

Thanks sooo much

Edited by BloodyChuck, 13 February 2008 - 06:27 PM.

  • 0

Advertisements


#2
BloodyChuck

BloodyChuck

    New Member

  • Topic Starter
  • Member
  • Pip
  • 5 posts
BUMP/ anyone?
  • 0

#3
frantique

frantique

    Member 2k

  • Member
  • PipPipPipPipPip
  • 2,700 posts
This sounds very much like you are asking for help with homework. We do not help with homework. Google is a good place to start.

And for future reference, it is considered very rude to bump your thread after only 7 minutes of posting. We are all volunteers and there are many, many more people seeking help than there are staff and members generously giving their time to help.
  • 0

#4
ScHwErV

ScHwErV

    Member 5k

  • Retired Staff
  • 21,285 posts
  • MVP
Also, someone asking for help with a JAVA problem might think to post in the Software Development forum where people who specialize in different languages would generally reside.

Moved. If this turns out to be homework, it will be closed as Frantique says, we do not help with homework.
  • 0

#5
BloodyChuck

BloodyChuck

    New Member

  • Topic Starter
  • Member
  • Pip
  • 5 posts
This is not homework... I want to learn how to do this...

you can do this project with ecslipse classic..

you can find it at: java.sun.com
  • 0

#6
Ax238

Ax238

    Tech Staff

  • Technician
  • 1,323 posts
The only reference to the project I found was here. Where exactly did you find the project on sun's website?
  • 0

#7
BloodyChuck

BloodyChuck

    New Member

  • Topic Starter
  • Member
  • Pip
  • 5 posts
I got it there, but I dunno how to do that
  • 0

#8
Big Ant

Big Ant

    Member

  • Member
  • PipPip
  • 13 posts
In order to do this you will have to first get the input, two easy ways to do this are through system.in or using JOptionPane class, once you have the four doubles stored in variables you can calculate the average by adding up the four values and dividing by four. In order to calculate the max you will have to call Math.max on the first two numbers, store this in a temp. variable, do the same to the second two, and finally do the same for the two temp. values. You can do the same for the min. values. After this you display the values, again you can use the JOptionPane class or System.out to print to the console
  • 0

#9
BloodyChuck

BloodyChuck

    New Member

  • Topic Starter
  • Member
  • Pip
  • 5 posts
any possible way you can do this with screenshots for me...


PLEASE!
  • 0

#10
Ax238

Ax238

    Tech Staff

  • Technician
  • 1,323 posts
Hi BloodyChuck,

If you really want to learn how program in Java, you'll need the ability to write your own code. Big Ant has given you a great start, including the exact methods that you will need to use to accomplish the tasks outlined in the exercise. If these things seem unfamiliar to you, you are starting out with a project that is too advanced.

Might I suggest taking some tutorials to familiarize yourself with the concepts of the Java programming language? It's best to understand the concepts before attempting to master anything. A good workman usually tries to get to know his tools before attempting to use them.

Regards,

Ax
  • 0

#11
coyne20

coyne20

    Member

  • Member
  • PipPip
  • 35 posts
I wont do your homework for you but heres a hint. Create a loop that runs four time. Each time, it should prompt the user to enter a value while working out the largest of the 2 numbers (you would need to initialise a default number to start off with). At the end it should display the largest number of the four.
  • 0

#12
W-Unit

W-Unit

    Member

  • Member
  • PipPipPip
  • 170 posts
I personally would avoid use of the Math.max method since it only accepts two inputs, and instead would just compare the number to the greatest number so far using the > operator. If it's greater than the current "greatest number" (have a variable store this), then store this new number as the greatest number.
Use a for loop that iterates 4 times to accomplish this.
I believe that console input is most easily accomplished by use of the java.util.Scanner class.
  • 0

#13
NeonFx

NeonFx

    Malware Removal Dude

  • Expert
  • 3,797 posts
Reading the assigned material will probably help as well:

http://people.cis.ks...schmidt/CIS200/
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP