112
PDF brought to you by ResPaper.com Answer key / correct responses on: Upload and share your papers and class notes on ResPaper.com. It is FREE! ResPaper.com has a large collection of board papers, competitive exams and entrance tests. Click link: http://www.respaper.com/icse/773/7179.pdf Other papers by ICSE : http://www.respaper.com/icse/ http://www.respaper.com/ ICSE Specimen 2014 Computer Applications

Computer Application Sic Se

Embed Size (px)

DESCRIPTION

ICSE computer applications

Citation preview

  • PDF brought to you by ResPaper.com

    Answer key / correct responses on:

    Upload and share your papers and class notes on ResPaper.com. It is FREE!

    ResPaper.com has a large collection of board papers, competitive exams

    and entrance tests.

    Click link: http://www.respaper.com/icse/773/7179.pdf

    Other papers by ICSE : http://www.respaper.com/icse/

    http://www.respaper.com/

    ICSE Specimen 2014 Computer Applications

  • Click for Answer Key: http://www.respaper.com/icse/773/7179.pdf

    Page 1

  • Click for Answer Key: http://www.respaper.com/icse/773/7179.pdf

    Page 2

  • Click for Answer Key: http://www.respaper.com/icse/773/7179.pdf

    Page 3

  • Click for Answer Key: http://www.respaper.com/icse/773/7179.pdf

    Page 4

  • PDF brought to you by ResPaper.com

    Answer key / correct responses on:

    Upload and share your papers and class notes on ResPaper.com. It is FREE!

    ResPaper.com has a large collection of board papers, competitive exams

    and entrance tests.

    Click link: http://www.respaper.com/icse/161/9560.pdf

    Other papers by ICSE : http://www.respaper.com/icse/

    http://www.respaper.com/

    ICSE Specimen 2013 Computer Applications

  • Click for Answer Key: http://www.respaper.com/icse/161/9560.pdf

    Page 1

  • Click for Answer Key: http://www.respaper.com/icse/161/9560.pdf

    Page 2

  • Click for Answer Key: http://www.respaper.com/icse/161/9560.pdf

    Page 3

  • Click for Answer Key: http://www.respaper.com/icse/161/9560.pdf

    Page 4

  • PDF brought to you by ResPaper.com

    Answer key / correct responses on:

    Upload and share your papers and class notes on ResPaper.com. It is FREE!

    ResPaper.com has a large collection of board papers, competitive exams

    and entrance tests.

    Click link: http://www.respaper.com/icse/161/9516.pdf

    Other papers by ICSE : http://www.respaper.com/icse/

    http://www.respaper.com/

    ICSE Specimen 2011 Computer Applications

  • Click for Answer Key: http://www.respaper.com/icse/161/9516.pdf

    Page 1

  • Click for Answer Key: http://www.respaper.com/icse/161/9516.pdf

    Page 2

  • Click for Answer Key: http://www.respaper.com/icse/161/9516.pdf

    Page 3

  • Click for Answer Key: http://www.respaper.com/icse/161/9516.pdf

    Page 4

  • PDF brought to you by ResPaper.com

    Answer key / correct responses on:

    Upload and share your papers and class notes on ResPaper.com. It is FREE!

    ResPaper.com has a large collection of board papers, competitive exams

    and entrance tests.

    Click link: http://www.respaper.com/utkarsh98/6297.pdf

    Other papers by UTKARSH98 : http://www.respaper.com/utkarsh98/

    http://www.respaper.com/

    ICSE 2014 : COMPUTER APPLICATIONS

  • Click for Answer Key: http://www.respaper.com/utkarsh98/6297.pdf

    Page 1

  • Click for Answer Key: http://www.respaper.com/utkarsh98/6297.pdf

    Page 2

  • Click for Answer Key: http://www.respaper.com/utkarsh98/6297.pdf

    Page 3

  • Click for Answer Key: http://www.respaper.com/utkarsh98/6297.pdf

    Page 4

  • Click for Answer Key: http://www.respaper.com/utkarsh98/6297.pdf

    Page 5

  • Click for Answer Key: http://www.respaper.com/utkarsh98/6297.pdf

    Page 6

  • Click for Answer Key: http://www.respaper.com/utkarsh98/6297.pdf

    Page 7

  • This Paper consists of 5 printed pages and 1 blank page.

    T13 861 www.javaforschool.com Turn over

    COMPUTER APPLICATIONS (Theory)

    (Two hours)

    Answers to this Paper must be written on the paper provided separately.

    You will not be allowed to write during the first 15 minutes.

    This time is to be spent in reading the question paper.

    The time given at the head of this Paper is the time allowed for writing the answers.

    This Paper is divided into two Sections.

    Attempt all questions from Section A and any four questions from Section B. The intended marks for questions or parts of questions are given in brackets [ ].

    SECTION A (40 Marks)

    Attempt all questions.

    Question 1.

    (a) What is meant by precedence of operators? [2] (b) What is a literal? [2] (c) State the Java concept that is implemented through:

    (i) a super class and a subclass (ii) the act of representing essential features without including background details. [2]

    (d) Give a difference between a constructor and a method. [2] (e) What are the types of casting shown by the following examples?

    (i) double x = 15.2; int y = (int) x;

    (ii) int x = 12; long y = x; [2]

    Question 2.

    (a) Name any two wrapper classes. [2] (b) What is the difference between a break statement and a continue statement when

    they occur in a loop? [2]

  • 2 T13 861 www.javaforschool.com

    (c) Write statements to show how finding the length of a character array and char[] differs from finding the length of a String object str. [2] (d) Name the Java keyword that:

    (i) indicates that a method has no return type. (ii) stores the address of the currently - calling object. [2]

    (e) What is an exception? [2]

    Question 3.

    (a) Write a Java statement to create an object mp4 of class digital. [2] (b) State the values stored in the variables str1 and str2

    String s1 = "good"; String s2 = "world matters"; String str1 = s2.substring(5).replace('t', 'n'); String str2 = s1.concat(str1); [2]

    (c) What does a class encapsulate? [2] (d) Rewrite the following program segment using the if...else statement.

    comm =(sale>15000) ? sale*5/100 : 0; [2] (e) How many times will the following loop execute? What value will be returned?

    int x = 2, y = 50; do{ ++x; y - = x++; } while(x

  • 3 T13 861 www.javaforschool.com Turn over

    (i) What is the final value of ctr when the iteration process given below, executes?

    int ctr=0; for(int i=1;i

  • 4 T13 861 www.javaforschool.com

    (ii) void input() - To input and store the product code, flavor, pack type, pack size

    and product price. (iii) void discount() - To reduce the product price by 10. (iv) void display() - To display the product code, flavor, pack type, pack size and product price. Question 5.

    The International Standard Book Number (ISBN) is a unique numeric book identifier which is printed on every book. The ISBN is based upon a 10-digit code. The ISBN is legal if: 1 x digit1 + 2 x digit2 + 3 x digit3 + 4 x digit4 + 5 x digit5 + 6 x digit6 + 7 x digit7 + 8 x digit8 + 9 x digit9 + 10 x digit10 is divisible by 11. Example: For an ISBN 1401601499 Sum=1 x 1 + 2 x 4 + 3 x 0 + 4 x 1 + 5 x 6 + 6 x 0 + 7 x 1 + 8 x 4 + 9 x 9 + 10 x 9 = 253 which is divisible by 11. Write a program to: (i) Input the ISBN code as a 10-digit integer. (ii) If the ISBN is not a 10-digit integer, output the message, "Illegal ISBN" and terminate the

    program. (iii) If the number is 10-digit, extract the digits of the number and compute the sum as explained above.

    If the sum is divisible by 11, output the message, "Legal ISBN". If the sum is not divisible by 11, output the message, "Illegal ISBN". [15]

    Question 6.

    Write a program that encodes a word into Piglatin. To translate word into a Piglatin word, convert the word into uppercase and then place the first vowel of the original word as the start of the new word along with the remaining alphabets. The alphabets present before the vowel being shifted towards the end followed by AY. Sample input (1) : London, Sample output (1) : ONDONLAY Sample input (2) : Olympics, Sample output (2) : OLYMPICSAY [15]

  • 5 T13 861 www.javaforschool.com Turn over

    Question 7.

    Write a program to input 10 integer elements in an array and sort them in descending order using bubble sort technique. [15] Question 8.

    Design a class to overload a function series() as follows: (i) double series(double n) with one double argument and returns the sum of the series,

    sum = + + + + (ii) double series(double a, double n) with two double arguments and returns the sum

    of the series,

    sum = + + + + to n terms [15] Question 9.

    Using the switch statement, write a menu driven program: (i) To check and display whether a number input by the user is a composite number or

    not (A number is said to be a composite, if it has one or more than one factor excluding 1 and the number itself). Example: 4, 6, 8, 9

    (ii) To find the smallest digit of an integer that is input: Sample input : 6524 Sample output : Smallest digit is 2 For an incorrect choice, an appropriate error message should be displayed. [15]

  • This Paper consists of 6 printed pages.

    T12 861 www.javaforschool.com Turn over

    COMPUTER APPLICATIONS

    (Theory) (Two hours)

    Answers to this Paper must be written on the paper provided separately.

    You will not be allowed to write during the first 15 minutes.

    This time is to be spent in reading the question paper.

    The time given at the head of this Paper is the time allowed for writing the answers.

    This Paper is divided into two Sections.

    Attempt all questions from Section A and any four questions from Section B.

    The intended marks for questions or parts of questions are given in brackets [ ].

    SECTION A (40 Marks)

    Attempt all questions

    Question 1.

    (a) Give one example each of a primitive data type and a composite data type. [2]

    (b) Give one point of difference between unary and binary operators. [2]

    (c) Differentiate between call by value or pass by value and call by reference or pass by reference. [2]

    (d) Write a Java expression for 2 [2] (e) Name the type of error (syntax, runtime or logical error) in each case

    given below: (i) Division by a variable that contains a value of zero. (ii) Multiplication operator used when the operation should be division. (iii) Missing semicolon. [2]

    Question 2.

    (a) Create a class with one integer instance variable. Initialize the variable using: (i) default constructor. (ii) parameterized constructor. [2]

  • 2 T12 861 www.javaforschool.com

    (b) Complete the code below to create an object of Scanner class:

    Scanner sc = ______ Scanner ( _____________ ); [2]

    (c) What is an array? Write a statement to declare an integer array of 10 elements. [2]

    (d) Name the search or sort algorithm that :

    (i) Makes several passes through the array, selecting the next smallest item in the array each time and placing it where it belongs in the array. (ii) At each stage, compares the sought key value with the key value of the middle element of the array. [2]

    (e) Differentiate between public and private modifiers for members of a class. [2]

    Question 3.

    (a) What are the values of x and y when the following statements are executed?

    int a=63, b=36; boolean x = (a>b) ? true : false ; int y = (a

  • 3 T12 861 www.javaforschool.com Turn over

    (f) State the method that:

    (i) Converts a string to a primitive float data type (ii) Determines if the specified character is an upper case character. [2]

    (g) State the data type and values of a and b after the following segment is executed:

    String s1= Computer, s2=Applications; a = (s1.compareTo(s2)); b = (s1.equals(s2)); [2]

    (h) What will the following code output:

    String s= malayalam; System.out.println(s.indexOf(m)); System.out.println(s.lastIndexOf(m)); [2]

    (i) Rewrite the following program segment using while instead of for statement.

    int f=1,i; for(i=1; i< =5; i++) { f*=i; System.out.println(f);} [2]

    (j) In the program given below, state the name and the value of the:

    (i) method argument or argument variable (ii) class variable (iii) local variable (iv) instance variable class MyClass { static int x = 7; int y = 2; public static void main(String args[]){ MyClass obj = new MyClass(); System.out.println(x); obj.sampleMethod(5); int a = 6; System.out.println(a); }

  • 4 T12 861 www.javaforschool.com

    void sampleMethod(int n){ System.out.println(n); System.out.println(y); } } [2]

    SECTION B (60 Marks)

    Attempt any four questions from this Section.

    The answers in this Section should consist of the Programs in either Blue J

    environment or any program environment with Java as the base.

    Each program should be written using Variable descriptions/Mnemonic Codes

    such that the logic of the program is clearly depicted.

    Flow-Charts and Algorithms are not required.

    Question 4.

    Define a class called Library with the following description:

    Instance variables/data members:

    Int acc_num - stores the accession number of the book

    String title - stores the title of the book

    String author - stores the name of the author

    Member methods:

    (i) void input() To input and store the accession number, title and author.

    (ii) void compute() To accept the number of days late, calculate and display the fine

    charged at the rate of ` 2 per day.

    (iii) void display() To display the details in the following format:

    Accession Number Title Author

    Write a main method to create an object of the class and call the above member methods. [15]

  • 5 T12 861 www.javaforschool.com Turn over

    Question 5.

    Given below is a hypothetical table showing rates of income tax for male citizens below the age of 65 years:

    Taxable Income (TI) in ` Income Tax in `

    Does not exceed ` 1,60,000 Nil

    Is greater than ` 1,60,000 & less than or equal to ` 5,00,000

    (TI 1,60,000) x 10%

    Is greater than ` 5,00,000 & less than or equal to ` 8,00,000

    [(TI 5,00,000) x 20%] + 34,000

    Is greater than ` 8,00,000 [(TI 8,00,000) x 30%] + 94,000

    Write a program to input the age, gender (male or female) and Taxable Income of a person. If the age is more than 65 years or the gender is female, display wrong category. If the age is less than or equal to 65 years and the gender is male, compute and display the Income Tax payable as per the table given above. [15]

    Question 6.

    Write a program to accept a string. Convert the string to uppercase. Count and output the number of double letter sequences that exist in the string.

    Sample Input: SHE WAS FEEDING THE LITTLE RABBIT WITH AN APPLE

    Sample Output: 4 [15]

    Question 7.

    Design a class to overload a function polygon() as follows:

    (i) void polygon(int n, char ch) with one integer argument and one character type argument that draws a filled square of side n using the character stored in ch.

    (ii) void polygon(int x, int y) with two integer arguments that draws a filled rectangle of length x and breadth y, using the symbol @

  • 6 T12 861 www.javaforschool.com

    (iii) void polygon() with no argument that draws a filled triangle shown below.

    Example:

    (i) Input value of n = 2, ch=O Output: OO OO (ii) Input value of x = 2, y = 5 Output: @@@@@ @@@@@ (iii) Output: * ** *** [15]

    Question 8.

    Using the switch statement, write a menu driven program to:

    (i) Generate and display the first 10 terms of the Fibonacci series 0,1,1,2,3,5,. The first two Fibonacci numbers are 0 and 1, and each subsequent number is the sum of the previous two.

    (ii) Find the sum of the digits of an integer that is input.

    Sample Input: 15390 Sample Output: Sum of the digits = 18

    For an incorrect choice, appropriate error message should be displayed. [15]

    Question 9.

    Write a program to accept the names of 10 cities in a single dimension string array and their STD (Subscribers Trunk Dialing) codes in another single dimension integer array. Search for a name of a city input by the user in the list. If found, display Search Successful and print the name of the city along with its STD code, or else display the message Search Unsuccessful, No such city in the list. [15]

  • PDF brought to you by ResPaper.com

    Answer key / correct responses on:

    Upload and share your papers and class notes on ResPaper.com. It is FREE!

    ResPaper.com has a large collection of board papers, competitive exams

    and entrance tests.

    Click link: http://www.respaper.com/icse/161/1039.pdf

    Other papers by ICSE : http://www.respaper.com/icse/

    http://www.respaper.com/

    ICSE 2011 : COMPUTER APPLICATIONS

  • Click for Answer Key: http://www.respaper.com/icse/161/1039.pdf

    Page 1

  • Click for Answer Key: http://www.respaper.com/icse/161/1039.pdf

    Page 2

  • Click for Answer Key: http://www.respaper.com/icse/161/1039.pdf

    Page 3

  • PDF brought to you by ResPaper.com

    Answer key / correct responses on:

    Upload and share your papers and class notes on ResPaper.com. It is FREE!

    ResPaper.com has a large collection of board papers, competitive exams

    and entrance tests.

    Click link: http://www.respaper.com/icse/161/3231.pdf

    Other papers by ICSE : http://www.respaper.com/icse/

    http://www.respaper.com/

    ICSE 2010 : COMPUTER APPLICATIONS

  • Click for Answer Key: http://www.respaper.com/icse/161/3231.pdf

    Page 1

  • Click for Answer Key: http://www.respaper.com/icse/161/3231.pdf

    Page 2

  • Click for Answer Key: http://www.respaper.com/icse/161/3231.pdf

    Page 3

  • Click for Answer Key: http://www.respaper.com/icse/161/3231.pdf

    Page 4

  • PDF brought to you by ResPaper.com

    Answer key / correct responses on:

    Upload and share your papers and class notes on ResPaper.com. It is FREE!

    ResPaper.com has a large collection of board papers, competitive exams

    and entrance tests.

    Click link: http://www.respaper.com/icse/161/3890.pdf

    Other papers by ICSE : http://www.respaper.com/icse/

    http://www.respaper.com/

    ICSE 2009 : COMPUTER APPLICATIONS

  • Click for Answer Key: http://www.respaper.com/icse/161/3890.pdf

    Page 1

  • Click for Answer Key: http://www.respaper.com/icse/161/3890.pdf

    Page 2

  • Click for Answer Key: http://www.respaper.com/icse/161/3890.pdf

    Page 3

  • Click for Answer Key: http://www.respaper.com/icse/161/3890.pdf

    Page 4

  • PDF brought to you by ResPaper.com

    Answer key / correct responses on:

    Upload and share your papers and class notes on ResPaper.com. It is FREE!

    ResPaper.com has a large collection of board papers, competitive exams

    and entrance tests.

    Click link: http://www.respaper.com/icse/161/9737.pdf

    Other papers by ICSE : http://www.respaper.com/icse/

    http://www.respaper.com/

    ICSE 2007 : COMPUTER APPLICATIONS

  • Click for Answer Key: http://www.respaper.com/icse/161/9737.pdf

    Page 1

  • Click for Answer Key: http://www.respaper.com/icse/161/9737.pdf

    Page 2

  • Click for Answer Key: http://www.respaper.com/icse/161/9737.pdf

    Page 3

  • Click for Answer Key: http://www.respaper.com/icse/161/9737.pdf

    Page 4

  • PDF brought to you by ResPaper.com

    Answer key / correct responses on:

    Upload and share your papers and class notes on ResPaper.com. It is FREE!

    ResPaper.com has a large collection of board papers, competitive exams

    and entrance tests.

    Click link: http://www.respaper.com/icse/161/1446.pdf

    Other papers by ICSE : http://www.respaper.com/icse/

    http://www.respaper.com/

    ICSE 2006 : COMPUTER APPLICATIONS

  • Click for Answer Key: http://www.respaper.com/icse/161/1446.pdf

    Page 1

  • Click for Answer Key: http://www.respaper.com/icse/161/1446.pdf

    Page 2

  • Click for Answer Key: http://www.respaper.com/icse/161/1446.pdf

    Page 3

  • Click for Answer Key: http://www.respaper.com/icse/161/1446.pdf

    Page 4

  • PDF brought to you by ResPaper.com

    Answer key / correct responses on:

    Upload and share your papers and class notes on ResPaper.com. It is FREE!

    ResPaper.com has a large collection of board papers, competitive exams

    and entrance tests.

    Click link: http://www.respaper.com/icse/161/4290.pdf

    Other papers by ICSE : http://www.respaper.com/icse/

    http://www.respaper.com/

    ICSE 2005 : COMPUTER APPLICATIONS

  • Click for Answer Key: http://www.respaper.com/icse/161/4290.pdf

    Page 1

  • Click for Answer Key: http://www.respaper.com/icse/161/4290.pdf

    Page 2

  • Click for Answer Key: http://www.respaper.com/icse/161/4290.pdf

    Page 3

  • Click for Answer Key: http://www.respaper.com/icse/161/4290.pdf

    Page 4

  • Prelium 2013std. x

    ST. GREGORIOS IIIGH SCHOOLCOMPUTER APPLICATIONS

    This paper is divided into two sections. You are to answer allquestions from section A, andany four questions from section B. The intended ryarkslor questions or parts of questions aregiven in brackets [].

    to this paper on me paper separately. Youallowed to write during the first 10 minutes. Thistime to be spent in reading the questionpaper. The time given at the head of this paper is time allowed for the writin-g the answers

    ' Atte,o';fo"Jj$:ffi#l[il,""tion.

    Question 1.Answerthe following.

    i) What is meant by precedence of operators ?b) What is a null statement in java ?c) Name any two wrapper class.d) How are data and functions organized in OOp ?e) What is meant by base type of an anay ?

    Question 2.Difference between the following.

    a) Constructor and rnethod.b) Class and object.c) Operator and operand.d) Local and globalvariable..e) SlecUon controland iteration control.

    QuesUon 3.Give the ouiput of the tuilowing.

    a) How many times will the foltowing loop execute? What.;alue wiil be the valueOf x?int x=2, y=S0;do

    {++xlY-=x++;)while(x

  • 7 .rlht'q

    e) i) System.out.pritnln(Math.round(-5.49));ii) System.out.pritnln(Math. rintG5.49));iii) System.out.pritnln(Math.ceilG0.03)) ;iv) System.out.pritnln(Math.fl oor(-0.03)) ;v) Syetem.out.pritnln(Math.ceil(O.03));

    Question 4.a) if the following snippets are conect, show,the output, if not specify the

    enor and explain.int a=5, b=6, d=7;

    i) if (a>b)t

    else{. d=9;)System.out. println(d);

    iii) int i=5;' while(i==S)

    if(i==5)continue;i++;

    [5x2]

    System.out. Pri ntln(i) ; System.out. println(x);

    v) if a=10, then find c?. Show steps of working.6= **!l + a++ - -a-a- + a * + a I ai

    SECTION 8[60 Markst

    pr"oq,,*"il:[;H[U,:Xfi'[it""l1H#i;ff 'llLqurrcdw*hevery JAVA progriam and descriptlon of varlables used ln the program.

    Qugtion 5. ?,/ Design the class to catculate and diplay sum of odd digits and product of even

    dig'tts of the number.

    Class name : Calculatelnstance variable ldala member:

    : integer, to store number.Member function / methods :-

    ii) if(a>b);td=9;

    )System.out. println(d);

    iv) int x=10;fo(int i-1; i10)break;x=x-2i

    : to accept the number.: to calculate antrc{rrn sum of odd digits and product

    of even digits.Yo'd

    void inputQialcalc(int)

    Example :.13/,526

    surn will be 1+3+5 = 9 , product will be 4'2*6 = 48

    PaseZ "r'l

    ICSE Sample Papers for March 2015 Exams

    Secret to 90% in Boards Buy Full Set from Exam18.com 2

  • Download the Full Question Paper from Exam18.com

    This Question Paper is a part of the Prelim Papers Package of ICSE Class 10 for 2015 Examinations and available exclusively on Exam18.com

    You can download the Question papers (All Subjects) of 10 Schools, 15 Schools or 25 Schools for Rs. 400, Rs. 600, Rs. 800 respectively.

    If you buy 10 Schools Prelim Question Papers, you get: No. of Question Papers = 12 Subjects x 10 Schools = 120 Question Papers Cost of E-Book Rs. 400 Cost of Printed Book (Free Home Delivery Across India!) Rs. 800

    If you buy 15 Schools Prelim Question Papers, you get: No. of Question Papers = 12 Subjects x 15 Schools = 180 Question Papers Cost of E-Book Rs. 800 Cost of Printed Book (Free Home Delivery Across India!) Rs. 1200

    If you buy 25 Schools Prelim Question Papers, you get: No. of Question Papers = 12 Subjects x 25 Schools = 300 Question Papers Cost of E-Book Rs. 800 Cost of Printed Book (Free Home Delivery Across India!) Rs. 1500

    How to Pay? You can Pay for these Books using your Credit Card/Debit Card/NetBanking or Cash on Delivery.

    Delivery Time Delivered in 1-7 days after Placing your Order on Exam18.com

    Want to get this Complete Book? Click here to Order E-Book (Only Online Payment Option Available since it is E-Book and delivered instantly to your Email after Payment)

    Click here to Order Printed Book

    Visit Exam18.com Or Call Helpline 07666303006 or email [email protected]

    ICSE Sample Papers for March 2015 Exams

    Secret to 90% in Boards Buy Full Set from Exam18.com 3

    http://www.exam18.com/http://www.exam18.com/p/icse-prelim-papers-class-10-grand-package-2015-examinations-printed-book/http://www.exam18.com/p/icse-prelim-papers-class-10-grand-package-2015-examinations-printed-book/http://www.exam18.com/http://www.exam18.com/http://www.exam18.com/icse-prelim-papers-2015-ebookhttp://www.exam18.com/p/icse-prelim-papers-class-10-grand-package-2015-examinations-printed-book/

  • JAVA FOR SCHOOL SAMPLE PAPER 8 Making Java Fun To Learn ICSE (Class X) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    This Paper consists of 4 printed pages.

    TSP008 www.javaforschool.com Turn over

    COMPUTER APPLICATIONS

    (Theory) (Two hours)

    Answers to this Paper must be written on the paper provided separately.

    You will not be allowed to write during the first 15 minutes.

    This time is to be spent in reading the question paper.

    The time given at the head of this Paper is the time allowed for writing the answers.

    This Paper is divided into two Sections.

    Attempt all questions from Section A and any four questions from Section B.

    The intended marks for questions or parts of questions are given in brackets [ ].

    SECTION A (40 Marks)

    Attempt all questions

    Question 1.

    (a) Mention any two rules for naming identifiers. [2] (b) How do we invoke a constructor? Explain with an example. [2]

    (c) Write a Java statement to create an object named 'jfs' of a class 'Computer' that invokes a parameterized constructor that accepts two integer type values. [2]

    (d) How is the concept of Data Abstraction implemented in Java? [2]

    (e) Write the expression for the absolute value of 2 + 3 . [2]

    Question 2.

    (a) Assign the constant value of pi (i.e. 3.142) to a variable mentioning its appropriate data type. [2]

    (b) Name the Java keyword that:

    (i) is used to finish the execution of a program

    (ii) is used to implement the concept of inheritance. [2]

    (c) If int A[ ] = {9,8,0,4,5,6,6,8,1,5}; What are the values of 'm' and 'n'?.

    m = Math.max(Math.pow(A[1],A[2]) , Math.sqrt(A[3]));

    n = Math.pow(Math.min(A[1],A[7]), A[3]); [2]

    (d) What is the difference between a String object and StringBuffer object? [2] (e) Write a Java statement to check whether two string object 's1' and 's2' are equal or not, using compareTo() function. [2]

  • JAVA FOR SCHOOL SAMPLE PAPER 8 Making Java Fun To Learn ICSE (Class X) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    2 TSP008 www.javaforschool.com

    Question 3.

    (a) Rewrite the following code fragment without break and continue.

    while(ch != '*') { if(ch == '?') break; if(ch != '\n') continue; line++; } [3]

    (b) What will be the result of the following code: String s1 = "Feeling Sleepy"; String s2 = "Watching Television";

    (i) System.out.println(s1.compareTo(s2)); (ii) System.out.println(s1.concat(" Still ").concat(s2)); [2]

    (c) State the difference between Selection Sort and Bubble Sort. [2]

    (d) Find the errors in the following code snippet and correct them: boolean true = a; If(false) System.Out.Println("Nothing in here") else System.out.println(Correct this mistake); [3]

    Question 4.

    (a) State the purpose and return datatype of the following wrapper class functions: (i) toString(long n) (ii) parseLong(String s) [2]

    (b) Identify the following as valid or invalid identifier names. State reasons. (i) _123 (ii) break (iii) T$ (iv) var.1 [2]

    (c) Analyze the following program segment and answer the following questions:

    class JavaForSchool { public void methodInfo() { char a = 'A', b = 'a'; int c = a++ + b; } }

    (i) What value is stored in 'c' after the method gets executed? (ii) What is the value stored in 'a' after the execution of the method? (iii) Define the main() method which calls the above method. (iv) Modify methodInfo() so that the resultant 'c' is displayed on the screen. [4]

    (d) What is the scope of the keyword 'protected' in accessing a method. [2]

  • JAVA FOR SCHOOL SAMPLE PAPER 8 Making Java Fun To Learn ICSE (Class X) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    3 TSP008 www.javaforschool.com Turn over

    SECTION B (60 Marks)

    Attempt any four questions from this Section.

    The answers in this Section should consist of the Programs in either Blue J

    environment or any program environment with Java as the base.

    Each program should be written using Variable descriptions/Mnemonic Codes

    such that the logic of the program is clearly depicted.

    Flow-Charts and Algorithms are not required.

    Question 5. [15]

    An Emirp number is a number which is prime backwards and forwards.

    Example: 13 is an Emirp number since 13 and 31 are both prime numbers. Write a program to accept a number and check whether it is an Emirp number or not.

    Question 6. [15]

    Define a class WordOp having the following description: Data members/instance variables:

    str : to store a word max : to store the highest alphabetical character present in the word min : to store the lowest alphabetical character present in the word

    Member functions:

    WordOp() : default constructor void input() : to accept the word in UPPERCASE void calcMaxMin() : to find the highest and the lowest character present in the word. void display() : to display the word along with the highest and the lowest character Example: If word is "TWEAK" Highest Character = W Lowest Character = A Question 7. [15]

    Design a class to overload a function volume() as follows:

    (i) double volume(double r) with one double argument, returns the volume of a sphere using the formula:

    volume =

    (ii) double volume(double r, double h) with two double arguments, returns the volume of a cone using the formula:

    volume =

    (i) double volume(double l, double b, double h) with three double arguments, returns the volume of a cuboid using the formula: volume = l x b x h

  • JAVA FOR SCHOOL SAMPLE PAPER 8 Making Java Fun To Learn ICSE (Class X) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    4 TSP008 www.javaforschool.com

    Question 8. [15]

    The production (P) of crude oil of a country in millions of barrels may be estimated by the following set of equations, where t represents the time duration in years:

    P = 5 + 3t for 0 t 3 P = 14 + (t - 5/2)2 for t > 3

    Write a program in Java to input a year from the user and find and print the production for every year from the year 2000 to the inputted year.

    Print the output in the following format: Year Production ---------- ---------- ---------- ---------- ---------- ----------

    Question 9. [15]

    A cloth showroom has announced the following seasonal discounts on purchase of items:

    Purchase Amount (`) Discount

    Mill Cloth Handloom Items

    0 - 1000 ------- 5 %

    1001 - 2000 5 % 7.5 %

    2001 - 3000 7.5 % 10 %

    Above 3000 10 % 15 % Write a Java program to input the purchase amount and Item Code viz : M or m for Mill Cloth and H or h for Handloom Items.

    Calculate the discount amount. Find the net balance to be paid excluding the discount. Print the Purchase Amount, Item Type, Discount and the net amount to be paid.

    Question 10. [15]

    Write a program to input an integer array A[] of n size. Sort the array in ascending order. Then input another number from the user and replace all the numbers less than that inputted number by their reverse.

    Example : If A[] = {38, 25, 16, 91, 5, 12} then, array after sorting is {5, 12, 16, 25, 38}

    If the number entered = 20 then, after replacing all the numbers less than 20 with their reverse,

    final Output is {5, 21, 61, 25, 38}

  • JAVA FOR SCHOOL SAMPLE PAPER 7 Making Java Fun To Learn ICSE (Class X) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    This Paper consists of 4 printed pages.

    TSP007 www.javaforschool.com Turn over

    COMPUTER APPLICATIONS

    (Theory) (Two hours)

    Answers to this Paper must be written on the paper provided separately.

    You will not be allowed to write during the first 15 minutes.

    This time is to be spent in reading the question paper.

    The time given at the head of this Paper is the time allowed for writing the answers.

    This Paper is divided into two Sections.

    Attempt all questions from Section A and any four questions from Section B.

    The intended marks for questions or parts of questions are given in brackets [ ].

    SECTION A (40 Marks)

    Attempt all questions

    Question 1.

    (a) What are keywords? Give any two examples. [2] (b) What is an array? Write the general syntax for creating an array. [2]

    (c) What is the difference between subscript and subscripted variable? [2]

    (d) Name any two characteristic features of Java. [2]

    (e) Mention two different styles of expressing a comment in a program. [2]

    Question 2.

    (a) Name the Java keyword that:

    (i) is used for dynamic memory allocation to reference data types

    (ii) is used to declare class variables. [2]

    (b) State the difference between a Constructor and a Method. [2]

    (c) Explain "Call by reference". [2]

    (d) What is the difference between a formal and actual parameters? [2] (e) Explain the use of the below given functions:

    (i) endsWith()

    (ii) random() [2]

  • JAVA FOR SCHOOL SAMPLE PAPER 7 Making Java Fun To Learn ICSE (Class X) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    2 TSP007 www.javaforschool.com

    Question 3.

    (a) Detect errors if any in the below given statement and rewrite it correctly:

    If(2x + 5 = 10 && x>0) [2]

    (b) String s1="I LOVE"; [4] String s2 = "JAVA FOR SCHOOL"; (i) System.out.println(s1.substring(0).concat(s2.substring(0,4)) (ii) System.out.println(s2.substring(2,10)); (iii) System.out.println(s2.replace('O', 'o')); (iv) System.out.println(s2.charAt(s1.indexOf('V') + s2.indexOf('H')));

    (c) Write a Java statement to:

    (i) Extract the second last character of a word stored in the variable wd.

    (ii) Check if the second character of a string 'str' is in uppercase [2]

    (e) What is the use of the keyword import? [2]

    Question 4.

    (a) State the output of the following program segment according to the inputs as mentioned: with each part: [4]

    if(x++ == 11) System.out.print("RESULT IS 11"); else if(++x == 10) System.out.print("RESULT IS 10"); else if(- -x == 10) System.out.print("RESULT IS 10"); else System.out.print("RESULT IS NEITHER 10 NOR 11"); (i) x = 9 (ii) x = 10 (iii) x = 11 (iv) x = 12

    (c) What will the following functions return when executed:

    (i) Math.pow (2, Math.sqrt(36))

    (ii) Math.rint(32.17) [2]

    (d) Write a Java expression for: ( ) [2]

    (e) Write the prototype of a function 'divide' that takes two integer values and returns the quotient in double type. [1]

    (f) Name the package which contains the Scanner class? [1]

  • JAVA FOR SCHOOL SAMPLE PAPER 7 Making Java Fun To Learn ICSE (Class X) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    3

    TSP007 www.javaforschool.com Turn over

    SECTION B (60 Marks)

    Attempt any four questions from this Section.

    The answers in this Section should consist of the Programs in either Blue J

    environment or any program environment with Java as the base.

    Each program should be written using Variable descriptions/Mnemonic Codes

    such that the logic of the program is clearly depicted.

    Flow-Charts and Algorithms are not required.

    Question 5. [15]

    Define a class Employee having the following description: Data members/instance variables:

    pan : to store personal account number name : to store the name taxincome : to store the annual taxable income tax : to store the tax that is calculated

    Member functions:

    Employee() : default constructor void input() : to accept the pan number, name and taxable income void calc() : calculate the tax for an employee according to the given conditions: Total Annual Taxable Income Tax Rate Upto Rs. 100000 No tax From Rs. 100001 to Rs. 150000 10% of the income exceeding Rs. 100000 From Rs. 150001 to Rs. 250000 Rs. 5000 + 20% of the income exceeding Rs. 150000 Above Rs. 250000 Rs. 25000 + 30% of the income exceeding Rs. 250000

    void display() : output the details of the employee as per given format: Pan Number Name Taxable Income Tax ___________ _____ ______________ ____ Question 6. [15]

    Write a Java program to accept a string. Extract the last character from it and form a new string after adding the extracted character at the first and last places in the given string. Print the entered and new string. Sample Input : Java Sample Ouptut : aJavaa (where 'a' is the last character in the string Java)

  • JAVA FOR SCHOOL SAMPLE PAPER 7 Making Java Fun To Learn ICSE (Class X) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    4 TSP007 www.javaforschool.com

    Question 7. [15]

    Write a menu driven program in Java: (a) to input a number and check whether it is a NEON number or not (b) to print the REPUNIT series: 1, 11, 111, 1111, . upto 'n' terms

    Note:

    NEON: A number is said to be NEON, if sum of all the digits of the square of the number is equal to the number itself.

    For example 9 is a NEON number (Workings: Square of 9 = 81. Sum of digits of square: 8 + 1 = 9)

    Question 8. [15]

    Write a Java program to print the reverse of all the numbers in the range 'p' to 'q', where p

  • JAVA FOR SCHOOL SAMPLE PAPER 6 Making Java Fun To Learn ICSE (Class X) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    This Paper consists of 4 printed pages.

    TSP006 www.javaforschool.com Turn over

    COMPUTER APPLICATIONS

    (Theory) (Two hours)

    Answers to this Paper must be written on the paper provided separately.

    You will not be allowed to write during the first 15 minutes.

    This time is to be spent in reading the question paper.

    The time given at the head of this Paper is the time allowed for writing the answers.

    This Paper is divided into two Sections.

    Attempt all questions from Section A and any four questions from Section B.

    The intended marks for questions or parts of questions are given in brackets [ ].

    SECTION A (40 Marks)

    Attempt all questions

    Question 1.

    (a) Define this keyword. What is its significance? [2] (b) State the Java concept that is implemented through:

    (i) dividing a long set of instructions into smaller groups/modules

    (ii) the wrapping up of data and its associated function into a class. [2]

    (c) Differentiate between parameterized and non-parameterized constructor. [2]

    (d) What are wrapper classes? Give an example. [2]

    (e) Write statements to show how finding the length of a character array ch[] differs from finding the length of a String object str. [2]

    Question 2.

    (a) Name the Java keyword that:

    (i) indicates that a method has no return type.

    (ii) converts a variable into a constant. [2]

    (b) What is polymorphism? How does function overloading implement polymorphism? [2]

    (c) Explain: "Objects encapsulate characteristics and behaviour" [2]

    (d) What is the difference between a pure and mixed expression. [2] (e) Explain the use of the below given functions:

    (i) trim()

    (ii) isWhitespace() [2]

  • JAVA FOR SCHOOL SAMPLE PAPER 6 Making Java Fun To Learn ICSE (Class X) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    2 TSP006 www.javaforschool.com

    Question 3.

    (a) Write correctly the following statement:

    String S = ["A", "E", "I", "O", "U"]; [2]

    (b) What is the need of type-casting? [2]

    (c) Write a Java statement to:

    (i) create an object mp3 of class Music

    (ii) import all the classes of the package named simple [2]

    (d) What will the following functions return when executed:

    (i) Math.max (-7, Math.min(-2, -9))

    (ii) Math.ceil (32.17) [2]

    (e) State the output of System.out.println("Java".length() + "For School".length()). [2]

    Question 4.

    (a) State the output of the following program segment: [2] class Today { static int a; char b; void input() { a = 20; b = 'Z'; } void convert() { char c = (char)(a+b); System.out.println(c); } public static void main() {

    Today t = new Today(); t.input(); t.convert();

    } }

    (b) Based on the above given piece of code, answer the questions which follow:

    (i) Name the instance, class and local variables. (ii) What is the name of the constructor of the above class?

    (iii) Explain the line: Today t = new Today(); [3]

    (c) Given a character array: char arr[] = {'J', 'A', 'V', 'A'}; and an integer: int b = 2; What will be the output of the below statements if they are executed one after the other:

    (i) System.out.println(arr[b++]); (ii) System.out.println(arr[b]++); [2]

    (d) Write a Java expression for: x = [2] (e) Write the prototype of a function which takes in 2 integer and 1 String arguments, and

    returns a value which is either 'true' or 'false' [1]

  • JAVA FOR SCHOOL SAMPLE PAPER 6 Making Java Fun To Learn ICSE (Class X) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    3

    TSP006 www.javaforschool.com Turn over

    SECTION B (60 Marks)

    Attempt any four questions from this Section.

    The answers in this Section should consist of the Programs in either Blue J

    environment or any program environment with Java as the base.

    Each program should be written using Variable descriptions/Mnemonic Codes

    such that the logic of the program is clearly depicted.

    Flow-Charts and Algorithms are not required.

    Question 5. [15]

    Write a menu driven program in Java to input a number and check whether it is a: (a) DISARIUM number or not (b) DUCK number or not

    Note:

    DISARIUM: A number will be called DISARIUM if sum of its digits powered with their respective position is equal to the original number. For example 135 is a DISARIUM (Workings 11+32+52 = 135, some other DISARIUM are 89, 175, 518 etc)

    DUCK: A Duck number is a number which has zeroes present in it, but there should be no zero present in the beginning of the number.

    For example 3210, 7056, 8430709 are all Duck numbers whereas 08237 is not. Question 6. [15]

    An airlines announces discount on tickets depending upon destination chosen by the passenger from the following:

    Destination Rate of ticket (per person) America Rs. 50000.0 Singapore Rs. 20000.0 Japan Rs. 40000.0 Thailand Rs. 30000.0

    The discount will be given as per the given criteria:

    Ticket Amount Discount on Total amount Above Rs. 200000 25% Rs. 150001 to Rs. 200000 20% Rs. 100001 to Rs. 150000 15% Less than Rs. 100000 10%

    Write a Java program to input name of the passenger/group head (in case of more than 1 passengers), number of passengers and destination code viz: A or a for America, S or s for Singapore, J or j for Japan, and T or t for Thailand.

    Calculate the total ticket amount and discount amount. Find the net balance to be paid excluding the discount. Print name, number of passengers, destination code, discount and total ticket amount to be paid.

  • JAVA FOR SCHOOL SAMPLE PAPER 6 Making Java Fun To Learn ICSE (Class X) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    4 TSP006 www.javaforschool.com

    Question 7. [15]

    Write a Java program to input a sentence from the user in lowercase and capitalize the first and the last characters of every word in it. Sample Input : i love java for school. Sample Ouptut : I LovE JavA FoR SchooL

    Some of the data members and member functions are given below:

    Class name : Capitalize

    Data members/instance variables:

    sent : stores the sentence cap : to store the new sentence size : stores the length of the sentence

    Member functions:

    Capitalize() : default constructor void readsentence() : to accept the sentence void capfirstlast() : extract each word and capitalize the first and the last alphabet of the word

    and form a new sentence 'rev' using the changed words void display() : display the original sentence along with the new changed sentence. Specify the class Capitalize giving details of the constructor Capitalize (), void readsentence(), void capfirstlast() and void display(). Define the main() function to create an object and call the function accordingly to enable the task. Question 8. [15]

    Write a Java program to input a sentence. Count the number of times a particular word occurs in it. Display the frequency of the search word.

    Sample Input : Enter a sentence : To be or not to be Enter a word to be searched : be Sample Ouptut : Frequency of searched word : 2

    Question 9. [15]

    Design a class to overload a function series() as follows:

    (i) double series(double n) with one double argument and returns the sum of the series, S = 1 + 12! + 13! + + 1n! (ii) double series(double x, double n) with two double arguments and returns the sum

    of the series, S = x1 + x4 + x9 ++ xn

    Question 10. [15]

    Write a program to input two integer arrays A[] and B[] of m and n sizes respectively. Create a third array C[] by merging the array A[] followed by the array B[].

    Sample Input : A[] = {6, 15, 7, 4, 9} and B[] = {3, 24, 6} Sample Output : C[] = {6, 15, 7, 4, 9, 3, 24, 6}

  • JAVA FOR SCHOOL SAMPLE PAPER 5 Making Java Fun To Learn ICSE (Class X) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    This Paper consists of 4 printed pages.

    TSP005 www.javaforschool.com Turn over

    COMPUTER APPLICATIONS (THEORY) (Two hours)

    (Full Marks 100)

    Answers to this Paper must be written on the paper provided separately.

    You will not be allowed to write during the first 15 minutes.

    This time is to be spent in reading the question paper.

    The time given at the head of this Paper is the time allowed for writing the answers.

    This Paper is divided into two Sections.

    Attempt all questions from Section A and any four questions from Section B.

    The intended marks for questions or parts of questions are given in brackets [ ].

    SECTION A (40 Marks)

    Attempt all questions

    Question 1.

    (a) Give the pictorial representation of the Java Compilation process. [2] (b) "Java is a Case Sensitive language" True or False? [1] (c) Can there be an if without an else? Give an example. [2] (d) What is a loop? [2] (e) Find the output of the following program segments, when: (a) val = 500 (b) val = 1600 [3] int val, sum, n = 550; sum = n + val > 1750? 400:200; System.out.println(sum);

    Question 2.

    (a) If a = 5, b = 9, calculate the value of a + = a++ - ++b + a [2] (b) State one similarity and one difference between 'while' and 'for' loop. [2] (c) What is the use and syntax of a ternary operator? [2] (d) Rewrite the following program correctly: [4]

    class Sample { public void main [ ] ; { x = 2 y = 2.2; float z = x * y; System.out.printline("Value of x++ = " (x++) system.out.println("Value of z = " + z) } }

  • JAVA FOR SCHOOL SAMPLE PAPER 5 Making Java Fun To Learn ICSE (Class X) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    2 TSP005 www.javaforschool.com

    Question 3.

    (a) What is the output of the following: [3] (i) char c = 'A';

    short m = 25; double n = c + m; System.out.println (n); (ii) int x = 10, y = 5, z; if(x > y || x ==y) z = ++x + --y; System.out.println(z + " " + x + " " + y);

    (b) What is a constructor? [2] (c) State whether the following are true or false: [2]

    (i) "After creating an array the size cannot be altered" (ii) "int arr [ ] and int [ ] arr are both valid declarations"

    (d) Write a statement for each of the following: [3] (i) Store a number 354 as a String. (ii) Convert the String to a numeric value. (iii) Add it to the existing total of 1000 to update the total.

    Question 4.

    (a) Explain the use of toUpperCase ( ) function. Give an example. [2] (b) What are the types of casting shown by the following examples? [2]

    (i) double x = 15.2; int y = (int) x;

    (ii) int x = 12; long y = x;

    (c) What is the difference between a break statement and a continue statement when they occur in a loop? [2]

    (d) Write a Java expression for ut + ft [2] (e) The following program prints out the pattern given below: [2] 2 2 4 2 4 6 2 4 6 8

    Some parts of the program are marked by ?1? , ?2? ,?3? , ?4? that must be replaced by statements so that the program works correctly.

    void whyPattern() { for(int i=?1?; i

  • JAVA FOR SCHOOL SAMPLE PAPER 5 Making Java Fun To Learn ICSE (Class X) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    3

    TSP005 www.javaforschool.com Turn over

    SECTION B (60 Marks)

    Attempt any four questions from this Section.

    The answers in this Section should consist of the Programs in either Blue J

    environment or any program environment with Java as the base.

    Each program should be written using Variable descriptions/Mnemonic Codes

    such that the logic of the program is clearly depicted.

    Flow-Charts and Algorithms are not required.

    Question 5.

    A class Compound is created to calculate the compound interest using:

    = + Where P - is the Principal amount, r rate of interest and t time period in years. Data members of class : pamt, rate (double data type to store principal amount and rate of

    interest), time (integer to store time period) Functions of the class :

    (i) Compound ( ) constructor to assign default values to all the data members. (ii) void input( ) to input the principal, rate and time from the user. (iii) double findInterest( ) to find and return compound interest using the given formula. (iv) void printData( ) to print the principal, rate and time. Write a main function to input required data and by invoking suitable functions print the entered data and compound interest. [15] Question 6.

    A hotel is giving seasonal discount on the total amount to be paid by the person staying at the time of check out. The charges for one day stay is `850.0 per room. The discount will be given as per the following criteria:

    Number of days stayed Discount on total amount Upto 5 days 10% > 5 days and 10 days and

  • JAVA FOR SCHOOL SAMPLE PAPER 5 Making Java Fun To Learn ICSE (Class X) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    4 TSP005 www.javaforschool.com

    Question 8.

    Write a menu driven program to perform the following operations using switch-case.

    (a) Compute and display the sum of the following series: S = 1 2 + 3 n terms (b) Input an integer and print the sum of first and last digits of that number.

    Example: Input : n = 8452 Output : Sum of first and last digit = 8+2 = 10 Question 9.

    (a) Write a program to accept a String. Convert the string to Uppercase. Count and output the number of double letter sequences that exist in the string. Sample Input : "SHE WAS FEEDING THE LITTLE RABBIT WITH AN APPLE" Sample Output : 4 [7]

    (b) Write a program to accept a String and convert its into its Piglatin form. To translate word into a Piglatin word, convert the word into Uppercase and then place the first vowel of the original word as the start of the new word along with the remaining alphabets. The alphabets present before the vowel being shifted towards the end followed by "AY". Sample Input (1) : London, Sample Output (1) : ONDONLAY Sample Input (2) : Olympics, Sample Output (2) : OLYMPICSAY [8]

    Question 10.

    Write a menu driven program to generate a triangle or a pyramid based upon the users choice:

    (a) A A B A B C A B C D A B C D E

    (b) A B B C C C D D D D E E E E E

    Example 1:

    Input: Type 1 for a Triangle or Type 2 for a Pyramid: 1 Output: A

    A B A B C A B C D A B C D E

    Example 2:

    Input: Type 1 for a Triangle or Type 2 for a Pyramid: 2 Output: A

    B B C C C D D D D E E E E E [15]

  • JAVA FOR SCHOOL SAMPLE PAPER 4 Making Java Fun To Learn ICSE (Class X)

    This Paper consists of 3 printed pages and 1 blank page.

    TSP004 www.javaforschool.com Turn over

    COMPUTER APPLICATIONS (Theory)

    (Two hours)

    Answers to this Paper must be written on the paper provided separately.

    You will not be allowed to write during the first 15 minutes.

    This time is to be spent in reading the question paper.

    The time given at the head of this Paper is the time allowed for writing the answers.

    This Paper is divided into two Sections.

    Attempt all questions from Section A and any four questions from Section B.

    The intended marks for questions or parts of questions are given in brackets [ ].

    SECTION A (40 Marks)

    Attempt all questions

    Question 1.

    (a) What is Data Hiding? [2] (b) What is meant by private visibility of a method? [2] (c) Find and correct the errors in the following program segment. [2]

    int n[ ] = (2,4,6,8,10); for(int i=0;i

  • JAVA FOR SCHOOL SAMPLE PAPER 4 Making Java Fun To Learn ICSE (Class X)

    2 TSP004 www.javaforschool.com Turn over

    Question 4.

    (a) State the output of the following program segment: [2] int i=1;

    int s[ ]={2,4,6,7,8,9,10}; while(i

  • JAVA FOR SCHOOL SAMPLE PAPER 4 Making Java Fun To Learn ICSE (Class X)

    3 TSP004 www.javaforschool.com Turn over

    Question 8.

    A Credit card company allows a limit to spend `15000 to its clients. It also offers a cash back facility according the table shown below. Input the amount spent by the use and display the cash back amount he is entitled to. Use minimum number of conditions to solve the problem. Amount (in `) Cash Back (in `) First 1000 100 Next 2000 200 + 2% of amount exceeding 1000 Next 4000 400 + 4% of amount exceeding 3000 Next 8000 800 + 8% of amount exceeding 8000

    Write a program to declare the class 'Credit' that takes in the name of the client and the amount spend by him. Calculate the cash back amount and print it along with all the other details. [Note: Perform this for 20 clients. Hint: Use Arrays] [15] Question 9.

    (a) A "XYZ Bank Ltd." accepts for one year or more and the rule that bank adopts for paying the interest is as follows: (i) If a deposit is less than ` 2000 and it is for 2 years or more, the interest rate is 5% compounded annually. (ii) If a deposit is ` 2000 or more but less than ` 6000 and for 2 years or more, the

    interest rate is 7% compounded annually. (iii) If a deposit is more than ` 6000 and it is for 1 year or more, the interest rate is

    8% compounded annually. (iv) On all deposits for 5 years or more, interest is 9.75% compounded annually. (v) On all other deposits not under the above conditions, the interest is 3% compounded annually. Write a program to input amount to deposit and number of years. Calculate the interest and total balance amount after the given number of years. Print amount deposited, number of years, interest gained and total amount paid after the given years. [8]

    (b) The production (P) of crude oil of a country in millions of barrels may be estimated by the following set of instructions: P = 5 + 3t, for 0 < t < = 3 P = 14 + (t 5/2), for t >3

    Write a program in Java to find the quantity of production for every year t = 1 to 10 and print it. [7]

    Question 10.

    (a) Write a program to find the sum of the following series: 1 - 21 + 32 - 43 + 54 - ... upto n terms [7] (b) Write a program to compute the middle digit of a number entered. If the number does not have a middle digit, it has to give the average of the two middle digits. [8]

    All the Best.

    Dont Worry, You wont Fail

  • JAVA FOR SCHOOL SAMPLE PAPER 3 Making Java Fun To Learn ICSE (Class X) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    This Paper consists of 5 printed pages and 1 blank page.

    TSP003 www.javaforschool.com Turn over

    COMPUTER APPLICATIONS (Theory)

    (Two hours)

    Answers to this Paper must be written on the paper provided separately.

    You will not be allowed to write during the first 15 minutes.

    This time is to be spent in reading the question paper.

    The time given at the head of this Paper is the time allowed for writing the answers.

    This Paper is divided into two Sections.

    Attempt all questions from Section A and any four questions from Section B.

    The intended marks for questions or parts of questions are given in brackets [ ].

    SECTION A (40 Marks)

    Attempt all questions

    Question 1.

    (a) What is a wrapper class? Give any two examples. [2] (b) State any one difference between: [2] (i) pure and impure function. (ii) pure and mixed expression. (c) Explain the term "type-casting" with an example. [2] (d) Explain the statement "An object is an instance of a class" [2] (e) What will be the output of the following code: [2] int m=2,n=15;

    for(int i=1;i

  • JAVA FOR SCHOOL SAMPLE PAPER 3 Making Java Fun To Learn ICSE (Class X) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    2

    TSP003 www.javaforschool.com

    (b) Differentiate between nextDouble() and hasNextDouble() functions with an example. [2]

    (c) Explain Function Overloading with an example. [2]

    (d) What is the size in the memory required to store 15 elements in an Array A[] when: [2] (i) A[] is of long data type (ii) A[] is of character data type Question 3.

    (a) What is the difference between '= =' and 'equalsIgnoreCase( )' [2]

    (b) What are packages? Write the Java statement for importing a package named 'happy'. [2]

    (c) Write a Java expression for . [1]

    (d) What is the advantage of the call by value method over call by reference ? [2]

    (e) State the output of the below function when m=36, n=54? What is the method computing? [3] void calc(int m, int n)

    { while(n!=m)

    { if(n>m) n=n-m; else

    m=m-n; } System.out.println("Output = "+n); }

    Question 4.

    (a) The following program prints out the pattern given below: [4] z z y z y x z y x w

    Some parts of the program are marked by ?1? , ?2? ,?3? , ?4? that must be replaced by statements so that the program works correctly. void pattern() { char st; for(int i=1; i

  • JAVA FOR SCHOOL SAMPLE PAPER 3 Making Java Fun To Learn ICSE (Class X) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    3

    TSP003 www.javaforschool.com Turn over

    (b) Rewrite the following program segment using ternary operator : [2] if(avg>= 40 && avgy otherwise returns 'false'

    SECTION B (60 Marks)

    Attempt any four questions from this Section.

    The answers in this Section should consist of the Programs in either Blue J

    environment or any program environment with Java as the base.

    Each program should be written using Variable descriptions/Mnemonic Codes

    such that the logic of the program is clearly depicted.

    Flow-Charts and Algorithms are not required.

    Question 5.

    Define a class Student takes in the name, Roll No. and the total marks of five subjects of 20 students Each student is assigned a stream based on the following criteria:- Average marks Stream

    90 and above Science with Computers 80 89 Science without Computers 70 79 Commerce with Maths 60 69 Commerce without Maths.

    Write a program to declare the class 'Student' and calculate the average of every student and the stream assigned to them. Display the result in the format given below:

    Name Roll No. Total Marks Average Stream .. .. .. .. [15] Question 6.

    Write a program in Java to accept the name and contact numbers of 25 people. The program should ask the user for a contact number and search for it in the contact numbers array using the Binary Search technique. If the number is found, then the corresponding name is displayed otherwise a proper error message is displayed. [15]

  • JAVA FOR SCHOOL SAMPLE PAPER 3 Making Java Fun To Learn ICSE (Class X) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    4

    TSP003 www.javaforschool.com

    Question 7.

    Write a menu driven program to perform the following operations using switch-case:

    (a) Input an integer number and print the greatest and the smallest digits present in the number. Example: Input: n=2943 Output: Greatest digit = 9 and Smallest digit = 2 (b) Input a line of text from the user and create a new word formed out of the first letter of each word and convert the new word into Uppercase. Example: Input: Mangoes are delivered after Midday Output: MADAM [15]

    Question 8.

    The sum of two distances is calculated as: Distance 1 = 10 feets 24 inches Distance 2 = 5 feets 16 inches Sum of Distances = 18 feets 4 inches

    A class Distance has the following members:

    Class Name : Distance Data members : f1,f2 (integers to store the feet value of 2 distances) inc1,inc2 (integers to store the inch value of 2 distances) Member methods :

    Distance(int a, int b, int c, int d) : constructor to assign a to f1, b to inc1, c to f2 and d to inc2 void showDistance() : to display both the distances with suitable message void sumDistance() : to find the sum of distances and print it.

    Write a program in Java to input two distances and calculate their sum by applying proper adjustments. Display the final result with appropriate message. [Given 1 feet = 12 inches] [15]

    Question 9.

    Design a class to overload a function printSeries( ) as follows: [15]

    (a) void printSeries(int) to compute the series: = + ++ (b) void printSeries(String s) to print the String in the following format: Example: If s = "TIGER"

    Output: R R E R E G R E G I R E G I T [15]

  • JAVA FOR SCHOOL SAMPLE PAPER 3 Making Java Fun To Learn ICSE (Class X) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    5

    TSP003 www.javaforschool.com Turn over

    Question 10.

    A class HiArm has been defined to find whether a given number is an Armstrong number or not. Some members of the class are given below: Class name : HiArm Data members/instance variables : n : integer data to store the number. Member functions/methods : HiArm ( ) : constructor to assign 0 to n HiArm (int a) : constructor to assign a to n int sumArm (int) : to find and return the sum of cube of digits of a number void isArm ( ) : to invoke sumArm ( ) and print whether the number is

    Armstrong or not Then write the main( ) method to input a number and call the above functions as required to check whether it is an Armstrong number or not. [Note: An Armstrong number is a number which is equal to the sum of the cube of its digits. Example of an Armstrong Number is 153 = 13+53+33 = 153] [15]

  • This Paper consists of 5 printed pages.

    TSP 002 www.javaforschool.com Turn over

    COMPUTER APPLICATIONS (Theory)

    (Two hours)

    Answers to this Paper must be written on the paper provided separately.

    You will not be allowed to write during the first 15 minutes.

    This time is to be spent in reading the question paper.

    The time given at the head of this Paper is the time allowed for writing the answers.

    This Paper is divided into two Sections.

    Attempt all questions from Section A and any four questions from Section B.

    The intended marks for questions or parts of questions are given in brackets [ ].

    SECTION A (40 Marks)

    Attempt all questions

    Question 1.

    (a) What is JVM? [2] (b) What are Unary and Binary Operators? Give examples of each. [2] (c) What is an Infinite loop? Write an example of it using for-loop. [2] (d) What will be the result of the following if n = 3.5 [2] (i) Math.ceil(n) (ii) Math.round(n) (iii) Math.floor(n) (e) If x = 6, y = 4 and z = 2.3, evaluate u and v after executing successively (i) and (ii): (i) u = x + y / z; (ii) v = (x++)*z + x; [2] Question 2.

    (a) Rewrite the following program segment using switch-case : [3] char code; if(code == B || code == b) System.out.println(Businessman); if(code == F || code == f) System.out.println(Fighter); if(code == E || code == e) System.out.println(Employee); if(code == I || code == i) System.out.println(Intelligent); (b) What is exception handling? Name any one way in which Java handles exceptions. [2] (c) Which part of a function declaration differentiates between overloaded functions? [2]

  • 2 TSP 002 www.javaforschool.com

    (d) Write a Java expression for ( + ) ( + ) [2] (e) Name the Character Set followed by Java? [1]

    Question 3.

    (a) State the difference between break and continue keywords. [2] (b) Write Java statements to: [5] (i) replace all occurrences of character r with h in the String Programmer (ii) initialize a character array ch with the characters of the word Transition (iii) convert a character stored in variable test into Upper Case (iv) write the prototype of a method that returns true/false and takes 2 strings as parameters (v) input an integer using Scanner class object sc (c) Write a for loop statement that initializes a loop variable k as 100, decrements it by 1 in every pass and executes the loop body infinite no. of times.? [1] (d) Give the output in the following function and also write what mathematical operation it carries out if value of n = 10: void test1(int n) { for(int i=1; i< = n; i++) { System.out.println (++i); } } [2]

    Question 4.

    (a) Fill in the blank numbers from ?1? to ?5? in the following program that attempts to sort an array A[ ] of 15 integers in descending order using the Bubble sort technique: [5]

    void BubbleSort ( int a[ ] ) { int t = __?1?__ ; for(int i = 0 ; i < __?2?__ ; i++) { for(int j = 0 ; j < __?3?__ ; j++) { if(____?4?____) { t = a[j]; ___?5?___ a[j+1] = t; } } } }

  • 3 TSP 002 www.javaforschool.com Turn over

    (b) Write Java statements to: (i) convert the String 543 into an Integer. (ii) convert the double value 21.5 into a String [2]

    (c) Given the following code, answer the questions that follow: [3] class Academic { int x,y; void access( ) { int a,b; Academic student = new Academic( ); System.out.println(Object created); } }

    (i) What is the object name of class Academic? (ii) Name the class variable used in this program. (iii) Write the local variable used in this program.

    SECTION B (60 Marks)

    Attempt any four questions from this Section.

    The answers in this Section should consist of the Programs in either Blue J

    environment or any program environment with Java as the base.

    Each program should be written using Variable descriptions/Mnemonic Codes

    such that the logic of the program is clearly depicted.

    Flow-Charts and Algorithms are not required.

    Question 5.

    Create a class SalaryCalculation that is described as below:

    Class Name : SalaryCalculation

    Data members : name (String type data) basicPay, specialAlw, conveyanceAlw, gross, pf, netSalary, AnnualSal (All double type data)

    Member methods :

    (i) SalaryCalculation( ) - A constructor to assign name of employee (name), basic salary (basicPay) of your choice and conveyance allowance (conveyanceAlw) as ` 1000.00

  • 4 TSP 002 www.javaforschool.com

    (i) void SalaryCal( ) - to calculate other allowances and salaries as given: specialAlw = 25% of basic salary. gross = basicPay + specialAlw + conveyanceAlw. netSalary = gross - pf. AnnualSal = 12 months netSalary. (i) void display( ) - to print the name and other calculations with suitable headings. Write a program in Java to calculate all the details mentioned above and print them all. [15]

    Question 6.

    Write a program to accept a string. Convert the string to uppercase. Count and output the number of Consecutive letter pairs that exist in the string.

    Sample Input: IT WAS NOT TOUGH FOR HIM TO RESIDE ABOVE THE HILL

    Sample Output: Number of consecutive pair of characters = 6 [15]

    Question 7.

    Using the switch statement, write a menu driven program to:

    (i) Generate and display the following pattern: 1 2 4 1 3 5 2 4 6 8 1 3 5 7 9

    (ii) Input a number and check whether it is an automorphic number or not. An automorphic number is a number which is present in the last digit(s) of its square. Example: 25 is an automorphic number as its square is 625 and 25 is present as the last digits

    For an incorrect choice, appropriate error message should be displayed. [15]

    Question 8.

    Design a class to overload a function print ( ) as follows: [15]

    (a) void print (int x, int y) to print the odd numbers between the x and y. (b) void print (char ch1, char ch2) to print all the consonants between the 2 characters ch1 & ch2. (c) void print (char ch, int n) to print the character ch, n number of times in the given format: Example: If ch = $ and n = 4 Output: $ $ $ $ $ $ $ $ $ $

  • 5 TSP 002 www.javaforschool.com Turn over

    Question 9.

    Write a program in Java to input a number from the user and print the frequency of each digits present in it.

    Example:

    Input : 43457973

    Output : Digit Frequency 4 2 3 2 5 1 7 2 9 1

    [Note: Only those digits should be printed which are present in the number] [15]

    Question 10.

    Write a program in Java to accept the name and weight of 20 of your friends. Store the weight in a double type array weight [ ] and the name in a String type array name [ ]. Then sort the name of your friends in ascending order of their weights and finally print the result. [15]

  • This Paper consists of 4 printed pages.

    TSP 001 www.javaforschool.com Turn over

    COMPUTER APPLICATIONS

    (Theory)

    (Two hours)

    Answers to this Paper must be written on the paper provided separately.

    You will not be allowed to write during the first 15 minutes.

    This time is to be spent in reading the question paper.

    The time given at the head of this Paper is the time allowed for writing the answers.

    This Paper is divided into two Sections.

    Attempt all questions from Section A and any four questions from Section B.

    The intended marks for questions or parts of questions are given in brackets [ ].

    SECTION A (40 Marks)

    Attempt all questions

    Question 1.

    (a) Name any two Object Oriented Programming (OOP) principles. [2] (b) Give an example of a Relational operator and a Bitwise Operator. [2] (c) State one similarity and one difference between while and do-while loop. [2] (d) What is a compound statement? Give an example. [2] (e) Find the value of c where x = 0, y = 10.25, z = -5 c =(x + y * z / 2.5) [2]

    Question 2.

    (a) Explain with the help of an example, the purpose of default in a switch-case construct. [2] (b) Give an example each for: (i) Runtime Error (ii) Syntax Error (iii) Logical Error [2] (c) Differentiate between equals ( ) and compareTo ( ) functions. [2] (d) Write a Java expression for 6 + 25 / [2] (e) Write Java statements to find if a character variable called var contains an alphabet or not. [2]

    Question 3.

    (a) What is the purpose of: (i) new operator [2] (ii) this keyword [2]

  • 2 TSP 001 www.javaforschool.com

    (b) Write Java statements to check if the 5th element of an array X [10] is divisible by 2. [2] (c) What is a constructor and what is its use? [2] (d) Give the output in the following function definitions and also write what mathematical operation it carries out if value of n = 7: void test1(int n) { for(int x=1; x< = n; x++) if(n%x = = 0) System.out.println (x); } [2]