[go: up one dir, main page]

0% found this document useful (0 votes)
12 views9 pages

std10 Revision Paper Term1

This document is a revision paper for a Computer Application course, containing multiple-choice questions, programming tasks, and true/false statements related to Java programming concepts. It covers topics such as object code, control structures, programming output predictions, and class definitions. Additionally, it includes practical programming exercises to determine eligibility based on student marks and to identify 'Super numbers' based on their factors.

Uploaded by

ryan.madhuri
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)
12 views9 pages

std10 Revision Paper Term1

This document is a revision paper for a Computer Application course, containing multiple-choice questions, programming tasks, and true/false statements related to Java programming concepts. It covers topics such as object code, control structures, programming output predictions, and class definitions. Additionally, it includes practical programming exercises to determine eligibility based on student marks and to identify 'Super numbers' based on their factors.

Uploaded by

ryan.madhuri
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/ 9

Computer Application

Revision Paper for term-1/prelim-1

SECTION A (30 Marks)

Question 1 Fill in the blanks with the correct option

(a) Which of the following is also known as object code?


(A) The program file written in high level language
(B) The output of the interpreter
(C) The bytecodes we get after compiling the source code using the compiler
(D) None of these

(b) The blueprint from which objects are created in Java is known as _______ :
(A) Object B)Interface (C) Class D) Language

(c) What is the value returned by the following line in Java?


Math.ceil(7.8)
(A) 8.0 B)9.0 (C) 7.0 D) 6.0

d)____ statement skips the rest of the statement of the body of the loop and exits
the loop before the iteration is completed.
a)continue c)break
b)switch d)if

Question 2 Predict the output

(A) What is being done in the following code snippet


int n;
Scanner in = new Scanner(System.in);
n = in.nextInt();
if(n%2 == 0)
System.out.println(“even”);
else
System.out.println("Odd");
(A) Prints, whether a number is Positive, Negative or Zero
(B) Prints whether a number is Positive or non-positive
(C) Prints whether a number entered by user is even or odd
(D) None of these

B) System.out.println(10 * 20 + "JavaProgramming");
a) 200JavaProgramming b) 1020JavaProgramming
c) 10*20JavaProgramming d) None of these

C)Predict the output


class Test
{
public static void main (String args[])
{
for(int i=0;0 ; i++) {
System.out.println("Hello Java");
}
}
}

a) Will run infinitely b) compile time error

c) Hello Java d) none of these

Question 3 Say true or false

a) If((p>q)&&(p>r)),then which of the given statement is true?


a)p is the greatest number
b)q is the greatest number
c)p is the smallest number
d)all of these

b) for loop is also called as an entry controlled loop. - True

c) month int = 0; - is a valid java statement. - false


Question 4 Find the odd man out

A) a) int b) byte c) short d) double


B) a) && b) || c) = = d) !
C) a) Math.pow(4,1) b) 2*2 c) Math.sqrt(16)
d)Math.floor(3.8)

Question 5 Name the following

(a) All of the basic types of Java storage variables are known also as
(A) Basic types (B) Object types
(C) Primitive type (D)None of these

b) A method which accepts a float value using Scanner class


a) nextfloat() b) nextFloat()
c) parseFloat() d) None of these

c) Which are the errors inspite of which the program will compile and run

a) logical error b) syntax error

c) none of these

Question 6 Choose the correct answer

a) Based on the below code snippet, conclude on the statement below it.
public class Stop
{
int RGY;
Stop()
{
RGY =0;
}
}
The above method in a class definition is known as ____________
(A) Object function (B) default constructor
(C) parameterised constructor (D) Function definition

b) Which of the following is a relation Operator?


a) = = c) ||
b) && d) None of these

c) What will be the new value of p if its starting value is if p=12


int x=5,y=10;
if(p>y)
p=x;
else
p=y;

a)5 c)12
b)10 d)None of these

SECTION B (20 Marks)

Question 7

