Posts

Showing posts from February, 2018

ICSE Class 10 - Computer Application Important Program (15 Marks)

Program 1-  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 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 and fine charged at the rate of Rs.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. Solution -  public class Library {     int acc_num;     String title;     String author;     public void input() throws IOException {         BufferedReader br = new BufferedReader(new InputStreamReader(System.in));         System.out.print("Enter accession number: ");         acc_num = Integer.parseInt(br.readLine

ICSE Class 10 - Computer Application Important Questions & Answers (2 Marks)

02 (Two) Marks Questions  Question 1- Give one example each of a primitive data type and a composite data type. Ans.  Primitive Data Types – byte, short, int, long, float, double, char, boolean Composite Data Type – Class, Array, Interface Question 2- Give one point of difference between unary and binary operators.  Ans.  A unary operator requires a single operand whereas a binary operator requires two operands. Examples of Unary Operators – Increment ( ++ ) and Decrement ( — ) Operators Examples of Binary Operators – +, -, *, /, % Question 3- Differentiate between call by value or pass by value and call by reference or pass by reference. Ans.  In call by value, a copy of the data item is passed to the method which is called whereas in call by reference, a reference to the original data item is passed. No copy is made. Primitive types are passed by value whereas reference types are passed by reference. Question 4- Write a Java expression for (under root