Preview

Java Model Test Papers for Icse

Good Essays
Open Document
Open Document
22711 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Java Model Test Papers for Icse
Test Paper ONE
SECTION A (40 MARKS)

Question 1.
(a) Name two types of programming technique with examples. [4]
Ans. Structured Programming (eg, C, BASIC); Object Oriented Programming (eg, C++, JAVA)

(b) Explain type casting with an example. [2]

Ans.The explicit conversion of a wider data-type into a narrower data-type is called type-casting.

Example: double a = 3.567; int b = (int) a / 10; //typecast double to int

(c) Evaluate a – (b++) * (--c), given a=2, b=3, c=9 [2]

Ans. 2 – 3 * 8 = -22 (d) Write the following expressions in Java: [2] square toot of the sum of squares of a and b

Ans. Math.pow ( (a*a + b*b) , 0.5)

Question 2.
(a) Give an example of local, of instance and of static variable [3]
Ans. Static variable: Math.PI Instance variable: b1.mks (where b1 is an object of class Boy) Local Variable: integer I in the loop: for (int I = 0; I < 5; I++)

(b) Mention two points of differences between binary and linear search. [4] Ans. (i) Binary Search is faster, since the number of iterations is halved at each pass. Linear Search is slower, since the number of iteration is equal to the array length.

(ii) Binary Search does pre-supposes the array to be sorted. Linear Search does not suffer from this limitation.

(c) What does the keyword this mean in Java? Give an example. [3]

Ans.The keyword this refers to the current object. It may be used to reference instance variables thus: this-dot-variable (e. g. this.mks)

Example: class Boy { int m1, m2; Boy(int m1, int m2) {this.m1 = m1; this.m2 = m2;} }

Question

You May Also Find These Documents Helpful

  • Satisfactory Essays

    The directory and file structure is not indexed, so searching within a directory with a large amount of files can be time consuming.…

    • 297 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Nt1310 Unit 1 Test Paper

    • 381 Words
    • 2 Pages

    3. Create a binary search function that tells whether a given value exists in the tree or not.…

    • 381 Words
    • 2 Pages
    Good Essays
  • Powerful Essays

    NT1430

    • 1192 Words
    • 5 Pages

    The directory and file structure is not indexed, so searching within a directory with a large amount of files can be time consuming.…

    • 1192 Words
    • 5 Pages
    Powerful Essays
  • Satisfactory Essays

    Nt1310 Unit 7

    • 468 Words
    • 2 Pages

    Answer: Advantages: The system is divided into different sub systems according to different functions hence,…

    • 468 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    I clicked Clear and did an Advanced search for the O, I used #1, #2 and #3 to do a Boolean search using the operator AND. I clicked search and the results were 44 more than just doing a basic search and not using an operator such as AND.…

    • 1351 Words
    • 8 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Encom Corporation

    • 369 Words
    • 2 Pages

    6. I believe that the 2nd method is the best. It is the most accurate in terms of the matching principle.…

    • 369 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    Java exam 1 practice test

    • 6434 Words
    • 53 Pages

    A set of instructions that enable the computer to solve a problem or perform a task…

    • 6434 Words
    • 53 Pages
    Powerful Essays
  • Satisfactory Essays

    6 8c Chapter Excercises

    • 515 Words
    • 2 Pages

    Polymorphism is the concept that a message gives different meanings to different objects. For example GOOD NIGHT message might produce different results depending if it is received by a child or the family dog. When received by the parent object the message causes the parent object to read a bedtime story. When received by the dog object it causes the dog to go to sleep and when received by the child object it causes the child to get ready for bed.…

    • 515 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Jrotc Concept Papers

    • 142 Words
    • 1 Page

    There are many different types of studies in the JROTC field. Such as the army values, drill…

    • 142 Words
    • 1 Page
    Satisfactory Essays
  • Satisfactory Essays

    Write a 1,050- to 1,400-word paper in which you discuss the relationship between this simulation and environmental justice. Include the following:…

    • 95 Words
    • 1 Page
    Satisfactory Essays
  • Satisfactory Essays

    Simulation Paper

    • 1066 Words
    • 5 Pages

    In this simulation the issue that is brought up is the fact that a pharmaceutical company is making all sorts of medicines and health products. Their intention is to use the rainforests resources to make the products that is used to help people with their health from the medicines they create. This scenario has the issue of the rainforest being cut down but not kept up with when it comes to being replenished and how the rainforests are becoming desolate places. There are many different people that have a say in this matter and it is issue that has to be identified and recognized and a plan formulated to deal with it. But this issue not only includes the rainforest but the tribe who benefits from the rainforest and its natural resources who will be deprived of the land and what it can give. So not only is a plan need to be formulated for the rainforest and how to keep it intact but to also keep those that live there intact as well. The ethics of the stakeholders are those of moral standards and from what it seems is not that of selfish desires.…

    • 1066 Words
    • 5 Pages
    Satisfactory Essays
  • Good Essays

    One of the main properties of the classes is inheritance. This property allows us to create new classes from existing classes, retaining the properties of the original class and adding new ones.…

    • 290 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Linear Search Patterns

    • 1188 Words
    • 5 Pages

    The wheel/ray search is done by several investigators who move from the outside boundary to the inside boundary in a ray (like sunshine rays). They can also move from the inside to the outside boundary; however this method is not advised because evidence between the rays can be missed. A quadrant/zone pattern is done when the scene is divided into quadrants or zones and divided among the investigators to search each section. The sections can also be divided into smaller sections for a more thorough search and this method is most effective when the scene spans a large…

    • 1188 Words
    • 5 Pages
    Good Essays
  • Satisfactory Essays

    CCJ 200 Study Guide

    • 1354 Words
    • 6 Pages

    McCleskey V. ZantOn this appeal of the 1987 McCleskey case, the Court produced new standards designed to make it much more difficult for death-row inmates to file repeated appeals.…

    • 1354 Words
    • 6 Pages
    Satisfactory Essays
  • Satisfactory Essays

    3D modeling is a powerful tool for engineers. It allows an idea to be translated into a model that can communicate the concept, adapt to changes, and even create a physical model with devices such as a prototype or a mill.…

    • 209 Words
    • 2 Pages
    Satisfactory Essays

Related Topics