Computer Science, asked by sam947, 1 year ago

is my program correct syntax wise... Please help fast

Attachments:

Answers

Answered by Anonymous
0
no little different at last 5 line... (ignore my grammatical mistake because I have ignored that in your question also) hope it helps plzz... comment on it, follow me if you wish or mark it brainlest if you want free 3 points....

sam947: I don't really see your argument... ignore my grammatical mistakes cause you have ignored mine... + I can't even understand your answer... mind if you elaborate a bit
Chakshul1o1: Hey! There is a mistake,that you have to initialize variable sum to 0.0 not 0 as it is a double variable
sam947: does it matter... double can store int.. can't it?
sam947: oh ok then
Answered by UnknownDude
3
I recommend using an object in the main method.
So new syntax would be
public static void main(String args[])
{
program obj=new program();
double x=obj.series(5.0);
double y=obj.series(4.0,7.0);
System.out.print(x);
System.out.print(y);
}
Similar questions