Preview

Computer Application Paper Solved 2012

Good Essays
Open Document
Open Document
1978 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Computer Application Paper Solved 2012
Computer Applications
Class X
(Time: Two Hours) SECTION A (40 Marks)
Answer all questions from this Section
Question 1.
(a)Give one example of a primitive data type and composite data type. [2]
Ans. Primitive type: byte/short/int/long/float/double/char/boolean
Composite type: classes/interface/arrays
(b) Give one point of difference between unary and binary operators. [2]
Ans. Unary operators work on a single operand eg. ++a while binary operators work on two operands eg. a+b
© Differentiate between call by value or pass by value and call by reference or pass by reference [2]
Ans. Call by value method creates a new copy of formal parameters and the changes made to them in the called function are not reflected on the actual arguments in the calling function. They work for primitive data types while call by reference method does not create a new copy rather works on the reference of actual arguments and changes made to them in the called function are reflected in the calling function. They work for reference data types.
(d) Write java expression for √2as+u2 [2]
Ans. double d= Math.sqrt((2*a*s + u*u));
(e) Name the type of error (syntax, runtime or logical error) in each case given below: [2]
Ans. (i) Division by a variable that contains a value of zero : Runtime error
(ii) Multiplication operator used when the operation should be division : Logical error
(iii) Missing semicolon: Syntax error
Question 2.
(a) Create a class with one integer instance variable. Initialize the variable using :
(i) Default constructor
(ii) parameterized constructor
Ans.
class Initialize
{
int x; //instance variable
Initialize() //default constructor
{
x=0;
}
Initialize(int a) //parameterized constructor
{
x=a;
}
}
(b) Complete the code given below to create an object of Scanner class: [2]
Ans. Scanner sc=new Scanner (System.in); © What is an array? Write a statement to declare an integer array of 10

You May Also Find These Documents Helpful

  • Satisfactory Essays

    PT1420 Chapter 3 Review

    • 1062 Words
    • 8 Pages

    4. Assume the variables result, w, x, y, and z are all integers, and that w = 5, x = 4, y = 8, and z = 2. What value will be stored in result in each of the following statements?…

    • 1062 Words
    • 8 Pages
    Satisfactory Essays
  • Satisfactory Essays

    b. Include the function written in Exercise 2a in a working program. Make sure your function…

    • 720 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Nt1310 Unit 4 Lab

    • 252 Words
    • 2 Pages

    ➢ To define a class of your own and use it to create an object.…

    • 252 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    b. Should “problem” = an issue in the code that is preventing it from executing, than the first thing I would imagine being done is to look over the program for syntax errors and logic errors. (While I know that syntax is usually the culprit for error, I may as well look for the both of them if I’m going to be going over code line by line.)…

    • 848 Words
    • 4 Pages
    Satisfactory Essays
  • Satisfactory Essays

    unit 3

    • 313 Words
    • 2 Pages

    4. Assume the variables result, w, x, y , and z are integers, and that w=5, x=4, y=8, and z=2. What value will be stored in result in each of the following statements?…

    • 313 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    the old man and the sea

    • 2158 Words
    • 23 Pages

    Using the quick tests for locating errors, find the error in each of the two questions below. Describe the type of error, explain how you discovered it, and make corrections.…

    • 2158 Words
    • 23 Pages
    Good Essays
  • Good Essays

    Column chromatography was invented by Tswett in 1906 so that his study of the chemistry of chlorophyll could be facilitated. Tswett made significant advances in the method and demonstrated its applicability to the separation of many different kinds of mixtures. Column chromatography rapidly found application in all areas of chemistry and is used extensively today because it is a simple but powerful tool for the separation of pure compounds from a complex mixture. It cannot affect the same degree of separation as TLC, but its advantage over TLC is the fact that large amounts of mixtures (over 5 g) can easily be treated by this method. There are, however, a number of important similarities between TLC and column chromatography which, when the two methods are used in complementary fashion, allow preparative separations to be accomplished easily and quickly. The same comments that were made concerning adsorbents and solvents for TLC apply also to column chromatography. In particular, by using TLC initially to determine a solvent system for separation of a mixture, one can quickly find the solvent system that will effect separation of the same mixture on a column of the same adsorbent. (In other words, if a particular solvent system effects separation on, say, alumina with TLC, a very similar solvent system will effect separation of a column, provided that alumina of the same type is used as adsorbent.…

    • 721 Words
    • 3 Pages
    Good Essays
  • Powerful Essays

    4. Assume the variables result, w,x, y, and z are all integers, and that w= 5, x= 4, y=8 and z=2. What will the values be stored in result in each of the following statements?…

    • 748 Words
    • 3 Pages
    Powerful Essays
  • Powerful Essays

    In the medieval period in a town with summoner and friar; on the road out of town with summoner. the devil and the man with his cart and at old woman’s house with old woman, summoner and devil.…

    • 855 Words
    • 3 Pages
    Powerful Essays
  • Satisfactory Essays

    c. Identify the objective of your call and the way in which you expect the call to end.…

    • 308 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    1. The unifying title: “Chained Down” There is a possibility that every person has their problems that chained them down. If they want to be freed from the chains that keep them down, all they need is the dedication to free themselves from their shackles. All three essays show the protagonist having issues with situations that pressure them. 2.…

    • 851 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    Java Programming I Exam

    • 912 Words
    • 4 Pages

    ____ are pieces of information that are sent into, or passed to, a method, usually because the method requires the information to perform its task or carry out its purpose.…

    • 912 Words
    • 4 Pages
    Satisfactory Essays
  • Better Essays

    Women Calling Research Paper

    • 4684 Words
    • 19 Pages

    Now, the term “calling” has also been defined in a variety of ways. Hall and Chandler…

    • 4684 Words
    • 19 Pages
    Better Essays
  • Powerful Essays

    End FunctionThe name of a function follows the same rules and suggestions we reviewed for sub routines. The DataType factor indicates the type of value that the function will return. If the function will produce a word or a group of words, you can create it as String. If the function will check something and determine whether it produce a true or a false value, you can create it as Boolean. The other data types are also valid in the contexts we reviewed them. As mentioned already, the section between the Function and the End Function lines is the body of the function. It is used to describe what the function does. As done on a sub routine, one of the actions you can perform in a function is to declare a (local) variable and use it as you see fit. Here is an example:…

    • 2932 Words
    • 12 Pages
    Powerful Essays
  • Good Essays

    The macro name and parameters define a pattern or prototype for the macro instructions used by the programmer. Following the MACRO directive are the statements that make up the body of the macro definition.…

    • 693 Words
    • 3 Pages
    Good Essays

Related Topics