Tuesday, February 13, 2018

2018 ISC Computer Practical Paper With Solutions



Question 1


A Goldbach number is a positive even integer that can be expressed as the sum of two odd primes.
Note: All even integer numbers greater than 4 are Goldbach numbers. Example: 6 = 3 + 3
10 = 3 + 7
10 = 5 + 5
Hence, 6 has one odd prime pair 3 and 3. Similarly, 10 has two odd prime pairs, i.e. 3 and 7, 5 and 5.
Write a program to accept an even integer ‘N’ where N > 9 and N < 50. Find all the odd prime pairs whose sum is equal to the number ‘N’.
Test your program with the following data and some random data: Example 1:
INPUT: N = 14
OUTPUT: PRIME PAIRS ARE:
3, 11
7, 7
Example 2: INPUT: N = 30
OUTPUT: PRIME PAIRS ARE
7, 23
11, 19
13, 17
Example 3: INPUT: N = 17
OUTPUT: INVALID INPUT. NUMBER IS ODD.
Example 4: INPUT: N = 126
OUTPUT: INVALID INPUT. NUMBER OUT OF RANGE.


For Solution: CLICK HERE

Question 2

Write a program to declare a matrix A[ ] [ ] of order (M xN) where ‘M’ is the number of rows and ‘N’ is the number of columns such that the values of both ‘M’ and ‘N’ must be greater than 2 and less than 10. Allow the user to input integers into this matrix. Perform the following tasks on the matrix:
(a) Display the original matrix.
(b) Sort each row of the matrix in ascending order using any standard sorting technique.
(c) Display the changed matrix after sorting each row. Test your program for the following data and some random data: Example 1:
INPUT:
M = 4
N = 3


Example 2:
INPUT:
M = 3
N =3

Example 3:

INPUT:
M = 11
N = 5
OUTPUT:
MATRIX SIZE OUT OF RANGE




For Solution: CLICK HERE

Question 3



The names of the teams participating in a competition should be displayed on a banner vertically, to accommodate as many teams as possible in a single banner. Design a program to accept the names of N teams, where 2 < N < 9 and display them in vertical order, side by side with a horizontal tab (i.e. eight spaces).
Test your program for the following data and some random data:
Example 1:
INPUT: N = 3
Team 1: Emus
Team 2: Road Rols
Team 3: Coyote
OUTPUT:

E    R    C
m    o     o
u    a      y
s     d     o
              t
       R     e
       o
        I
        s     
For Solution: CLICK HERE

For the complete solution along with variable description and algorithm: CLICK HERE

2010 To 2018 Complete 9 Years Papers With Solutions: CLICK HERE

1 comment:

  1. //alternative of ques 3//
    import java.util.*;
    class q32018
    {
    String a[];char m[][];int n; int ma=0;
    void input()
    {
    Scanner sc =new Scanner(System.in);
    System.out.println(" enter no of teams");
    n=sc.nextInt();
    a=new String [n+1];
    System.out.println(" enter " +(n)+ " team names");
    for (int i=0;i<n+1;i++)
    {
    a[i]=sc.nextLine();
    }
    }
    void arr()
    {

    for (int k=0;k<n+1;k++)
    {
    String s=a[k];
    int l=s.length();
    if(ma<l)
    {
    ma=l;
    }
    }m=new char [ma][n+1];
    for(int i=0;i<n+1;i++)
    {int r=0; String st=a[i];
    for(int j=0 ;j<st.length();j++)
    {
    char ch=st.charAt(j);
    m[r][i]=ch;
    r++;
    }
    }
    }
    void display()
    {
    for(int i=0 ;i<ma;i++)
    {
    for(int j=0 ;j<n+1;j++)
    {
    System.out.print(m[i][j]+" " +" " + " " );
    }System.out.println();
    }
    }
    public static void main()
    {
    q32018 obj=new q32018();
    obj.input();
    obj.arr();
    obj.display();
    }
    }

    ReplyDelete

Subscribe via email

Enter your email address:

Delivered by FeedBurner