<< < Page 8 of 11 > >> |
From: shenron | Reply 141 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 21 |
four:42 four:4
Posted at: Sat Apr 10 13:33:41 2010 (GMT)
|
From: blendit07 | Reply 142 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 30 |
public class PalindromeCheck{
Posted at: Thu Jun 24 12:56:09 2010 (GMT)
|
From: blendit07 | Reply 143 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 30 |
// Palindrome Check
public class PalindromeCheck{
private String orig;
private String rev;
public PalindromeCheck(String orig){
this.orig=orig;
this.rev=null;
}
public void RunCheck(){
System.out.print('\f'); // Clears the
Screen
StringBuffer sb=new StringBuffer();
int len=orig.length()-1;
for(int i=len;i>=0;i--){ // Creates
the reverse of the 'orig' string
sb.append(orig.charAt(i));
}
rev=sb.toString();
if(orig.equalsIgnoreCase(rev)){
System.out.print(orig + " is a
Palindrome!");
}
else
System.out.print(orig + " is not a
Palindrome!");
}
public static void main(String args){
PalindromeCheck palin=new PalindromeCheck(args);
palin.RunCheck();
}
}
Posted at: Thu Jun 24 12:57:05 2010 (GMT)
|
From: sheetz26 | Reply 144 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 5 |
Example of if else if
<pre class="example">
#include <iostream>
using namespace std;
int main() // Most important part of the program!
{
int age; // Need a variable...
cout<<"Please input your age: "; // Asks for age
cin>> age; // The input is put in age
cin.ignore(); // Throw away enter
if ( age < 100 ) { // If the age is less than 100
cout<<"You are pretty young!\n"; // Just to show you it
works...
}
else if ( age == 100 ) { // I use else just to show an example
cout<<"You are old\n"; // Just to show you it
works...
}
else {
cout<<"You are really old\n"; // Executed if no other
statement is
}
cin.get();
}
</pre>
Posted at: Sat Jul 17 18:36:09 2010 (GMT)
|
From: jahnavivibha | Reply 145 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 1 |
object-oriented programming, process-oriented programming
Posted at: Sun Jul 18 03:33:43 2010 (GMT)
|
From: sheetal26 | Reply 146 of 205 | Reply | View replies (2)
|
Subject: Contributed Answer/Explanation to Q. 5 |
Example of the if-else-if construct
if (number > 0)
{
print "Number is a positive integer\n";
}
else if (number < 0)
{
print "Number is a negative integer\n";
}
else
{
print "Number is 0";
}
Posted at: Sun Jul 18 18:45:17 2010 (GMT)
|
From: sheetal26 | Reply 147 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 5 |
Example of the if-else-if construct
if (number > 0)
{
print "Number is a positive integer\n";
}
else if (number < 0)
{
print "Number is a negative integer\n";
}
else
{
print "Number is 0";
}
Posted at: Sun Jul 18 18:45:50 2010 (GMT)
|
From: sheetal26 | Reply 148 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 5 |
Example of the if-else-if construct
if (number > 0)
{
print "Number is a positive integer\n";
}
else if (number < 0)
{
print "Number is a negative integer\n";
}
else
{
print "Number is 0";
}
Posted at: Sun Jul 18 18:46:03 2010 (GMT)
|
From: xyz2 | Reply 149 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 4 |
P=22/7
Posted at: Mon Sep 6 08:55:32 2010 (GMT)
|
From: xyz2 | Reply 150 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 15 |
X$="275"
Posted at: Mon Sep 6 08:58:39 2010 (GMT)
|
From: krutika | Reply 151 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 8 |
it is an explicit coversion by using type casting operator in which the
destination file is smaller than the source file..
Posted at: Mon Oct 25 17:35:52 2010 (GMT)
|
From: krutika | Reply 152 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 19 |
it executes only one that too the main function
Posted at: Mon Oct 25 17:38:08 2010 (GMT)
|
From: krutika | Reply 153 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 23 |
-22
Posted at: Mon Oct 25 17:40:47 2010 (GMT)
|
From: krutika | Reply 154 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 25 |
program
class teacher
{
public void accept(sting name,address,long phone,srting subject,int
salary,double tax)
{
name=n;
address=a;
phone=p;
subject=sub;
salary=sal;
tax=t;
}
public void display
{
System.out.println("name"+n);
System.out.println("address"+a);
System.out.println("phone"+p);
System.out.println("subject"+sub);
System.out.println("salary"+sal);
System.out.println("tax"+t);
}
public void calculate
{
if(sal*12>175000)
tax=(0.05)*sal;
}}
Posted at: Mon Oct 25 17:53:38 2010 (GMT)
|
From: rohitguha | Reply 155 of 205 | Reply | View replies (1)
|
Subject: Contributed Answer/Explanation to Q. 2 |
madharchod
main aisa bol raha hoon kyun ki aaj kal inki sankhya badhti hi ja rahi hai
Posted at: Tue Nov 9 09:35:05 2010 (GMT)
|
From: manisha83 | Reply 156 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 26 |
jjshshhhhhhhhhhhhhhhhhhhhhhhh
Posted at: Fri Nov 19 13:14:28 2010 (GMT)
|
From: manisha83 | Reply 157 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 26 |
class series
Posted at: Fri Nov 19 13:15:21 2010 (GMT)
|
From: angibyangi | Reply 158 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 8 |
explicit type conversion is performed by the programer using (type)
operator.this process is known as type casting
Posted at: Thu Nov 25 05:01:45 2010 (GMT)
|
From: ezhilmathi | Reply 159 of 205 | Reply | |
Subject: Contributed Answer/Explanation to Q. 3 |
difference bt. binary and linear search:
1)Binary search can only be performed with a sorted array whereas linear
search can be done with both sorted and unsorted array.
2)Binary search is more efficient than linear search in case the element
to be searched is present at the end of the array.
Posted at: Wed Dec 1 16:53:40 2010 (GMT)
|
From: ezhilmathi | Reply 160 of 205 | Reply | View replies (1)
|
Subject: Contributed Answer/Explanation to Q. 4 |
the ans is:
float pie = 3.142
Posted at: Wed Dec 1 16:56:36 2010 (GMT)
|
<< < Page 8 of 11 > >> |