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

MIS Annual Examination 2023-2024: Computer Applications (Theory)

(i) The document contains instructions for a 2 hour theory exam in Computer Applications. It provides details about the exam structure, timing, and sections. (ii) Section A contains 10 multiple choice questions worth 1 mark each. Section B contains 4 questions and students must attempt any 4. The questions are programming problems to be solved in an environment like BlueJ. (iii) The document provides samples of the type of questions that could be asked, including problems related to classes, methods, loops, conditionals, arrays and more. It aims to test students' understanding of core Java concepts.

Uploaded by

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

MIS Annual Examination 2023-2024: Computer Applications (Theory)

(i) The document contains instructions for a 2 hour theory exam in Computer Applications. It provides details about the exam structure, timing, and sections. (ii) Section A contains 10 multiple choice questions worth 1 mark each. Section B contains 4 questions and students must attempt any 4. The questions are programming problems to be solved in an environment like BlueJ. (iii) The document provides samples of the type of questions that could be asked, including problems related to classes, methods, loops, conditionals, arrays and more. It aims to test students' understanding of core Java concepts.

Uploaded by

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

MIS Annual Examination 2023-2024

COMPUTER APPLICATIONS

(Theory)

(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

Choose the correct answers to the questions from the given options.

(Do not copy the question, write the correct answers only.)

(i) Name the feature of java which enables wrapping up of data and function into single unit:

(a) Encapsulation

(b) Inheritance

(c) Abstraction

(d) Polymorphism

(ii) The expression which uses > = operator is known as:

(a) relational

(b) logical

(c) arithmetic

(d) assignment

(iii) Ternary operator is a:

(a) logical operator

(b) arithmetic operator


(c) relational operator

(d) conditional operator

(iv) The number of bytes occupied by and 10 character.

(a) 20 bytes

(b) 60 bytes

(c) 40 bytes

(d) 120 bytes

(v) The method of Scanner class used to accept a double value is:

(a) nextInt()

(b) nextDouble()

(c) next()

(d) nextInteger()

(vi) Among the following which is a keyword:

(a) every

(b) all

(c) case

(d) each

(vii) The output of Math.round(6.6) + Math.ceil(3.4) is:

(a) 9.0

(b) 11.0

(c) 10.0

(d) 11

(viii) Name the type of error, if any in the following statement:

System.out.print("HELLO")

(a) logical

(b) no error

(c) runtime

(d) syntax
(ix) Name the package that contains wrapper classes:

(a) java.lang

(b) java.util

(c) java .io

(d) java.awt

(x) Which of the following is a valid Integer constant:

1. 4

2. 4.0

3. 4.3f

4. “four”

(a) Only 1.

(b) 1. and 3.

(c) 2. and 4.

(d) 1. and 2.

Question 2

(i) Write the Java expression for (p3 + q5)4

(ii) Evaluate the expression when the value of x = 2:

x = x ++ + ++ x + x

(iii) The following code segment should print “You can go out” if you have done

your homework (dh) and cleaned your room(cr). However, the code has errors.

Fix the code so that it compiles and runs correctly.

boolean dh = True;

boolean cr= true;

if (dh && cr)

System.out.println("You cannot go out");

else

System.out.println("You can go out");

(iv) How many times will the following loop execute? What value will be returned?

int x=2;
int y=50;

do{

++x;

y-=x++;

while(x<=10);

return y;

(v) Write the Java expression for (𝑎𝑎 + 𝑏𝑏)𝑥𝑥.

(vi) Evaluate the expression when the value of x = 4:

x * = - - x + x++ + x

(vii) Convert the following do…while loop to for loop:

int x=10;

do

{x– –;

System.out.print(x);

}while (x>=1);

(viii) Rewrite the following code using the if-else statement:

int m= 400;

double ch = (m>300) ? (m / 10.0) * 2: (m / 20.0) - 2;

(ix) Give the output of the following program se

int n = 4279; int d;

while(n>0)

{d=n%10;

System.out.println(d);

n=n/100;

(x) Name the following:

(a) What is an instance of the class called?

(b) The method which has same name as that of the class name.
SECTION B

(Answer any four questions from this Section.)

The answers in this section should consist of the programs in either BlueJ environment or any

program environment with java as the base.

Each program should be written using variable description / mnemonic codes so that the logic of the

program is clearly depicted.

Flowcharts and algorithms are not required.

Question 3

Define a class called with the following specifications:

Class name: Eshop

Member variables:

String name: name of the item purchased

double price: Price of the item purchased

Member methods:

void accept(): Accept the name and the price of the item using the methods of Scanner class.

void calculate(): To calculate the net amount to be paid by a customer, based on the following criteria:

Price Discount

1000 – 25000. 5.0%

25001 – 57000 7.5 %

57001 – 100000 10.0%

More than 100000 15.0 %

void display(): To display the name of the item and the net amount to be paid.

Write the main method to create an object and call the above methods.

Question 4

Define a class to accept a 3 digit number and check whether it is a duck number or not.

Note: A number is a duck number if it has zero in it

Example1:

Input: 2083

Output: Invalid
Example 2:

Input: 103

Output: Duck number

Question 5

Design a class with the following specifications:

Class name: Student

Member variables:

name – name of student

age – age of student

mks –marks obtained

stream – stream allocated

(Declare the variables using appropriate data types)

Member methods:

void accept() – Accept name, age and marks using methods of Scanner class.

void allocation() – Allocate the stream as per following criteria:

mks Stream

> = 300 Science and Computer

> = 200 and < 300 Commerce and Computer

> = 75 and 200 Arts and Animation

< 75 Try Again

void print() – Display student name, age, mks and stream allocated.

Call all the above methods in main method using an object.

Question 6

Using the switch statement, write a menu driven program to perform following

operations:

(i) To Print the value of Z where Z =(x 3+3x)/Y where x ranges from – 10 to 10 with

an increment of 2 and Y remains constant at 5.5.

(ii) To print the Floyds triangle with N rows


Example: If N = 5, Output:

23

456

7 8 9 10

11 12 13 14 15

Question 7

Write a menu driven program to find the sum of the following series depending on the

user choosing 1 or 2

1. S=1/4+1/8+1/12.........upto n terms

2. S=1/1!-2/2!+3/3!.......upto n terms

where ! stands for factorial of the number and the factorial value of a number is the

product of all integers from 1 to that number, e.g. 5! = 1 2 3 4 5.

(use switch-case).

Question 8

Write a program to calculate the sum of all the prime numbers between the range of

1 and 100.

You might also like