Computer Application 001
Computer Application 001
Computer Application 001
(a)/
(b)
[2
[2
(c) $ '
State the difference between entry controlled loop and exit controlled
loop.
What are the two ways of invoking functions?
[2
[2~
')
[2
Question 2.
a)
State the total size in bytes, of the arrays a[4] of char data type and p[4] of float data type. ; [2]
b)
(i)
(if)
Which unit ofthe class gets called, when the object of the class is [2]
c)
String m^'Computer Applications"; System.out.println(n.substring(0,8).concat(m.substr ng(9))); i System.out.pr ntln(n.endsWith("e"));. i This Paper consists of 4 printed pages. 11 861
i Copyright reserved.
(d)
(e)
[2"
Question 3. (a) Analyse the following program segment and determine how many times the loop will be executed and what will be the output of the program segment? int p=200; /, while(true) i _ :;
{
if(p<100)
break; P=p-20;
}
System.out.println(p); (b) What will be the output of the following code? (i) int k=5,j=9;
k+= k++ - ++j + k; System.out.println("k="+k); 4 System.out.println("j="+j); iO (ii) double b= -15.6; double a = Math.rint(Math.abs(b)): System.out.println("a="+a); (c) (d) @/-/"' [2] [2] [2]
[2]
Explain the concept of constructor overloading with an example. Give the prototype of a function search which receives a sentence sentnc
[2]
[2]
(i)
(ii)
(g)
2 PI 1 861
jtaonemtBUHUs*..-J.,ma3aiais<gig
(h) What are library classes? Give an example. (i) Write one difference between Linear Search and Binary Search.
[2 [2
Str ng name - to store the name of the customer i int days int charge - to store the number of days the bike is taken on rent - to calculate and store the rental charge
Member methods: void input() - to input and store the detail of the customer
The rent for a mobike is charged on the following basis: First five days Next five days Rest of the days ? 500 per day. ? 400 per day. ? 200 per day.
Juestibn 5.
Mrite a program to input and store the weight often people. Sort and display them n descending order using the selection sort technique. [15]
111 861
TumOver
Question 6. Write a program to input a number and print whether the number is a special
number or not.
(A number is said to be a special number, if the sum of the factorial of the digits of the number is same as the original number). Example : 145 is a special number, because l!+4!+5! = 1+24+120 =145 (Where ! stands for factorial of the number and the factor al value of a number is i the product of all integers from 1 to that number, example 5!= 1 *2*3*4*5=120). [15
Question 7. Write a program to accept a word and convert it into lowercase if it is in uppercase, and display the new word by replacing only the vowels with the character following it. Example : Sample Input : computer
[15
to compare the length of the two str ngs i and pr nt the longer of the two. i [ 15]
yr te a menu dr ven program to perform the following: (Use switch - case statement) i i i) To print the ser es 0, 3, 7, 15, 24 .... n terms (value of ' ' is to be an input i by the user).
))
To find the sum of the ser es given below: i S= 1/2 + 3/4 + 5/6+7/8 19/20.
_
[15]
11 861