Computers Application Boards Paoer
Computers Application Boards Paoer
Mero.her methods: .
void acceptO Ac~ept 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 s~eam allocated.
Call all the above methods in main method using an object.
Auestion 4 [15] .
Define a class to accept ·10 characters from a user. Using bubble sort technique arrange
them in ascending order. Display the sorted array and original ·array.
1 1 I 1
2 2 2 2
3 3 3 3
4 4 4 4
5 5 5 5
To check whether the number is a lead number. A
void print(int n)
lead number is the one whose sum of even digits are
equal to sum of odd digits.
e.g. 3669 odd digits sum= 3 + 9 = 12
. . ..
even digits sum= 6 + 6 = 12
3669 is a lead number.
[15]
/4est ion 6
Define a class to accept a String and print the number of _digits, al~habets and special
characters in the string. •
Example: S = "KAPILDEV@83"
Output: Number of digits - 2
Number of Alphabets - 8
Number of Special characters - I
(15]
/4tio n7
Define a eJass to accept values into an array of double data type of size 20. Accept a double
value from user and se8:rch in the array using linear search method. If value is found
display message "Found " with its position where it is present in the array. Otherwise
display message "not found".
,
Question 8 [15]
Define a class to accept values in integer array of size 10. Find sum of one digit number
and sum of two digit numbers entered. Display them separately.
Example: Input: a[ ] = {2, 12, 4, 9, 18, 25, 3, 32, 20, I} .
Output: Sum of one digit numbers : 2 + 4 + 9 + 3 + I = 19
Sum of two digit number s: 12 + 18 + 25 + 32-t: 20 = 107
TI3~1 8