Final Board Papers Solutions 2005-2019
Final Board Papers Solutions 2005-2019
Final Board Papers Solutions 2005-2019
int l = s.length();
System.out.println("No of characters = " + l);
int i, cnt = 0;
String rev ="";
for(i = l-1; i >= 0; i--)
{
char ch = s.charAt(i);
rev = rev + ch;
switch(ch)
{
case 'A':
case 'a':
case 'E':
case 'e':
case 'I':
case 'i':
case 'O':
case 'o':
case 'U':
case 'u':
cnt++;
}
}
System.out.println("No of vowels is " + cnt);
System.out.println("Reverse is " + rev);
}
}
ns = "";
}
else
ns = ns + ch;
}
}
}
void compute()
{
if(days<=5)
charge=days*500;
else if(days<=10)
charge=(5*500)+(days-5)*400;
else
charge=(5*500)+(5*400)+(days-10)*200;
}
void display()
{
System.out.println("Bike No. \t Phone No. \t Name \t No.of days \t Charge");
System.out.println(bno +"\t"+phno+"\t"+name+"\t"+days+"\t"+charge);
}
if(a>b)
big=a;
else
big=b;
for(int i=0;i<l-1;i++)
{
char c = s.charAt(i);
char d = s.charAt(i+1);
if(c==d)
cnt++;
}
System.out.println("Number of double letter sequences:"+cnt);
}
}
class Q5b
{
public static void main(String args[])
{
int i,j,k;
for(i=1;i<=5;i++)
{
for(j=5;j>=i;j--)
{
System.out.print(j);
}
System.out.println();
}
}
}
int i,flag = 0;
for(i=0;i<7;i++)
{
if(value.equalsIgnoreCase(country[i]))
{
System.out.println("Country = " + country[i]);
System.out.println("Wonder = " + wonder[i]);
flag = 1;
break;
}
}
if(flag == 0)
System.out.println("Sorry not found");
}
}
}
}
}
{
System.out.println("Name of the customer: "+name);
System.out.println("Mobile number : "+mobno);
System.out.println("Amount to be paid after discount: "+amount);
}
public static void main(String [] args)
{
ShowRoom obj = new ShowRoom();
obj.input();
obj.calculate();
obj.display();
}
}
System.out.println();
}
break;
default:
System.out.println("Invalid choice");
}
}
}
{
public static void main(String[]args)
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter a sentence: ");
String s=sc.nextLine();
s=s.toUpperCase();
int i, cnt=0;
for(i=0;i<s.length();i++)
{
char ch = s.charAt(i);
if(i==0 && ch == 'A')
cnt++;
else
if(Character.isWhitespace(ch) && s.charAt(i+1)=='A')
cnt++;
}
System.out.println("Total number of words Starting with letter 'A'= "+cnt);
}
}