Computer Application Semester 2 Sample Paper 2
Computer Application Semester 2 Sample Paper 2
(ii) Visible in the classes in the same package and classes in other packages.
(a) private (b) public (c) protected (d) default
Question 2
Define a class to accept a sentence, convert the sentence into lowercase and print the words which start
and end with a character entered by the user.
Question 3
Define a class to store N integer values into an array. Create another array to contain squared values of
the even elements and cubed values of the odd elements of the first array.
Question 4
Define a class to input a string and convert it into uppercase and print the pair of vowels and number of
such pairs in the string.
Example: BEAUTIFUL BESTIES
Output: EA, AU, IE
No of pairs: 3
Question 5
Define a class to input the name and marks in 3 subjects of n number of students in 4 single dimensional
arrays and display the given remark based on the average marks along with the name of the student.
Average marks Remarks
85-100 Excellent
70-84 Very Good
40-69 Good
Below 40 Poor