Navbar

Saturday, 6 April 2019

ISC COMPUTER PRACTICAL 2013 SOLVED

ISC COMPUTER PRACTICAL 2013 SOLVED

Question 1:

An ISBN (International Standard Book Number) is a ten digit code which uniquely identifies a book.

The first nine digits represent the Group, Publisher and Title of the book and the last digit is used to check whether ISBN is correct or not.

Each of the first nine digits of the code can take a value between 0 and 9. Sometimes it is necessary to make the last digit equal to ten; this is done by writing the last digit of the code as X.

To verify an ISBN, calculate 10 times the first digit, plus 9 times the second digit, plus 8 times the third and so on until we add 1 time the last digit. If the final number leaves no remainder when divided by 11, the code is a valid ISBN.

For Example:

1. 0201103311 = 10*0 + 9*2 + 8*0 + 7*1 + 6*1 + 5*0 + 4*3 + 3*3 + 2*1 + 1*1 = 55

Since 55 leaves no remainder when divided by 11, hence it is a valid ISBN.

2. 007462542X = 10*0 + 9*0 + 8*7 + 7*4 + 6*6 + 5*2 + 4*5 + 3*4 + 2*2 + 1*10 = 176

Since 176 leaves no remainder when divided by 11, hence it is a valid ISBN.

3. 0112112425 = 10*0 + 9*1 + 8*1 + 7*2 + 6*1 + 5*1 + 4*1 + 3*4 + 2*2 + 1*5 = 71

Since 71 leaves no remainder when divided by 11, hence it is not a valid ISBN.

Design a program to accept a ten digit code from the user. For an invalid input, display an appropriate message. Verify the code for its validity in the format specified below:

Test your program with the sample data and some random data:

Example 1

INPUT CODE: 0201530821

OUTPUT : SUM = 99
LEAVES NO REMAINDER – VALID ISBN CODE

Example 2

INPUT CODE: 035680324

OUTPUT : INVALID INPUT

Example 3

INPUT CODE: 0231428031

OUTPUT : SUM = 122
LEAVES REMAINDER – INVALID ISBN CODE

Solution:

import java.util.*;
class ISBN
{
    public static void main(String args[])
    {
       Scanner sc=new Scanner(System.in);
        System.out.print("Enter a 10 digit code : ");
        String s=sc.nextLine();
        int l=s.length();
        if(l!=10)
            System.out.println("Output : Invalid Input");
        else
        {
            String ch;
            int a=0, sum=0, k=10;
            for(int i=0; i<l; i++)
            {
                ch=Character.toString(s.charAt(i));
                if(ch.equalsIgnoreCase("X"))
                    a=10;
                else
                    a=Integer.parseInt(ch);
                sum=sum+a*k;
                k--;
            }
            System.out.println("Output : Sum = "+sum);
            if(sum%11==0)
                System.out.println("Leaves No Remainder - Valid ISBN Code");
            else
                System.out.println("Leaves Remainder - Invalid ISBN Code");
        }
    }
}
--------------------------end---------------------------

Question 2:

Write a program to declare a square matrix A[ ] [ ] of order (M x M) where ‘M’ is the number of rows and the number of columns such that M must be greater than 2 and less than 20. Allow  the user to input integers into this matrix. Display appropriate error message for an invalid input. Perform the following tasks:

(a) Display the input matrix.
(b) Create a mirror image matrix.
(c) Display the mirror image matrix.

Test your program with the sample data and some random data:

Example 1

INPUT : M = 3
4       16      12
8        2       14
4        1        3

OUTPUT :

ORIGINAL MATRIX

4       16       12
8         2       14
4         1        3

MIRROR IMAGE MATRIX

12      16      4
14       2      8
3         1      4

Example 2

INPUT : M = 22

OUTPUT : SIZE OUT OF RANGE

Solution :

