[VIEWED 7537
TIMES]
|
SAVE! for ease of future access.
|
|
|
jerrybhoot
Please log in to subscribe to jerrybhoot's postings.
Posted on 10-06-08 6:53
PM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
Guys can you help me write this program. Thanx in advance. I want to thank you again tech guy. jerrybhoot a Java application that prints the following table using the sqrt ( ) method in the Math class using a for loop to produce the output results. Number SquareRoot 0 0.0000 2 1.4142 4 2.0000 6 2.4495 8 2.8284 10 3.1623 12 3.4641 14 3.7417 16 4.0000 18 4.2426 20 4.4721
|
|
|
|
divdude
Please log in to subscribe to divdude's postings.
Posted on 10-06-08 7:09
PM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
Piggyback ride is not always a viable alternative. In other words if you cant be bothered to do that on your own dont bother with java or any form of programming.
|
|
|
rastrapati
Please log in to subscribe to rastrapati's postings.
Posted on 10-06-08 7:19
PM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
You seems to be very begineer in java. Try to research on internet before asking anyone for help. It's too simple problem. Anyway here's simple for loop that will generate table upto 100.
for(int i=0;i<100;i+=2){ System.out.println(i+"\t\t"+Math.sqrt(i)); }
|
|
|
rastrapati
Please log in to subscribe to rastrapati's postings.
Posted on 10-06-08 7:19
PM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
Last edited: 06-Oct-08 07:20 PM
|
|
|
khai_k_khai_k
Please log in to subscribe to khai_k_khai_k's postings.
Posted on 10-06-08 11:15
PM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
/* Use System.out.format to maintain the precision of the double value */ /* Try to read books like Core Java Vol 1, if u are a beginner. */ public class SquareRoot { public static void main(String[] args) { System.out.println("Number \t SquareRoot"); for (int i = 0; i <= 20; i = i + 2) { System.out.format("%d \t %1.4f \n", i, Math.sqrt(i)); } } } /* Output */ /* Number SquareRoot 0 0.0000 2 1.4142 4 2.0000 6 2.4495 8 2.8284 10 3.1623 12 3.4641 14 3.7417 16 4.0000 18 4.2426 20 4.4721 */
|
|
|
khai_k_khai_k
Please log in to subscribe to khai_k_khai_k's postings.
Posted on 10-06-08 11:16
PM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
/* Use System.out.format to maintain the precision of the double value */ /* Try to read books like Core Java Vol 1, if u are a beginner. */ public class SquareRoot { public static void main(String[] args) { System.out.println("Number \t SquareRoot"); for (int i = 0; i <= 20; i = i + 2) { System.out.format("%d \t %1.4f \n", i, Math.sqrt(i)); } } } /* Output */ /* Number SquareRoot 0 0.0000 2 1.4142 4 2.0000 6 2.4495 8 2.8284 10 3.1623 12 3.4641 14 3.7417 16 4.0000 18 4.2426 20 4.4721 */
|
|
|
yellow
Please log in to subscribe to yellow's postings.
Posted on 10-07-08 8:17
AM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
I hope Jerry bhoot has enough help with " khai k khai k" 's solution. Don't forget to remove the */ and /* Coz I know you are going to copy the whole damn thing and say it does not work. I agree with divdude, abt piggyback thing.
|
|
|
yellow
Please log in to subscribe to yellow's postings.
Posted on 10-07-08 8:19
AM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
I hope Jerry bhoot has enough help with " khai k khai k" 's solution. Don't forget to remove the */ and /* Coz I know you are going to copy the whole damn thing and say it does not work. I agree with divdude, abt piggyback thing.
|
|
|
yellow
Please log in to subscribe to yellow's postings.
Posted on 10-07-08 8:19
AM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
I hope Jerry bhoot has enough help with " khai k khai k" 's solution. Don't forget to remove the */ and /* Coz I know you are going to copy the whole damn thing and say it does not work. I agree with divdude, abt piggyback thing.
|
|
|
rawbee
Please log in to subscribe to rawbee's postings.
Posted on 10-07-08 8:34
AM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
i think its not a good way to post someone's school homework in sajha. this will discourage to student doing hardwrok. i dont meant to say dont help at all but instead to giving a whole program code, you guys can just post pseudocode for program or just give a concept.
thanks anyway. we are really great to have a programmers like you.
|
|
|
Rusty
Please log in to subscribe to Rusty's postings.
Posted on 10-07-08 3:35
PM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
I think the original author is vanished. I hope he has not dropped the Java class yet. Only suggestions I have to you is: READ THE BOOK AND LISTEN CLASS LECTURES CAREFULLY before you go out there, seeking for help.
First, recognize what you need to know to solve the excercise you're given. You already got the solution; however, if you look at your exercise carefully, you know that it needs some lessons on basic Java class syntax, different types of LOOP in Java, and use of math function library. Very simple! Not a rocket science. So, open your book and read it.
If you don't know fundamentals of programming language, then read the book again from the beginning. Know how a program is created, complied, and executed. Try to take advantage of debugger that comes with the editor you use. Don’t give up just because you get some discouraging comments from some people. Call it a quit only when your heart tells you to quit.
|
|