0% found this document useful (0 votes)
7 views5 pages

Summer Assignments Class X

The document is a summer assignment for Class X students at Saint Anthony's School, focusing on Computer Applications. It contains a series of questions related to programming concepts, including expressions, loops, methods, constructors, and data types. Students are required to answer multiple-choice questions, rewrite code, and define programming terms and concepts.
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)
7 views5 pages

Summer Assignments Class X

The document is a summer assignment for Class X students at Saint Anthony's School, focusing on Computer Applications. It contains a series of questions related to programming concepts, including expressions, loops, methods, constructors, and data types. Students are required to answer multiple-choice questions, rewrite code, and define programming terms and concepts.
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/ 5

SAINT ANTHONY’S SCHOOL

SUMMER ASSIGNMENT
COMPUTER APPLICATIONS (PAPER I)
CLASS: X

Q1. What is the type and value of the following expression?


(Notice the integer division) – 4 + 1/2 + 2*–3 + 5.0
(a) int -5
(b) double -4.5
(c) int -4
(d) double –5.0

Q2. How many times ‘Hello’ is printed?


Public static void main(String args[])
{
for(i = 0;i<5;i++)
{
System.out.println(“hello”);
break;
}
}
(a) 5
(b) 4
(c) 1
(d) 0

.
Q3. Rewrite the following loop using for loop :
while (true)
System.out.println(“*”);

Q4. Evaluate the expression :


z = ++x * (y– –)–y
where, x = 20, y = 10, z;

Q5. Rewrite the following condition without using logical operators :


if (a > b | | a > c)
System.out.println(a);

Q6. A static method is also called a :

(a) Instance function


(b) Defined function
(c) Class method
(d) Fixed function
Q7. What is the precision of the double data type ?

(a) 5 digits
(b) 7 digits
(c) 15 digits
(d) 10 digits

Q8. Define class ? Give example of class and object.

Q9. The default return type of a User defined function is

(a) float
(b) int
(c) void
(d) null

Q10. Function prototype means?

(a) Return value of a function


(b) Name of the function
(c) Return type of the function
(d) Return type ,Name and Inputs to a function

Q11. What is meant by private visibility of a method ?

Q12. What is the use of function overloading ?

Q13. Default constructor requires how many parameters?

a) 3
(b) 0
(c) 2
(d) 1

Q14. Among the following Statements, Which are true about Constructors?

(I) a new operator automatically calls them.


(II) they cannot be private
(III) they cannot be virtual
a) I & III
b) I & II
c) II & III
d) All of the above

Q15. Why do we need a constructor as a class member ?

Q16. Explain instance variable. Give an example.


Q17. Memory is allocated for class objects when

(a) Class is defined


(b) Function is called
(c) Both (a) and (b)
(d) Object is created

Q18. The process of converting wrapper class object to primitive data type is called :

(a) Boxing
(b) Unboxing
(c) Conversion
(d) Post Boxing

Q19. What is the proper access specifier for data members of a class?

(a) Private
(b) Default
(c) Protected
(d) Public
.
Q20. ___________ keword is used while creating a static method.

(a) Static
(b) Final
(c) Instance
(d) Nostat

Q21. What is meant by private visibility of a method ?

Q22. Differentiate between private and protected visibility modifiers.


.

Q23. The following code will produce output as :

public class Exam


{
public static void main(String[] args)
{
String s="ICSE2021";
system.out.println
(s.substring(4)+s.length());
}
}

(a) 20218
(b) 2029
(c) Error
(d) 2030
Q24. How can string be created by two methods ?

Q25. Write the return data type of the following functions :


(i) startsWith( )
(ii) random( )

Q26. In the program given below, state the name and the value of the:
(i) method argument or argument variable.
(ii) class variable.
(iii) local variable.
(iv) instance variable
class myClass.
{
static int x = 7;
int y = 2;
public static void main(String args[])
{
myClass obj = new myClass();
System.out.println(x);
obj.sampleMethod(5);
int a = 6;
System.out.println(a);
}
void sampleMethod(int n)
{
System.out.println(n);
System.out.println(y);
}
}

Q27. Given a string str=CompuTerScieNceand ENGINEERING”; The output of str.substring(5,12)


will return ______ characters

(a) 6
(b) 7
(c) 8
(d) 9

Q28. The algorithm in which the middle index is found and the array is divided into 2 halves to search
for an element is called :

(a) Linear search


(b) Data Search
(c) Long search
(d) Binary search
.
Q29. Given array int marr[] = 101, 202, 303, 404; the value of marr[-1+2] is __________.
(a) 101
(b) 202
(c) 303
(d) 404
Ans. (b) 202
Q30. Write statements to show how finding the length of a character array char[] differs from finding
the length of a String object str.

Q31. State the total size in bytes, of the arrays a[4] of char data type and p[4] of float data type.
.

Q32.

Define a class to overload the method display() as follows:


void display(): To print the following format using nested loop.
12121
12121
12121
void display (int n, int m) : To print the quotient of the division of m and n if m is greater than n
otherwise print the sum of twice n and thrice m.
double display (double a, double b, double c) — to print the value of z where
z=p×q
p=ca+b
q=a+b+c
Q33. Define a class to accept a number and check whether it is a SUPERSPY number or not. A
number is called SUPERSPY if the sum of the digits equals the number of the digits.

Q34. Define a class to accept a string and convert the same to uppercase, create and display the new
string by replacing each vowel by immediate next character and every consonant by the previous
character. The other characters remain the same.
Example:
Input : #IMAGINATION@2024
Output : #JLBFJMBSJPM@2024

Q35. Consider the following program segment and answer the questions given below:
int x[][] = { {2,4,5,6}, {5,7,8,1}, {34, 1, 10, 9}};
(a) What is the position of 34?
(b) What is the result of x[2][3] + x[1][2]?

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