import java.util.*;
class mirror
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter the size of the square matrix :");
int m=sc.nextInt();
if(m<2||m>20)
{
System.out.println("SIZE OUT OF RANGE");
}
else
{
int b[][]=new int[m][m];
int a[][]=new int[m][m];
for(int i=0;i<m;i++)
{
for(int j=0;j<m;j++)
{
a[i][j]=sc.nextInt();
}
}
for(int i=0;i<m;i++)
{ int k=2;
for(int j=0;j<m;j++)
{
b[i][j]=a[i][k];
k--;
}
}
System.out.println("ORIGINAL MATRIX");
for(int i=0;i<m;i++)
{
for(int j=0;j<m;j++)
{
System.out.print(a[i][j]+" ");
}
System.out.println();
}
System.out.println("MIRRIOR IMAGE");
for(int i=0;i<m;i++)
{
for(int j=0;j<m;j++)
{
System.out.print(b[i][j]+" ");
}
System.out.println();
}
}
}
}

Output:
Enter the size of the square matrix : 4
Enter the elements of the Matrix:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
*********************
The original matrix:
*********************
1        2      3      4
5        6      7      8
9     10     11     12
13   14     15     16
*********************
The Mirror Image:
*********************
4       3       2      1
8       7       6      5
12   11      10     9
16   15      14    13

-----------------------------end---------------------

Question 3:

A Palindrome is a word that may be read the same way in either direction.

Accept a sentence in UPPER CASE which is terminated by either ” . “, ” ? ” or ” ! “.

Each word of the sentence is separated by a single blank space.

Perform the following tasks:

(a) Display the count of palindromic words in the sentence.
(b) Display the Palindromic words in the sentence.

Example of palindromic words: MADAM, ARORA, NOON

Test your program with the sample data and some random data:

Example 1

INPUT : MOM AND DAD ARE COMING AT NOON.

OUTPUT : MOM DAD NOON
NUMBER OF PALINDROMIC WORDS : 3

Example 2

INPUT : NITIN ARORA USES LIRIL SOAP.

OUTPUT : NITIN ARORA LIRIL
NUMBER OF PALINDROMIC WORDS : 3

Example 3

INPUT : HOW ARE YOU?

OUTPUT : NO PALINDROMIC WORDS

Solution :

import java.util.*;
class Palindrom
{
static BufferedReader br=new BufferedReader (new InputStreamReader (System.in)); 
boolean isPalin(String s)
{
int l=s.length();
String rev=””;
for(int i=l-1; i>=0; i–)
{
rev=rev+s.charAt(i);
}
if(rev.equals(s))
return true;
else
return
false;
}
public static void main(String args[])throws IOException
{
Palindrom ob=new Palindrom();
System.out.print(“Enter any sentence : “);
String s=br.readLine();
s=s.toUpperCase();
StringTokenizer str = new StringTokenizer(s,”.?! “);
int w=str.countTokens();
String word[]=new String[w];
}
}
}

Output:
1. Enter any sentence : MOM AND DAD ARE COMING AT NOON.
OUTPUT : MOM DAD NOON
Number of Palindromic Words : 3

2. Enter any sentence : HOW ARE YOU?
OUTPUT : No Palindrome Words
---------------------end-------------------------

