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

10 th computer science application questions

The document is an examination paper for Class X in Computer Applications, consisting of multiple-choice questions, short answer questions, and programming tasks. It covers topics such as object-oriented programming concepts, string manipulation, and basic algorithms. The paper includes questions on constructors, loops, string functions, and requires students to design classes and write programs in Java.

Uploaded by

arunimmishra1670
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)
10 views5 pages

10 th computer science application questions

The document is an examination paper for Class X in Computer Applications, consisting of multiple-choice questions, short answer questions, and programming tasks. It covers topics such as object-oriented programming concepts, string manipulation, and basic algorithms. The paper includes questions on constructors, loops, string functions, and requires students to design classes and write programs in Java.

Uploaded by

arunimmishra1670
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

CLASS: X FULL MARKS: 100

SUBJECT: COMPUTER APPLICATIONS WRITING TIME: 2 Hrs.

Question 1.
Choose the correct option and write the correct answer: [20]
(i) What does the object has?
(a) Attributes
(b) State
(c) Behavior
(d) All of these

(ii) The keyword that represents the current object is


(a) now
(b) this
(c) current
(d) None

(iii) Static functions can access


(a) Static data members
(b) Non-static data members
(c) Both static and non-static data members
(d) None of the above

(iv) Default constructors requires how many parameters?


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

(v) The default access specifier for a method of a class is


(a) private
(b) public
(c) protected
(d) package

(vi) The function that modifies its parameters is called a


(a) Virtual function
(b) Pure function
(c) Impure function
(d) Default function

(vii) If a user wants to execute a loop 10 times, which of the following statements will be used
(a) for (i=6; i<=26; i=i+2)
(b) for (i=3; i<=30; i=i+3)
(c) for (i=0; i<10; i++)
(d) All of the above

(viii) Evaluate the following java expression: x=3, y=5, z=10;


++z + y – y + z + x++
(a) 24
(b) 23
(c) 20
(d) 25
(ix) Class variable that is available to the entire class is known as:
(a) Local variable
(b) Class variable
(c) Instance variable
(d) Scope variable

(x) Given the code:


int change (int p, int q)
{
p=p*q;
return p;
}
The statement to call the above function will be:
(a) change (10,20)
(b) change (9.5,10.5)
(c) int r=change (10,20)
(d) none of the above

(xi) Write the output of the following code:


long series (int p)
{
long f=1;
for(i=1;i<=p;i++)
{
f=f*i;
}
return f;
}
(a) Fibonacci series
(b) Factorial of a number
(c) Factor of a number
(d) None of these

(xii) Which of the following loop checks condition first and then the execution begins?
(a) do-while
(b) do
(c) while loop
(d) for

(xiii) A loop statement is given as:


for (i=10; i<10; i++)
For how many times will the given loop statement be executed
(a) 0
(b) 1 time
(c) 10 times
(d) infinite

(xiv) Name the operator that is used to allocate memory space for an object.
(a) Dot
(b) new
(c) Both a and b
(d) None of these
(xv) Which is false about constructor?
(a) Constructors cannot be synchronized in java
(b) Java does not provide default constructor
(c) Constructors can have a return type
(d) “this” and “super” can be used in constructor

(xvi) String n = "Computer Knowledge";


String m = "Computer Applications";
System.out.println(n.substring(0,8).concat(m.substring(9)));
(a) Computer
(b) Computerappli
(c) ComputerApplications
(d) None of these

(xvii) String str = "Computer Applications" + 1 + 0;


System.out.println("Understanding" + str);
(a) UnderstandingComputer Applications10
(b) UnderstandingComputer Applications1
(c) UnderstandingComputer Applications 10
(d) None of these

(xviii) String a= “smartphone”;


String h=a.substring(2, 5);
(a) art
(b) mart
(c) artp
(d) None of these

(xix) Give the output of the following expression:


a+= a++ + ++a + --a + a--; when a = 7;
(a) 39
(b) 36
(c) 35
(d) 38

(xx) Output of Math.ceil(46.6) is


(a) 46.5
(b) 46.6
(c) 46.0
(d) 47.0

Question 2.
(a) Write two diffrences between ‘break’ and ‘continue’ keyword. [2]
(b) Write two differences between pure function and impure function. [2]
(c) Write two diffrences between constructor and method [2]
(d) What will be the output of the following code? [2]
String s="Today is Test";
System.out.println(s.indexOf('T'));
System.out.println(s.substring(0,7) + " " +"Holiday");
(e) Explain ‘Fall through’ with reference to a switch case statement. [2]
(f) Give the output of the following string functions: [2]
"MISSISSIPPI”. indexOf('S') + "MISSISSIPPI”. LastIndexOf('I')
"CABLE".compareTo("CADET")
(g) Analyze the given program segment and answer the following questions: [2]
i. Write the output of the program segment.
ii.How many times does the body of the loop gets executed?
for (int m = 5; m <= 20; m += 5)
{
if (m % 3 == 0)
break;
else
if (m % 5 == 0)
System.out.println(m);
continue;
}
(h) Give the output of the following program segment and also mention how many times the loop is executed:
int i;
for (i = 5; i > 10; i ++)
System.out.println( i );
System.out.println(i * 4); [2]

(i) State the output of the following program segment: [2]


String s = "Examination";
int n = s.length();
System.out.println(s.startsWith(s.substring(5, n)));
System.out.println(s.charAt(2) == s.charAt(6));
(j) Consider the following class:
public class myClass
{
public static int x=3, y=4;
public int a=2, b=3;
}
Name the variables for which each object of the class will have its own distinct copy.
Name the variables that are common to all objects of the class. [2]

Question 3.
Design a class name ShowRoom with the following description:
Instance variables / Data members:
String name — To store the name of the customer
long mobno — To store the mobile number of the customer
double cost — To store the cost of the items purchased
double dis — To store the discount amount
double amount — To store the amount to be paid after discount

Member methods:
ShowRoom() — default constructor to initialize data members
void input() — To input customer name, mobile number, cost
void calculate() — To calculate discount on the cost of purchased items, based on following criteria

Cost Discount (in percentage)


Less than or equal to ₹10000 5%
More than ₹10000 and less than or equal to ₹20000 10%
More than ₹20000 and less than or equal to ₹35000 15%
More than ₹35000 20%
void display () — To display customer name, mobile number, amount to be paid after discount.
Write a main method to create an object of the class and call the above member methods. [15]

Question 4.
Write a program to input a sentence and convert it into uppercase and count and display the total number
of words starting with a letter 'A'.
Example:
Sample Input: ADVANCEMENT AND APPLICATION OF INFORMATION TECHNOLOGY ARE
EVER CHANGING.
Sample Output: Total number of words starting with letter 'A' = 4 [15]

Question 5.
Write a program to accept 10 integers and perform binary search for an element input by user.
[15]

Question 6.
Write a program in Java to enter a number containing three digits or more. Arrange the digits of the
entered number in ascending order and display the result.
Sample Input: Enter a number 4972
Sample Output: 2, 4, 7, 9 [15]

Question 7.
Design a class to overload a function check() as follows:
void check (String str, char ch) — to find and print the frequency of a character in a string.
Example:
Input:
str = "success"
ch = 's'
Output:
number of s present is = 3
void check (String s1) — to display only vowels from string s1, after converting it to lower case.
Example:
Input:
s1 ="computer"
Output: o u e [15]

Question 8.
Write a program to accept a list of 20 integers. Sort the first 10 numbers in ascending order and the next
10 numbers in descending order by using bubble sort. Finally print the complete list. [15]

************************************************************************************

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