Computer Test Full Syllabus
Computer Test Full Syllabus
SECTION – A
(40 MARKS)
ATTEMPT ALL QUESTIONS FROM THIS SECTION.
Question 1. [2x5]
Question 2. [2x5]
b) Arrange the given data types in descending order of their size: char, long, float, Boolean
c) Write the appropriate function to do the following: 1) To add two strings. 2) To take out a character from a
string at any position.
Question 3. [2x10]
1) System.out.print(Math.ceil(-6.25)); 2) System.out.print(Math.Floor(-6.25));
e) Write one similarity and one difference between for loop & while loop.
1) Is used for allocating memory to an array. 2) Causes the control to transfer back to the method call.
i) Give the prototype of a function search which receives a sentence sentc and a word wrd and returns 1 or 0 .
j) Write the total bytes required to store the given arrays in the computer’s memory:
SECTION – B
(60 MARKS)
(Attempt any four in this section)
(Each program should be written using variable description)
Question 4. [15]
Data members/instance variables: Name, age, m1, m2, m3 (marks in 3 subjects), maximum, average Member
Functions:
(i)A parameterized constructor to initialize data members like name, age, m1, m2, m3
(ii) void compute() – to calculate the average and maximum out of three marks
(iii) void display() – to display the name, age, marks in three subjects, maximum and average.
Write a main() method to create an object of the class and call the above member methods.
Question 5.
The International Standard Book Number (ISBN) is a unique numeric book identifier which is printed on every
book.
The ISBN is based upon a 10-digit code. The ISBN is legal if: 1xdigit 1 + 2xdigit2 + 3xdigit3 + …………….+ 10xdigit10 is
divisible by 11
Sum= 1x1 + 2x4 + 3x0 + 4x1 + 5x6 + 6x0 + 7x1 + 8x4 + 9x9 = 253 , which is divisible by 11.
ii) If the ISBN code is not a 10-digit integer, output the message, “Illegal ISBN” and terminate the program.
iii) If the ISBN code is a 10-digit, extract the digits of the code and compute the sum as explained above.
If the sum is not divisible by 11, output the message “Illegal ISBN”
Question 6. [15]
Write a program to input any string to calculate the total number of characters leaving blank spaces, total number
of vowels(consider both cases) present in the string and also print the total number of words.
Question 7. [15]
Define a class city and store the given city name in a single dimensional array. Sort these city names in alphabetical
order using bubble sort technique only, then print the sorted list.
Question 8.
Write a program to accept a string in lower case. Convert the first character of each word of the string to
uppercase and display the new string.
Question 9.
a) Int calculation (int n, char ch) with one integer argument and one character argument. It computes the cube of
an integer if choice ‘ch’ is ‘C’ otherwise computes its square.
b) Int calculation (int a, int b, char ch) with two integer arguments and one character argument. It Computes the
remainder if choice ‘ch’ is ‘R’ otherwise find the quotient.
c) Boolean calculation (String x, String y) with two string arguments that check whether strings are equal or not.