Results 1 to 10 of 10
Thread: program for a quadratic formula
 01302009, 01:55 AM #1Member
 Join Date
 Jan 2009
 Posts
 4
 Rep Power
 0
program for a quadratic formula
im suppose to write a program to compute the solutions for a quadratic formula, where a=4, b=30, and c=10. the perameters must be declared as ints
how do i do that? there's a specific code for if i want to square something, i think its Math....something something... but i dont remember. plz help!
 01302009, 02:13 AM #2
Math ...
Here's the link to the Math class and it's methods:
Math (Java Platform SE 6)
Luck,
CJSL
PS: I think you're looking for the sqrt() methodChris S.
Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.

What you need is the Java API. It will have all the info you need. Here's the API for the Math class:
Math (Java Platform SE 6)
And the "Master" API:
Overview (Java Platform SE 6)
Luck
 01302009, 04:28 AM #4
it much faster to use int sideA = a*a; then to use the Math class.
USE CODE TAGS> [CODE]...[/CODE]
Get NotePad++ (free)

 01302009, 05:12 AM #6there's a specific code for if i want to square something, i think its Math....something something...
you could actually cal for sqrt, but its a crazy math formular. better to use Math.sqrt() for that part...USE CODE TAGS> [CODE]...[/CODE]
Get NotePad++ (free)

 01302009, 12:43 PM #8
huh?
Angryboy... you on something? Let's see... I give a link to the Math class and tell the OP that the sqrt() is probably what is needed. How did you come to the conclusion that I was suggessting that the OP develop the sqrt() method? I think it would be obvious that I'm refering to the sqrt() method in the link to the Math class.
As for the a*a vs Math.pow(), yeah... that's sounds pretty logical...
CJSLChris S.
Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.
 01302009, 05:50 PM #9
 01302009, 06:06 PM #10
Similar Threads

Quadratic Equation
By jpnym15 in forum New To JavaReplies: 4Last Post: 11122008, 03:29 AM 
Quadratic GUI
By ryn21 in forum New To JavaReplies: 1Last Post: 10302008, 05:58 AM 
Formula on Maximum loan..
By esh21 in forum NetBeansReplies: 4Last Post: 08142008, 02:27 PM 
Help with quadratic equation in java
By paul in forum New To JavaReplies: 1Last Post: 07252007, 08:23 PM 
What is the formula?
By yuchuang in forum New To JavaReplies: 3Last Post: 04302007, 10:00 PM
Bookmarks