Jump to content

Chinna JAVA or Programming problem, help needed


Recommended Posts

Posted

Hi maa frnd Masters in biology chestunnadu vademo edo java course teesukunnadu so ee problem solve chesi help cheyyandi (naadi emo pharmacy  program so naku no idea)



1+1/2+1/3+1/4+----------------1/n

write a program that compares the rsults of preceeding series computing from Left to Right and Right to Left with n=50000

Posted

[quote author=ramuremo link=topic=112387.msg1195033#msg1195033 date=1287886140]
Hi maa frnd Masters in biology chestunnadu vademo edo java course teesukunnadu so ee problem solve chesi help cheyyandi (naadi emo pharmacy  program so naku no idea)



1+1/2+1/3+1/4+----------------1/n

[b]write a program that compares the rsults of preceeding series computing from Left to Right and Right to Left with n=50000[/b]
[/quote]
idi koncham clear ga cheppu baa..naku ardham kaledu asalu problem statement..aa series result kanukkovaala..anthe naa..right to left and left to right enti..

Posted

ok naku kuda sarigga teliyadu hope this helps

Obtaining more accurate results: In computing the following series, you will obtain more results by computing from Right to Left rather than Left to Right. Idi question ki mundu ichindi bhaiyya hope this helps!!!!

Thank you

Posted

Mavaa...
Requiremnt konchem artham ayyetlu cheppu mavaa.... Tappakundaa try cheddam.
atleast give an example... input and out put or this calculation has to be automated....like that.

Posted

[quote author=ramuremo link=topic=112387.msg1195072#msg1195072 date=1287886737]
ok naku kuda sarigga teliyadu hope this helps

Obtaining more accurate results: In computing the following series, you will obtain more results by computing from Right to Left rather than Left to Right. Idi question ki mundu ichindi bhaiyya hope this helps!!!!

Thank you
[/quote]
Idi edo experiment kosam kabatti extremely accurate undali..daaniki coding lo entha change untado telidu kani..double precision vaadite accuracy perugutundi..jus put a loop with initial value as 50000 and loop backwards performing the calculation..idi mari obvious..idi neeku telisi unte already nannu thittukoku  F@!n F@!n

Posted

Idhi try cheyyi.


import java.io.IOException;
import java.util.Scanner;


public class MySeriesCalculater {

/**
* @param args
*/
public static void main(String[] args) throws IOException {

System.out.println("Enter N:");
Scanner ds = new Scanner(System.in);
int n = ds.nextInt();
double result = 0;

for(int i=1;i<=n;i++)
{
   
result+= (1.0)/i;
}

System.out.print("Result :"+result);



}

}

Posted

sorry maama requirement moththam choodaledhu ...kshaminchu
...let me try again

Posted

idhi  reverse calculation ... i mean from right to left. Here is the result

Left to Right  :  11.397003949278519
Right to Left  :  11.397003949278504

I hope this helps .........


import java.io.IOException;
import java.util.Scanner;


public class MySeriesCalculater {

/**
* @param args
*/
public static void main(String[] args) throws IOException {

System.out.println("Enter N:");
Scanner ds = new Scanner(System.in);
int n = ds.nextInt();
double result = 0;

for(int i=n;i>0;i--)
{
   
result+= (1.0)/i;
}

System.out.print("Result :"+result);



}

}

Posted

[quote author=Thota Raamudu link=topic=112387.msg1195180#msg1195180 date=1287889403]
idhi  reverse calculation ... i mean from right to left. Here is the result

Left to Right  :  11.397003949278519
Right to Left  :  11.397003949278504

I hope this helps .........


import java.io.IOException;
import java.util.Scanner;


public class MySeriesCalculater {

/**
* @param args
*/
public static void main(String[] args) throws IOException {

System.out.println("Enter N:");
Scanner ds = new Scanner(System.in);
int n = ds.nextInt();
double result = 0;

for(int i=n;i>0;i--)
{
   
result+= (1.0)/i;
}

System.out.print("Result :"+result);



}

}
[/quote]
Good job ! you rock you rock

Posted

[quote author=Thota Raamudu link=topic=112387.msg1195180#msg1195180 date=1287889403]
idhi  reverse calculation ... i mean from right to left. Here is the result

Left to Right  :  11.397003949278519
Right to Left  :  11.397003949278504

I hope this helps .........


import java.io.IOException;
import java.util.Scanner;


public class MySeriesCalculater {

/**
* @param args
*/
public static void main(String[] args) throws IOException {

System.out.println("Enter N:");
Scanner ds = new Scanner(System.in);
int n = ds.nextInt();
double result = 0;

for(int i=n;i>0;i--)
{
   
result+= (1.0)/i;
}

System.out.print("Result :"+result);



}

}
[/quote]

^^" ^^"      you rock you rock

×
×
  • Create New...