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

computer unit test

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

computer unit test

Computer
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Children's Academy

Group of Schools
o Bachani Nagor o Ashok Nagor o Thakur Complox o Ghodbunder Road
Malad (E) Kandivli (E) Kandivli (E) Thane (w)
HARDAREWOROUA OisCIPLIh
FIRST UNIT TEST 2024-25

rade : Subject : COMPUTER APPLICATIONS Marks : 30


ate 19/07/2024 Time Ihour
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 consists of 3printed pages.
Alempt all questions from Section I and any two questions from Section l.
The intended narks for questions or purts of questions are given in brackets ||.

Section A (12 Marks)


(Atempt all questions from this section)
Question 1 |6]
Choose the correct answer and write the correct option.
The absence of break statement in switch-case block produces
)
dangling switch (b) nested switch
(a)

(c) fall through (d) error


tii) What will be the final value of variable 'x' after executing the following loop?
for (x-15; x>=0; x--);
(b) -1
(a)
(c) (d) logical error

V(iü) Which of the following is an exit-controlled loop?


(a) for (b) while

(c) do-while (d) for each


X(iv) Assertion (A) : Functions in programming help in modularizing code for better
organization
Reason (R): Functions allows code reusability by encapsulating a set of
instructions that can be used multiple times.
(a Both Assertion (A) and Reason (R) are true and Reason (R) is a correct
explanation of Assertion (A)
(b) Both Assertion (A) and Reason (R) are true and Reason (R) is not a
correct explanation of Assertion (A)
Assertion (A) is false and Reason (R) is true.
(d Assertion (A) is true and Reason (R) is false.
Computer Applications/Grade XICSE/Fist Unit Test /Page lof3
CATCLDD04 3
value.
(v) is used when function does not return a
X
a return 0; (b) primitive datatype
non-primitive datatype (d) void
(c)
the constructor for the class School.
(vi) Which of the following is a correct name of
public School() (b) public void School()
(a)
void School(int n)
(C) public static void School() (d)
[6]
Question 2
Answer the following:

(i) Explain the keyword 'continue' with proper example.


CheckNeon() that receives two strings and
i) Write prototype of the class function
heckNe0 h(krha S,
a character values. pube stak'c uod
,(ii) Find output of the following
code snippet.
class Sample char
int n;
Sample(){ n=20;
Sample(int x) ( n=x; }
void Display()

nt=20;
System.out.println("N="+n):

public static void main()

int n=10:
Sample obj=new Sample(n):
obj.Display():

SECTION B

this section)
(Answer any two questions from [9
Question 3 discount on the purchase of
has announced a special
The digital world superstore
Laptops as given below:
Up to 225,000 5.0%
Z25,001- 50,000 7.5%

50,001 - 1,00,000 10.0%


More than 1,00,000 15.0%

Define a class Laptop described as follows:


suitable datatypes:
Define data members/instance variables with
name, price, disc, amt
CATCLD2024.2¬
Computer Applications/Grade NICSE/ First Unit Test Page 2 of3
Member Methods:

1. A parameterised constructor to initialize the data members entered in the main


method,

2. void Compute(): To compute the discount as given above.


3.void Display(): To display the name, discount and amount to be paid after discount.
Write a main method to create an object of theclass and call the member methods.
Question 4
Define a class to overload the method Print() as follows.
boolean Print(int n) to check if the number is Dudeney number or
not. A number is Dudeney if the cube of the sum
of digits is equal to the number itself.
Example :512 = (5+1+2)' = 8?= S12
void Print(int n1, int n2, int n3) to receive three integers and display the smallest
number

Question 5 (91
A pre-paid taxi charges from the passenger as per the tariff given below:

DISTANCE RATE
For the first 5 km Rs. 100
For the next l0 km Rs. 10 / km

For the next 10 km Rs. 8/ km


More than 25 km Rs. 5/ km

Write a program to input the name of the customer, taxi number and distance covered

and calculate the Amount paid by the passenger.


The program displays the printed bill with the details given below:
Customer Name
Taxi Number

Distance covered
Amount Payable

*THE END**#***.

Coniputer Applications Grade XICSE Firy Uuii Test /paoe 3of 3


C4TCLD2024-2S

You might also like