Ask a Question | Answer a Question! |
![](/img/l.gif)
Submitting your question...
ResFinder - Thousands of Practice Papers
Guys in eco app:
What is a repo rate?
Also can direct taxes be evaded or not? Because it mentions both in the textbook |
![](//pl.respaper.com/64/bharat2017.jpg) |
asked by Bharat Sai (bharat2017) 6 years ago |
1 |
Guys how was your economics paper today? |
![](//pl.respaper.com/64/beastspankarmy.jpg) |
asked by BeastSpankster (beastspankarmy) 6 years ago |
1 |
Ques1. What is the output of the following?
import java.util.*;
public class Test {
public static void main(String[] args)
{
int[] x = new int[3];
System.out.println("x[0] is " + x[0]);
}
} |
![](//pl.respaper.com/64/monstercat.jpg) |
asked by Abhinav Sharma (monstercat) 6 years ago |
4 |
+ 1 more questions by monstercat
Write a program to assign a full path and file name as given below.Using library functions,extract and output the file path,file name and file extension.
Where am I wrong?
import java.util.*;
class Ex
{
public static void main(String args[])
{
Scanner in = new Scanner(System.in);
System.out.println("Enter file name");
String s = "C:\Users\admin\Pictures\flower.jpg";
int m = s.lastIndexOf('.');
System.out.println(" Extension="+(s.substring(m+1));
int j = s.lastIndexOf('\');
System.out.println("Output path ="+s.substring(0,j+1);
System.out.println("File name="+(s.substring(j+1,m));
}
} |
![](//pl.respaper.com/64/monstercat.jpg) |
asked by Abhinav Sharma (monstercat) 6 years ago |
0 |
|
This is from the 2016 marking scheme...(Q7)
How has variable 'i' been used in the second method too? Isn't a local variable?
And couldn't we just have declared it before void SumSeries(int n, double x)???
import java.util.*;
class Q7 {
void SumSeries(int n, double x) {
double sum=0.0d;
int i;
for(i=1;i<=n;i++)
{ if (i%2==0 )
sum=sum-x/(double)i;
else
sum=sum+x/(double)i; }
System.out.println("sum="+sum); }
void SumSeries() {
int s=0, p=1;
for(int i=1;i<=20;i++) {
p=p*i;
s=s+p; }
System.out.println("sum="+s); }
public static void main(String args[]) {
Q7 obj=new Q7();
obj.SumSeries(5,2.0);
obj.SumSeries();
}}} |
![](//pl.respaper.com/64/gar_d02.jpg) |
asked by Gargie D'souza (gar_d02) 6 years ago |
2 |
If y = 10, what is the value of :
++y * (y++ + 5)
I think it should be 15 * 12 = 180 but I am getting 176 as the output.
Any reason why it does prefix before parentheses when parentheses are above prefix in precedence? |
![](//pl.respaper.com/64/rohang37.jpg) |
asked by Rohan Gupta (rohang37) 6 years ago |
2 |
WAP in java to accept any sentence and form a new sentence whose words are arranged in the lexicographical orde (dictionary order) using bubble sort technique. For ex, if the input show below
Input sentence: it's fun to learn computer program
Output sentence: computer fun its learn programming to |
![](//pl.respaper.com/64/nehalg.jpg) |
asked by Nehal G (nehalg) 6 years ago |
2 |
Who all are doing biology? |
![](//pl.respaper.com/64/scoregoodmarks.jpg) |
asked by Jacelyn (scoregoodmarks) 6 years ago |
3 |
what is the use of math.rint() please give an example also |
![](//pl.respaper.com/64/hemant83.jpg) |
asked by Hemant Dangi (hemant83) 6 years ago |
1 |
WAP to input a word and remove the consecutive repeated characters by replacing the sequence of repeated characters by its single occurance
Sample Input:Jaaaaaavvvvvvvvaaaaaaaaa
Sample Output:Java
Would this program be accepted?
import java.util.*;
public class Q8
{
static void main()
{
Scanner ob=new Scanner(System.in);
System.out.println("Input String:");
String s=ob.nextLine();
s=s+"*";
int i;int j;
for(i=0;i<s.length()-1;i++)
{
char ch=s.charAt(i);
if(ch==s.charAt(i+1))
continue;
else
System.out.print(s.charAt(i));
}
}
} |
![](//pl.respaper.com/64/siddhant94.jpg) |
asked by Siddhant Joshi (siddhant94) 6 years ago |
3 |