Showing posts with label ISC 2017 practical question. Show all posts
Showing posts with label ISC 2017 practical question. Show all posts

Tuesday, November 19, 2019

ISC COMPUTER SCIENCE QUESTION PRACTICAL PAPER 2017| QUESTION NUMBER 2 | Follow on YOUTUBE for more |




import java.util.Scanner;
public class qstn_2
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter the number of participants");
int n = sc.nextInt();

if(n<3 || n>11)
{
System.out.println("INPUT SIZE OUT OF RANGE");
System.exit(0);
}

String a[][] = new String[n][5];
for(int i=0;i<n;i++)
{
System.out.println("Participants "+(i+1));
for(int j=0;j<5;j++)
{

a[i][j] = sc.next();

}

}
System.out.println("\nKey : ");
String answer[] = new String[5];
for(int i=0;i<5;i++)
{
answer[i] = sc.next();
}

int score[] = new int[5];
int count  = 0;
int insert = 0;
int max = 0;
for(int i=0;i<n;i++)
{
for(int j=0;j<5;j++)
{
if(a[i][j].equalsIgnoreCase(answer[j]))
{
count++;
}
}

if(max<count)
max = count;

score[insert++] = count;
count=0;


}
System.out.println();
for(int i = 0;i<n;i++)
{
System.out.println("Participants "+(i+1)+" = "+score[i]);
}

System.out.println("\nHighest Score :");

for(int i = 0;i<n;i++)
{
if(max==score[i])
System.out.println("Participant "+(i+1));

}
}
}

Thursday, November 7, 2019

ISC COMPUTER SCIENCE QUESTION PRACTICAL PAPER 2017| QUESTION NUMBER 3 | Follow on YOUTUBE for more |




import java.util.*;
public class qstn_3
{
public static void main(String[] args)
{
Scanner sc  = new Scanner(System.in);

//Taking user input
System.out.println("Enter the sentence");
String s = sc.nextLine();

//For lowercase characters
String low = "abcdefghijklmnopqrstuvwxyzabcdefghijklm";

//For Uppercase characters
String cap = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLM";

//Taking the length of input string
int length = s.length();

//To check for the boundary condition
if(length<4||length>99)
{
System.out.println("INVALID LENGTH");
System.exit(0);
}
//For the new word
String new_word = "";

for(int i=0;i<length;i++)
{
//Extracting
char c = s.charAt(i);

//Checking for the uppercase character
if(Character.isUpperCase(c))
{
//To get the position of the character
//so that you can encode it.
for(int j = 0;j<cap.length();j++)
{

char c1 = cap.charAt(j);

//To compare both the characters
//to check if they are equal
if(c==c1)
{

//Increasing the character by 13 position
char lower_case = cap.charAt(j+13);

//Storing the new character
new_word+=lower_case;//new_word = new_word+lower_case;
break;
}
}
}

//Checking for the lowercase character
else if(Character.isLowerCase(c))
{
//To get the position of the character
//so that you can encode it.
for(int j = 0;j<low.length();j++)
{
char c1 = low.charAt(j);

//To compare both the characters
//to check if they are equal
if(c==c1)
{

//Increasing the character by 13 position
char upper_case = low.charAt(j+13);

//Storing the new character
new_word+=upper_case;
break;
}
}
}

//For exclaimation mark character
else if(c=='!')
{
new_word+="?";
}

//For any other characters
else
{
new_word+=c;
}
}

//Result output
System.out.println("\nThe cipher text is:");
System.out.println(new_word);
}
}

ISC COMPUTER SCIENCE QUESTION PRACTICAL PAPER 2017| QUESTION NUMBER 1 | Follow on youtube for more |



import java.util.*;
public class qstn_1
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter the input ");
int n = sc.nextInt();
int n1 = n;
int count = 0;
if(n>1000)
{
System.out.println("INVALID INPUT");
System.exit(0);
}

if(n>=48)
{
int div = n/48;
n = n-div*48;
count = count + div;
}

if(n>=24)
{
int div = n/24;
n = n-div*24;
count = count + div;
}

if(n>=12)
{
int div = n/12;
n = n-div*12;
count = count + div;
}

if(n>=6)
{
int div = n/6;
n = n-div*6;
count = count + div;
}

System.out.println("Remaining boxes = "+n);
if(n!=0)
{
count++;
}
System.out.println("Total number of boxes = "+n1);
System.out.println("Total number of cartons =  "+count);

}
}

ICSE COMPUTER SCIENCE SPECIMEN PAPER | QUESTION 7 | PLEASE DO WATCH THE VIDEO

  import  java.util.*; class icse_specimen_1 {     public static void main(String[] args)     {         Scanner sc1 = new Scanner(System.in)...