Programming Question

Question 8

A Super number is a number for which the sum of its proper factors is greater than
the number itself. Write a program to input a number and check and print whether
it is a Super number or not.

Example:
Consider the number 12.
Factors of 12 = 1, 2, 3, 4, 6
Sum of factors = 1 + 2 + 3 + 4 + 6 = 16
As 16 > 12 so 12 is a Super number.

import java.util.Scanner;

public class Super1


{
public static void main(String args[])
{
Scanner in = new Scanner(<A>);
System.out.print("Enter the number: ");
int n = <B>
int sum = 0;

for (int i = 1; <C>; i++)


{
if (<D>)
<E>
}

if (<F>)
System.out.println(n + " is a Super number");
else
System.out.println(n + " is not a Super number");
}
}
<A> System.in

<B> in.nextInt();

<C> i<n

<D> n%i ==0

<E> sum = sum+i;

<F> sum>n
Question 9

Define a class called Student to check whether a student is eligible for taking
admission in class XI with the following specifications:
Data Members Purpose
String name to store name

int mm to store marks secured in Maths


int scm to store marks secured in Science
int comp to store marks secured in Computer
String Remark To store remark

Member Purpose
Methods
Student( ) parameterised constructor to initialize the data members by
accepting the details of a student
void check( ) to check the eligibility for course based on the table given
below
void display() to print the eligibility/remark along with the name

Marks Eligibility/Remark

90% or more in all the subjects Science with Computer

Average marks 90% or more Bio-Science

Average marks 80% or more and less than 90% Science with Hindi

Average marks Less than 80% Admission not possible


Write the main method to create an object of the class and call all the member
methods.
import java.util.Scanner;

public class <A>


{
String name;
int mm;
int scm;
int comp;
String remark ;

<B>(String n, int m, int sc, int c) // constructor


{
name = n;
mm = m;
scm = sc;
comp = c;
}

void check()
{
remark = "Admission not possible";
<C>

if (mm >= 90 && scm >= 90 && comp >= 90)


remark = "Science with Computer";
else if (avg >= 90.0)
remark = "Bio-Science";
else if (avg >= 80.0)
remark= "Science with Hindi";

public void display() {


System.out.println(“Name :”+name);
System.out.println("Eligibility: " + remark);
}

public static void main(String args[]) {


Scanner in = new Scanner(System.in);
System.out.print("Enter Name: ");
String n = in.nextLine();
System.out.print("Enter Marks in Maths: ");
int maths = in.nextInt();
System.out.print("Enter Marks in Science: ");
int sci = in.nextInt();
System.out.print("Enter Marks in Computer: ");
double comp = in.nextDouble();

<E> Student obj = new Student(n, maths, sci, comp);


<F> obj.check();
obj.display();
}
}

<A> Student

<B> public Student;

<C> double avg = (mm+scm+comp)/3

<E> Student obj = new Student(n, maths, sci, comp);


<F> obj.check();

Question 10 Read the paragraph given below and answer the questions given
below:

Java is a truly object-oriented programming language. The first truly object-


oriented programming language was SmallTalk. Since then, other OOP based
languages have originated. The OOP based languages create objects and the
objects interact in a way so as to solve real world problems. Object-Oriented
Programming is a paradigm that provides many concepts, such as inheritance, data
binding, polymorphism, etc. Object-Oriented Programming is a type of
programming which is based on objects rather than just functions and procedures.
OOPs makes development and maintenance easier, whereas, in a procedure-
oriented programming language, it is not easy to manage if code grows as project
size increases.

(a) Which was the first truly object-oriented programming language?


(A) C# (B) Java C) SmallTalk

(b) Which of the following is a fundamental way in which OOP based languages
work?
(A) By creating objects and these objects interact with each other
(B) By solving problems based on algorithms
(C) By using methods to solve problems

c) Say true or false

In OOPS programming programs are organized around objects and data rather than
actions and logic. -true

You might also like