<< < Page 3 of 11 > >> |
From: mylife12 | Reply 41 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 7 |
we need constructors as a class member because
Posted at: Fri Jan 22 16:59:16 2010 (GMT)
|
From: mylife12 | Reply 42 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 7 |
we need constructors as a class member because
ami bhalo achi
Posted at: Fri Jan 22 17:00:37 2010 (GMT)
|
From: anibunnysai | Reply 43 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 11 |
import java.lang.*;
Posted at: Sun Jan 24 06:50:21 2010 (GMT)
|
From: anibunnysai | Reply 44 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 13 |
(0.05-(2*Math.pow(y,3)))/(x-y)
Posted at: Sun Jan 24 06:52:45 2010 (GMT)
|
From: anibunnysai | Reply 45 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 17 |
total+=a;
Posted at: Sun Jan 24 06:54:44 2010 (GMT)
|
From: anibunnysai | Reply 46 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 26 |
hope it is correct
public class hj<br />
{<br />
int n;<br />
hj(int nb)<br />
{<br />
n=nb;<br />
}<br />
public void print()<br />
{<br />
int a,b,q=1;double s=0,e=1,d=0;<br />
for(b=1;b<=n;b++)<br />
{<br />
for(a=2;a<=b+1;a++)<br />
{<br />
s+=q;<br />
e*=q; <br />
}<br />
d+=s/e;<br />
q=1;<br />
}<br />
System.out.println("the sum of the following series
="+d);<br />
<br />
}<br />
<br />
}
Posted at: Sun Jan 24 07:53:38 2010 (GMT)
|
From: prachimundada8 | Reply 47 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 26 |
import java.io.*;
<p>
import java.io.*;
</p>
<p>
class series
</p>
<p>
{
</p>
<p>
public void display()throws IOException
</p>
<p>
{
</p>
<p>
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
</p>
<p>
double s=0,p=1,sum=0;
</p>
<p>
System.out.println(" ENTER THE VALUE OF n:");
</p>
<p>
int n=Integer.parseInt(x);
</p>
<p>
for(int i=1;i<=n;i++)
</p>
<p>
{
</p>
<p>
for(int j=1;j<=i;j++)
</p>
<p>
{
</p>
<p>
s=s+j;
</p>
<p>
p=p*j;
</p>
<p>
}
</p>
<p>
sum=sum+s/p;
</p>
<p>
}
</p>
<p>
System.out.println("THE SUM OF SERIES ="+ sum);
</p>
<p>
}
</p>
<p>
}
</p>
Posted at: Sun Jan 24 11:02:24 2010 (GMT)
|
From: dj_glitzzz | Reply 48 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 20 |
polymorphism
Posted at: Thu Jan 28 14:55:12 2010 (GMT)
|
From: dj_glitzzz | Reply 49 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 18 |
void is used when the function does not return any argument
Posted at: Thu Jan 28 14:56:08 2010 (GMT)
|
From: alokrajiv | Reply 50 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 25 |
Program
import java.io.*;
class salary
{
static String name,address,subject;
static int phone,salary;
static double tax;
public static void main(String[] args)throws IOException
{
accept();
calculate();
display();
}
public static void accept()throws IOException
{
InputStreamReader isr=new InputStreamReader(System.in);
BufferedReader br=new BufferedReader(isr);
System.out.println("Enter name :");
name=br.readLine();
System.out.println("Enter address :");
address=br.readLine();
System.out.println("Enter subject :");
subject=br.readLine();
System.out.println("Enter phone :");
phone=Integer.parseInt(br.readLine());
System.out.println("Enter salary :");
salary=Integer.parseInt(br.readLine());
}
public static void display()
{
System.out.println("Name :");
System.out.println("Address :");
System.out.println("Subject specialization :");
System.out.println("Phone no. :");
System.out.println("Salary :");
System.out.println("Income Tax :");
}
public static void calculate()
{
if(salary*12>175000)
tax=(0.05)*salary;
}
}
Posted at: Fri Jan 29 12:33:05 2010 (GMT)
|
From: prabhat008kumar | Reply 51 of 205 | Reply | View replies (3)
|
Subject: Contributed Answer/Explanation to Q. 28 |
My answer is below
<p>
import java.io.* ;
</p>
<p>
class Search
</p>
<p>
{
</p>
<p>
public static void main(String args[])throws IOException
</p>
<p>
{
</p>
<p>
InputStreamReader isr=new InputStreamReader(System.in());
</p>
<p>
BufferedReader br =new BufferedReader(isr);
</p>
<p>
System.out.println("Enter your sentence");
</p>
<p>
String s=br.readine();
</p>
<p>
System.out.println("Enter a word to be searched");
</p>
<p>
String a=br.readLine();
</p>
<p>
s=s.trim();
</p>
<p>
s=s+" ";
</p>
<p>
a=a.trim();
</p>
<p>
int i=0,p=0,c=0;
</p>
<p>
char ch; String word =null;
</p>
<p>
</p>
<p>
</p>
<p>
for(i=0i<s.length();i++)
</p>
<p>
{
</p>
<p>
ch=s.charAt(i);
</p>
<p>
if(ch= = ' ' )
</p>
<p>
{
</p>
<p>
word=s.substring(p,i);
</p>
<p>
if(word.compareToIgnoreCase(a)= =0)
</p>
<p>
c++;
</p>
<p>
p=i+1;
</p>
<p>
}
</p>
<p>
}
</p>
<p>
System.out.println(a+" has occured "+c+" times");
</p>
<p>
}
</p>
<p>
} <br />
</p>
Posted at: Wed Feb 3 04:42:40 2010 (GMT)
|
From: prabhat008kumar | Reply 52 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 28 |
My answer is below
<p>
import java.io.* ;
</p>
<p>
class Search
</p>
<p>
{
</p>
<p>
public static void main(String args[])throws IOException
</p>
<p>
{
</p>
<p>
InputStreamReader isr=new InputStreamReader(System.in());
</p>
<p>
BufferedReader br =new BufferedReader(isr);
</p>
<p>
System.out.println("Enter your sentence");
</p>
<p>
String s=br.readine();
</p>
<p>
System.out.println("Enter a word to be searched");
</p>
<p>
String a=br.readLine();
</p>
<p>
s=s.trim();
</p>
<p>
s=s+" ";
</p>
<p>
a=a.trim();
</p>
<p>
int i=0,p=0,c=0;
</p>
<p>
char ch; String word =null;
</p>
<p>
</p>
<p>
</p>
<p>
for(i=0;i<s.length();i++)
</p>
<p>
{
</p>
<p>
ch=s.charAt(i);
</p>
<p>
if(ch= = ' ' )
</p>
<p>
{
</p>
<p>
word=s.substring(p,i);
</p>
<p>
if(word.compareToIgnoreCase(a)= =0)
</p>
<p>
c++;
</p>
<p>
p=i+1;
</p>
<p>
}
</p>
<p>
}
</p>
<p>
System.out.println(a+" has occured "+c+" times");
</p>
<p>
}
</p>
<p>
} <br />
</p>
Posted at: Wed Feb 3 04:44:45 2010 (GMT)
|
From: prabhat008kumar | Reply 53 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 28 |
My answer is below
<p>
import java.io.* ;
</p>
<p>
class Search
</p>
<p>
{
</p>
<p>
public static void main(String args[])throws IOException
</p>
<p>
{
</p>
<p>
InputStreamReader isr=new InputStreamReader(System.in());
</p>
<p>
BufferedReader br =new BufferedReader(isr);
</p>
<p>
System.out.println("Enter your sentence");
</p>
<p>
String s=br.readine();
</p>
<p>
System.out.println("Enter a word to be searched");
</p>
<p>
String a=br.readLine();
</p>
<p>
s=s.trim();
</p>
<p>
s=s+" ";
</p>
<p>
a=a.trim();
</p>
<p>
int i=0,p=0,c=0;
</p>
<p>
char ch; String word =null;
</p>
<p>
for(i=0;i <s.length();i++)
</p>
<p>
{
</p>
<p>
ch=s.charAt(i);
</p>
<p>
if(ch= = ' ' )
</p>
<p>
{
</p>
<p>
word=s.substring(p,i);
</p>
<p>
if(word.compareToIgnoreCase(a)= =0)
</p>
<p>
c++;
</p>
<p>
p=i+1;
</p>
<p>
}
</p>
<p>
}
</p>
<p>
System.out.println(a+" has occured "+c+" times");
</p>
<p>
}
</p>
<p>
} <br />
</p>
Posted at: Wed Feb 3 04:47:54 2010 (GMT)
|
From: prabhat008kumar | Reply 54 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 28 |
My answer is below
<p>
import java.io.* ;
</p>
<p>
class Search
</p>
<p>
{
</p>
<p>
public static void main(String args[])throws IOException
</p>
<p>
{
</p>
<p>
InputStreamReader isr=new InputStreamReader(System.in());
</p>
<p>
BufferedReader br =new BufferedReader(isr);
</p>
<p>
System.out.println("Enter your sentence");
</p>
<p>
String s=br.readine();
</p>
<p>
System.out.println("Enter a word to be searched");
</p>
<p>
String a=br.readLine();
</p>
<p>
s=s.trim();
</p>
<p>
s=s+" ";
</p>
<p>
a=a.trim();
</p>
<p>
int i=0,p=0,c=0;
</p>
<p>
char ch; String word =null;
</p>
<p>
for(i=0;i < s.length();i++)
</p>
<p>
{
</p>
<p>
ch=s.charAt(i);
</p>
<p>
if(ch= = ' ' )
</p>
<p>
{
</p>
<p>
word=s.substring(p,i);
</p>
<p>
if(word.compareToIgnoreCase(a)= =0)
</p>
<p>
c++;
</p>
<p>
p=i+1;
</p>
<p>
}
</p>
<p>
}
</p>
<p>
System.out.println(a+" has occured "+c+" times");
</p>
<p>
}
</p>
<p>
} <br />
</p>
Posted at: Wed Feb 3 04:52:37 2010 (GMT)
|
From: sneha1991 | Reply 55 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 11 |
Math class.Example: Math.pow(x,y)
Posted at: Tue Feb 9 16:29:05 2010 (GMT)
|
From: sneha1991 | Reply 56 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 12 |
= is an assignment operator whereas == is a relational operator
= is used for the purpose of assigning value(s).But we use == for checking
purposes.
For instance,a=5 //this means 5 is assigned to a variable 'a'.
a==5 //this means we are checking whether 5 is stored in 'a' or not.
Posted at: Tue Feb 9 16:35:47 2010 (GMT)
|
From: preetie | Reply 57 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 6 |
DIFF!
FORMAL PARAMETERS ARE FOUND IN THE FUNCTION DEFINITION WHERAS ACTUAL
PARAMETERS ARE FOUND IN THE FUNCTION CALL STATEMENT
Posted at: Fri Feb 12 07:58:37 2010 (GMT)
|
From: preetie | Reply 58 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 11 |
MATH CLASS
E.G . MATH.SQRT
Posted at: Fri Feb 12 07:59:44 2010 (GMT)
|
From: preetie | Reply 59 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 12 |
DIFF
= OPERATOR IS USED FOR THE PURPOSE OF INITIALIZATION
WHEREAS = = OPERATOR IS USED IN CONDITION CHECK STATEMENTS LIKE IF ND
IF-ELSE ETC
Posted at: Fri Feb 12 08:01:26 2010 (GMT)
|
From: preetie | Reply 60 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 13 |
ans
DOUBLE A; int x, y;
A = .05-(2*(Math.pow(y,3))/(x-y))
Posted at: Fri Feb 12 08:04:08 2010 (GMT)
|
<< < Page 3 of 11 > >> |