3 comments:

  1. This way my pal Wesley Virgin's autobiography begins with this shocking and controversial VIDEO.

    As a matter of fact, Wesley was in the army-and soon after leaving-he discovered hidden, "self mind control" secrets that the government and others used to get whatever they want.

    As it turns out, these are the same tactics lots of celebrities (notably those who "became famous out of nowhere") and top business people used to become rich and famous.

    You probably know that you utilize only 10% of your brain.

    Mostly, that's because the majority of your BRAINPOWER is UNTAPPED.

    Perhaps this conversation has even taken place IN YOUR very own mind... as it did in my good friend Wesley Virgin's mind seven years back, while riding an unlicensed, trash bucket of a car with a suspended driver's license and in his pocket.

    "I'm absolutely frustrated with living check to check! When will I become successful?"

    You've taken part in those questions, am I right?

    Your success story is waiting to happen. You just need to take a leap of faith in YOURSELF.

    UNLOCK YOUR SECRET BRAINPOWER

    ReplyDelete
  2. (NO MEMBERSHIP FEE TO JOIN ILLUMINATI), I am giving a testimony on how i became rich and famous today… i was deeply strangled up by poverty and i had no body to help me, and also i searched for help from different corners but to no avail… I see people around me getting rich but to me i was so ashamed of my self so i met a man on my way he was very rich and he was a doctor so he told me something and i thought over it through out the day so the next day i looked up and i keep repeating what he said to me.” if you want to get rich quick and be famous” you need to cross your heart and do what is in your mind so i tried all i could in other for me to do as he said so later on i told my fellow friend about this same thing then my friend was interested in my suggestions so i decided to look in the internet and i found an email of an agent Jackson illuminatiriches50085@gmail.com and we decided to contact them and fortunately we did as they instructed us to do and later, they told us to get some requirements and all the rest… so this initiation took us just a week and later on the great Illuminati gave us $7,000,000.00 to start up our lives…. and now am testifying that if in any case you want to join any great Illuminati all you need to do is for you to contact him on whats-app +1(409)2993890.

    ReplyDelete
  3. LEGIT FULLZ & TOOLS STORE

    Hello to All !

    We are offering all types of tools & Fullz on discounted price.
    If you are in search of anything regarding fullz, tools, tutorials, Hack Pack, etc
    Feel Free to contact

    ***CONTACT 24/7***
    **Telegram > @leadsupplier
    **ICQ > 752822040
    **Skype > Peeterhacks
    **Wicker me > peeterhacks

    "SSN LEADS/FULLZ AVAILABLE"
    "TOOLS & TUTORIALS AVAILABLE FOR HACKING, SPAMMING,
    CARDING, CASHOUT, CLONING, SCRIPTING ETC"

    **************************************
    "Fresh Spammed SSN Fullz info included"
    >>SSN FULLZ with complete info
    >>CC With CVV (vbv & non vbv) Fullz USA
    >>FULLZ FOR SBA, PUA & TAX RETURN FILLING
    >>USA I.D Photos Front & Back
    >>High Credit Score fullz (700+ Scores)
    >>DL number, Employee Details, Bank Details Included
    >>Complete Premium Info with Relative Info

    ***************************************
    COMPLETE GUIDE FOR TUTORIALS & TOOLS

    "SPAMMING" "HACKING" "CARDING" "CASH OUT"
    "KALI LINUX" "BLOCKCHAIN BLUE PRINTS" "SCRIPTING"
    "FRAUD BIBLE"

    "TOOLS & TUTORIALS LIST"
    =>Ethical Hacking Ebooks, Tools & Tutorials
    =>Bitcoin Hacking
    =>Kali Linux
    =>Fraud Bible
    =>RAT
    =>Keylogger & Keystroke Logger
    =>Whatsapp Hacking & Hacked Version of Whatsapp
    =>Facebook & Google Hacking
    =>Bitcoin Flasher
    =>SQL Injector
    =>Premium Logs (PayPal/Amazon/Coinbase/Netflix/FedEx/Banks)
    =>Bitcoin Cracker
    =>SMTP Linux Root
    =>Shell Scripting
    =>DUMPS with pins track 1 and 2 with & without pin
    =>SMTP's, Safe Socks, Rdp's brute
    =>PHP mailer
    =>SMS Sender & Email Blaster
    =>Cpanel
    =>Server I.P's & Proxies
    =>Viruses & VPN's
    =>HQ Email Combo (Gmail, Yahoo, Hotmail, MSN, AOL, etc.)

    *Serious buyers will always welcome
    *Price will be reduce in bulk order
    *Discount offers will give to serious buyers
    *Hope we do a great business together

    ===>Contact 24/7<===
    ==>Telegram > @leadsupplier
    ==>ICQ > 752822040
    ==>Skype > Peeterhacks
    ==>Wicker me > peeterhacks

    ReplyDelete