Trending ▼   ResFinder  

ICSE Prelims 2018 : Computer Applications

5 pages, 6 questions, 0 questions with responses, 0 total responses,    0    0
Chandralekha.C
Dr. Dasarathan International School (Dr DIS), Coimbatore
+Fave Message
 Home > drdasarathan >

Formatting page ...

Dr. DASARATHAN INTERNATIONAL SCHOOL, COIMBATORE-17 (ICSE) (Affiliated to the Council for the Indian School Certificate Examinations, New Delhi) FIRST MODEL EXAMINATION-2017 CLASS: X COMPUTER APPLICATIONS MAX MARKS: 100 Time : 2Hrs TIME: 2hrs SECTION A(40 MARKS) Question 1 a. Define Data Abstraction. In what way it is implemented in OOP. [2] b. State the difference between a boolean literal and a character literal. [2] c. Write one word answer for the following. [2] i. The default initial value of a character data type ii. A method that converts a string to a primitive integer data type. d. Write the function prototype for the function sum that takes an integer variable x as its argument and returns a value of float data type. [2] e. Differentiate between public and private modifiers for the member of a class. [2] Question 2 a. What will be the result stored in x after evaluating the following expression? [2] int x=20; x+=(x++)+(++x)+x; b. In the program below, state the name and the value of the [2] i. method argument ii. class variable iii. instance variable iv. local variable class My { static int x=7; int y=2; void Method(int n) { System.out.println(n); System.out.println(y); } public static void main(String args[]) {My obj = new My(); System.out.println(x); Obj.Method(5); int a=6; System.out.println(a);} c. Rewrite the following program segment using while int f=1,i; for(i=1,i<=5;i++) {f*=i; System.out.println(f);} d. Write the difference between length and length() functions. [2] e. Write an expression for [2] [2] Question 3 a. Give the output of the following program snippet. [2] void func(int a,int b) { int x=a/b; int y= a%b; System.out.println(x+ +y); } If func(5,2) is invoked. b. Analyse the following program segment and determine how many times the body of the loop will be executed .(show the working) [2] x=5; y=50; while(x<=y) {y=y/x; System.out.println(y);} c. Give the output of the following [2] double m=6.25, n=7.45; System.out.println(Math.sqrt(m)); System.out.println(Math.min(m,n)); System.out.println(Math.abs(m-n)); d. Predict the output boolean p; boolean q; i. p= ( BlueJ .length()> ABCDE .length())?true:false; ii. q=( Fun is Computing .startWith( Fun ))?true:false; e. Give the output of the following program snippet: char p= J ; int a = 15; char l = c ; float b=19.99; System.out.println((int)p+a)); System.out.println((int)l+b)); f. Given int p[]={10,20,30,40,50}; p[0]=5; p[3]=p[1]; int m = p[1]-p[0]; int n= p[3]+20+p[2]; System.out.println( The difference : +m); [2] [2] [2] System.out.println( The sum is : +n); g. Mention any two attributes to declare a class. h. Give the output of the given program public class check { public static void main(String args[]) { int m=10; int n = 8; if((m-2) ==n) System.out.println(Math.pow(m,2)); else System.out.println((m*m)-Math.pow(n,2)); }} i. What is the data type that the following library functions return? i. Character.toUpperCase(); ii. trim(); j. Name the function to perform the following tasks: i. to change all the capital letters to small letters of a word. ii. to take out one character from a specified position of a word. iii. to find the number of characters in a word iv. to join two words [2] [2] [2] [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 [15] The Cab Service is an organisation that provides Online Booking for the passengers to avail pick up and drop facility. Define a class Cabservice having the following specifications: Class name :Cabservice Instance variables/data members: String taxino: to store taxi number String name: to store name of the passenger int d: to store the distance travelled (in km) Member methods/functions: Cabservice(): constructor to initialize as: taxino=0, name= ,d=0 void input(): to store taxino, name and d void calculate(): to calculate bill for a customer as per the tariff given below: Distance Travelled(km) Rate/km Up to 1 km 25 More than 1 km and up to 5 km 30 More than 5 km and up to 10 km 35 More than 10km and up to 20 km 40 More than 20km 45 void display(): to display the details in the following format: Taxino Name Distance(km) Bill Amount ****** ***** ********* *********** Write main method, create object and call all the above member methods. Question 5 [15] Write a menu driven program using switch case to output the following: void palin(int n): to check whether the given number is palindrome or not void word(String s): to check whether the given string is palindrome or not Question 6 [15] Design a class to overload a function pattern() as follows: void pattern(char ch, int n): with one character and one integer arguments and prints n lines containing the character stored in ch in the following pattern $ $$ $$$ double pattern(double x, double n) with two double arguments and returns the sum of the series, s= Question 7 [15] Write a program to accept the year of graduation from school as an integer value from the user. Using binary search technique on the sorter array of integers given below, output the message Record exists if the value is located in the array. If not, output the message Record does not exists . Array elements: a[]={1982,1987,1993,1996,1999,2003,2006,2007,2009,2010} Question 8 [15] Write a Program in Java to input a number and check whether it is a Pronic Number or Heteromecic Number or not. Pronic Number : A pronic number, oblong number, rectangular number or heteromecic number, is a number which is the product of two consecutive integers, that is, n (n + 1). The first few pronic numbers are: 0, 2, 6, 12, 20, 30, 42, 56, 72, 90, 110, 132, 156, 182, 210, 240, 272, 306, 342, 380, 420, 462 etc. Question 9 [15] Write a program to find the shortest and the longest word in a sentence and print them along with their length. Sample Input: I am learning Java Sample Output: Shortest word = I Length = 1 Longest word = learning Length = 8

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

 

  Print intermediate debugging step

Show debugging info


 

 

© 2010 - 2025 ResPaper. Terms of ServiceContact Us Advertise with us

 

drdasarathan chat