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

  • 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
  • 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
  • Good Essays

    Array Structure Paper

    • 833 Words
    • 4 Pages

    “An array is a collective name given to a group of similar quantities. These similar quantities could be percentage marks of 100 students, number of chairs in home, or salaries of 300 employees or ages of 25 students. Thus an array is a collection of similar elements. These similar elements could be all integers or all characters, and so on” (Thompson, 2007). Building an array can be confusing for the Bug Blasters can be very confusing for a programmer who does not fully understand how they work.…

    • 833 Words
    • 4 Pages
    Good 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

    6. Data hiding, which means that critical data stored inside the object is protected from code outside the object is accomplished in Java by _____.…

    • 1518 Words
    • 7 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
  • Satisfactory Essays

    AP English Nortos

    • 278 Words
    • 2 Pages

    A reference is something that is in relation to, or is connected to something else. In her novel, Rhys uses reference several times towards the practices of zombification and obeah. As Antoinette follows Christophine into her house, Antoinette notices a heap of chicken feathers. Rhys writes, “But after I noticed the heap of chicken feathers in one corner, I did not look round anymore” (Rhys 117). When it comes to zombification chicken feathers, especially ones from a male are said to be one of the things used. Antoinette, while sitting in Bertha’s room with her, noticed white powder that was all over the floor. Rhys writes, “As I stepped into her room I noticed the white powder strewn all over the floor” (136). White powder is another substance that was said to be used in obeah and zombification.…

    • 278 Words
    • 2 Pages
    Satisfactory 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
  • 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
  • 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