0% found this document useful (0 votes)
55 views6 pages

Academic Year: 2021 - 2022 Examination: Initiation Month: JULY 2021 Class: 10 Maximum Marks: 100

1. The document provides information about an examination including the academic year, month, class, maximum marks, and sections. 2. Section A contains 3 questions with multiple parts about computer programming concepts like encapsulation, parameters, and output. 3. Section B instructs students to answer 4 out of 6 questions involving programming solutions for tasks like defining a class, using switch statements in menus, calculating series, and applying discounts.

Uploaded by

Akshmit saxena
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views6 pages

Academic Year: 2021 - 2022 Examination: Initiation Month: JULY 2021 Class: 10 Maximum Marks: 100

1. The document provides information about an examination including the academic year, month, class, maximum marks, and sections. 2. Section A contains 3 questions with multiple parts about computer programming concepts like encapsulation, parameters, and output. 3. Section B instructs students to answer 4 out of 6 questions involving programming solutions for tasks like defining a class, using switch statements in menus, calculating series, and applying discounts.

Uploaded by

Akshmit saxena
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Academic Year : 2021 – 2022

Examination : INITIATION
Month : JULY 2021
Class : 10
Maximum Marks : 100
____________________________________________________________________________________
COMPUTER APPLICATIONS
(Two Hours)
____________________________________________________________________________________
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) Define encapsulation. [2]


(b) If the value of basic=1500, what will be the value of tax after the following statement [2]
is executed?
tax = basic>1200 ? 200 :100
(c) Differentiate between Formal Parameter and Actual Parameter. [2]
(d) What is the output of the following: [2]
System.out.println("Incredible"+"\n"+"world");
(e) What is meant by a package? Give an example. [2]

_______________________________________________________________________________________

This paper consists of 6 printed pages and no blank page Turn over
Question 2

(a) What are the values of a and b after the following function is executed, if the values
passed are 30 and 50:
void flew(int a ,int b)
{
a=a+b;
b=a-b;
a=a-b;
System .out.println(a+","+b);
}
(b) What is the result produced by 2 – 10*3 + 100/11? Show the steps. [2]
(c) What will be the output of the following code? [2]

int m=2;
int n=15;
for(int i = 1; i<5; i++);
m++;
--n;
System.out.println("m=" +m);
System.out.println("n="+n);
(c) Differentiate between break and System.exit(0). [2]
(e) What is the value of m after evaluating the following expression: [2]

m - = 9%++n + ++n/2; when int m=10, n=6

Question 3

(a) Write the Java expression for: [2]

|(a 2 + b2 )/2ab|

_______________________________________________________________________________________
2
(b) What are the types of casting shown by the following examples: [2]

(i) char c = (char)120;

(ii) int x = 't';

(c) Predict output of the following: [4]

(i) Math.pow(25,0.5)+Math.ceil(4.2)

(ii) Math.round ( 14.7 ) + Math.floor ( 7.9)

(d) Differentiate between static and non-static data members. [2]

(e) State the type of errors if any in the following statements: [2]

(i) switch ( n > 2 )

(ii) System.out.println(100/0)

(f) What is the purpose of default in a switch? [2]

(g) State the difference between do while and while loop. [2]

(h) What will be the output of the following program segments? [2]

(i) int a = 0;

if(a>0 && a<20)

a++;

else a-- ;

System.out.println(a);

(ii) int a= 5, b = 2, c;

if (a>b || a ! = b)

c = ++a+--b;
System.out.print(c+ “ ”+a+ “ ”+b);

(i) Give prototype of a function search which receives a sentence sentnc and a word wrd and [2]

returns 1 or 0.

_______________________________________________________________________________________
3 Turn over
SECTION B (60 Marks)
Attempt any four questions from this Section.
The answers (to the programs Q4-Q9) 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]

Define a class called mobike with the following description:

Instance variables/data members:

int bno - to store the bike's number

int Phno - to store the phone number of the customer

String name - to store the name of the customer

int days - to store the number of days the bike is taken on rent

int charge - to calculate and store the rental charge

Member methods:

void input( ) - to input and store the detail of the customer.

void computer( ) - to compute the rental charge.

The rent for a mobike is charged on the following basis:

First five days Rs. 500 per day.

Next five days Rs. 400 per day.

Rest of the days Rs. 200 per day.

void display( ) - to display the details in the following format:

Bike No. PhoneNo. Name No. of days Charge

--------- ----------- ------- -------------- ----------


_______________________________________________________________________________________
4
Question 5 [15]

Using the switch statement, write a menu driven program to:

(i) To find and display all the factors of a number input by the user (including 1 and excluding

number itself).

Example:

Sample Input : n =15

Sample Output : 1,3, 5

(ii) To find and display the factorial of a number input by the user (the factorial of a non–

negative integer n, denoted by n!, is the product of all integers less than or equal to n.

Example:

Sample Input : n =5

Sample Output : 5! = 1×2×3×4×5 =120.

For an incorrect choice, an appropriate error message should be displayed.

Question 6 [15]
Using the switch statement, write a menu driven program for the following:
(i) To print the triangle [Given below]
1
2  2
333
4444
55555
(ii) To display the following pattern
1
21
321
4321
54321
For an incorrect option, an appropriate error message should be displayed.
_______________________________________________________________________________________
5 Turn over
Question 7 [15]

Write a program to find the sum of the following series depending on the user choosing 1 or 2:
1. s = x/1 - x/2 + x/3 -x/4 … up to N terms.
2. s = 1 + (1/3) + (1/5) + …… + (1/19)
Question 8 [15]

Write a program to input a number and check and print whether it is a Narcissistic Number or not.

Narcissistic number: It is a number that is the sum of its own digits each raised to the power of the number

of digits.

Example: 1634 is a Narcissistic number.

1634=14+64+34+44=1634

Question 9 [15]

An electronics shop has announced the following seasonal discounts on the purchase of certain items.

Purchase Amount in Rs. Discount on Laptop Discount on Desktop PC


0 – 25000 0.0% 5.0%
25001 – 57000 5.0% 7.6%
57001 – 100000 7.5% 10.0%

More than 100000 10.0% 15.0%

Write a program based on the above criteria to input name, address, amount of purchase and type of
purchase (L for Laptop and D for Desktop) by a customer. Compute and print the net amount to be
paid by a customer along with his name and address.
(Hint: discount = (discount rate/100)* amount of purchase
Net amount = amount of purchase – discount)

_______________________________________________________________________________________
6

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy