0% found this document useful (0 votes)
2 views

Computer Application

This document is a promotional examination paper for Grade 9 Computer Applications at Carmel School, Bengaluru, with a total of 100 marks. It includes various sections with questions on Java programming concepts, syntax, data types, loops, and practical programming tasks. The exam is structured into two sections, with Section A focusing on theoretical questions and Section B on practical programming assignments.

Uploaded by

mantrimegha1083
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
2 views

Computer Application

This document is a promotional examination paper for Grade 9 Computer Applications at Carmel School, Bengaluru, with a total of 100 marks. It includes various sections with questions on Java programming concepts, syntax, data types, loops, and practical programming tasks. The exam is structured into two sections, with Section A focusing on theoretical questions and Section B on practical programming assignments.

Uploaded by

mantrimegha1083
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 4
CARMEL SCHOOL Padmanabhanagar, Bengaluru ~70 Promotional Examination — 2023 — 24 GRADE-9 Subject: Computer Applications Time:2 hours Max Marks: 100 “Answers fo thls Paper must be written on the paper provided separately. You will not be allowed to write during the first 1Sminutes, This time isto be spent in reading the question paper. The time given at the head of this paper is the time allowed for writing the answers. The intended marks for questions or parts of questions are given in brackets |} ‘SECTION A (40 Marks) Attempt all questions I. Name the following: 4] a) Data type used to declare a variable to store a number in the range of -128 to 127. b) Keyword used to define a block in switch that gets executed when there is no matching case ¢) Non-executable statements in a java program. 4) Selection statement which checks only for equality. IL, Write the syntax for the following: [4] a) if-else statement b) while loop IIL. Give one example for each of the following: 21 a) Escape sequence character ») short hand operator I. Write the java expression for the following: 21 3 a) Result am II. Define the following: PR a) Encapsulation b) Token IIL. Arrange the following data types in the ascending order of their size: RI ) float b) short ©) long, 4) boolean IV. Write a single java statement for the following: 2) a) To check if the value of the variable, x is in the range of 200 to 300. ) To declare and initialize a variable, ch with the last uppercase vowel. V. Write one difference for the following: RI a) if-else if statement and switch statement b) Identifier and keyword Question 1, Convert the given for loop to while loop: a) for(int a=10; a<=30; a+=5) if(a>10) System.out.printin (“a="*+a); IL, Rewrite the following using ternary operator: a) iffx++ +y/2 >6) System.out.printin(x-5); else System.out.printin(x+5); TIL. Rewrite the following using if-else if statement: a) char c; switch(c) { case 'm': a+=10; case 'n' : a*=S;break; default: System.out.printin("Invalid"); ) TV. Name the type of conversion in the following expressions: a) int x=12; double y=12.0; double z=x*y; b) char ch=78; V. Evaluate the following expression and write the values of a and b: a) int a=7, b=5; atsatt + that --b; VI. Write the output for the following: (show the working) a) int a=100, b=250, c= -200; System.out.println(!((w>=b)|(b>o))); System.out printin("output is "+!((a<=c) && (b>=c))); b) double x= -80.7, y= -48.3; ‘System.out printIn(Math.abs(Math.max(x,y))); System.out printin(Math.sqrt(Math.abs(Math.round(x)))); ©) System.out.print("*Knowledge is Power”); System.out.print("\n\*Practice makes perfect\"\n\n"); VI1) How many times the following loop is executed? (show the working) a) for(int i=1;i<=15,i++) i4=3; 2) 2] 2) (2) BI RI I + Sample Input: VHD) Name the method defined in Math class to display the following: a) Square root of the given number. b) Smallest of any two numbers. SECTION B (60 Marks) PART-A(Compulsory Question) Question 4 ) Define infinite loop. Give an example of infinite loop using while loop. ii) Write a short note on UNICODE character set iii) Explain the following features of java. a) Multithreading b) Robust iv) Explain byte code. Give its file extension. v) Identify and name the category of the given literals: a) 23.67 by ©) false 4)"123" vi) Write the return type of the following methods: a) Math.pow( ) b) Math round( ) PART-B(Atter ny three qui is ) Write Variable Description) Question 5 Write a menu driven program to perform the following by accepting two integer numbers(m&n). Choice 1: Display all the numbers from m to m that are divisible by both 5 and 7. (use while loop) ‘ Sample Input: m=20, n= 100 Sample Output: The numbers divisible by both 5 and 7 are: 35 70 Choice 2: Display the value of m for n number of times(use for loop). =700, n=3 Sample Output: 700 is displayed 3 times: 700 700 700 aa [2] (2) [4] (3) 21 2) (15) Question 6 15] ‘A travel agency gives the following car rentals for its customers. | Type of the car | Distance Travelled(kms) | Charge(in Rs.) ‘AC (A) Upto 200 2000 More than 200 20007%20/km for above 200 kms ‘Non-AC(N) Upto 200, 1500 More than 200 1500+210/km above 200 kms Write a program to accept the customer’s name, type of the car (A/N) and the distance travelled to calculate and display the total bill amount based on the given criteria. The agency charges an additional amount of 71000 towards maintenance. Question 7 (15) ‘An amusement park gives the discount on the ticket amount based on the age of a person. WAP to accept name of the user, age and ticket ammount to calculate the discount and the total amount to be paid with a tax of 18% on the amount. Age Discount (on ticket amount) | ‘upto 10 years | 40% |L More than 10 and less than or equal to 60 25% | | sge>60 50% | Display the ticket in the following format. Name Age Discount Amount Pay 8 ae Hee wane Question 8 (15) Write a program to accept a 3digit number and display the middle digit in words. If the number is not a 3- digit number, display the message “Invalid input”. ‘Sample Input: if the number entered is 284 Sample Output: The middle digit present in 284 is eight. seneeees 4

You might also like