Formatting page ...
MADHUSTHALI VIDYAPEETH F.M 100 Time 2h Date : ANNUAL EXAMINATION : 2020-2021 SUBJECT: COMPUTER APPLICATIONS CLASS- IX Answers to this Paper must be written on the paper provided separately. You will not be allowed to write during the first 15 minutes. This time is to be spent in reading the question paper. The time given at the head of this Paper is the time allowed for writing the answers. This Paper is divided into two Sections. Attempt all questions from Section A and any four questions from Section B. The intended marks for questions or parts of questions are given in brackets [ ]. SECTION A (40 Marks) Attempt all questions Question 1 (a) Name any four tokens of Java. (b) Define encapsulation. (c) What is an identifier? (d) Differentiate between primitive and non-primitive data-types. (e) Why is class called an object factory? Question 2 (a) Differentiate between = and == operators. (b) Differentiate between break and System. exit(0). (c) What is OOP? Name two OOP languages. (d) State the difference between if-else if ladder and switch...case. (e) State the difference between compiler and interpreter. Question 3 (a) State the type of errors if any in the following statements: switch ( n > 2 ) System.out.println(100/0); (b) What will be the output of the following code? float x = 7.87; System.out.println(Math.ceil(x); System.out.println(Math.floor(x); (c) What will be the output of the following program segments? (i) Math.pow(25,0.5)+Math.ceil(4.2) Math.round ( 14.7 ) + Math.floor ( 7.9) (ii) (iii) String a="Java is programming language \n developed by \t\'James Gosling\'"; System. out. println(a); [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] int a = 0; if(a>0 && a<20) a++; 1 else (iv) (v) a-- ; System.out.println(a); [2] int a= 5, b = 2, c; if (a>b || a ! = b) c = ++a+--b; System.out.print(c+ +a+ +b); [2] int i = 1; while(i++<=1) { i++; System.out.print(i + ); } System.out.print(i); [2] (d) What is the value of z in int x =20, y = 10, z; z = ++x * (y ) y ? [2] ( + )3 (e) Write a statement in Java for | | [2] (f) What is the value of m after evaluating the following expression: m - = 9%++n + ++n/2; when int m=10, n=6 [2] SECTION B (15x4 = 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 A pre-paid taxi charges from the passenger as per the tariff given below: Write a program to input the distance covered and calculate the amount paid by the passenger. The program displays the printed bill with the details given below: Distance covered ________ Amount ________ Question 5 The equivalent resistance of series and parallel connections of two resistances are given by the formula: 2 (a) R1 = r1 + r2 (Series) (b) R2 = (r1 * r2) / (r1 + r2) (Parallel) Using a switch case statement, write a program to enter the value of r1 and r2. Calculate and display the equivalent resistances accordingly. Question 6 Write a program to input three angles of a triangle and check whether a triangle is possible or not. If possible, then check whether it is an acute-angled triangle, right-angled or an obtuse-angled triangle, otherwise display Triangle not possible . Sample inputs: Enter three angles: 40, 50, 90 Sample output: Right-angled triangle Question 7 Write a menu-driven program to perform the following tasks by using the switch-case statement: a) To print the series 0, 3, 8, 15, 24, to n terms. b) To find the sum of the series: S = 1/2 + 3/4 + 5/6 + 7/8 + + 19/20 Question 8 Write a program to accept a number from user and check whether it is a palindrome number or not. A number is palindrome which when read in reverse order is same as in the right order. Question 9 Write a program to input a number and evaluate the results based on the number entered by the user: a) Natural logarithm of the number. b) Absolute value of the number. c) Square root of the number. d) Cube of the number. e) Random number between 0 and 1. 3
|