0% found this document useful (0 votes)
11 views2 pages

Computers Application Boards Paoer

The document outlines a set of programming tasks to be completed in a Java environment, including class design and method implementation. Key tasks involve creating a 'Student' class with specific attributes and methods, implementing sorting algorithms, and performing character analysis. Additional exercises include function overloading, array manipulation, and searching techniques.

Uploaded by

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

Computers Application Boards Paoer

The document outlines a set of programming tasks to be completed in a Java environment, including class design and method implementation. Key tasks involve creating a 'Student' class with specific attributes and methods, implementing sorting algorithms, and performing character analysis. Additional exercises include function overloading, array manipulation, and searching techniques.

Uploaded by

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

[2)

Write the value of n after execution:


char ch ='d'·
'
int n =ch+ 5·
'

~TI0N 8 (60 Marks)


(Answer-any four questions from .this Section.)
· · • ifher BlueJ environment or any
-
The answers in this· section should. consist of the programs
.
in, e • . • .
program environment with java as the base.
th
Each program should be written using variable-description I '!1nemoni~ codes so t~at the logic·of e
. '

.program is clearly depicted.


Flowchart~ and algor#hms are ~ot required.
[15]
-~estion3
Design a class with the following specificatio~s:
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)
J •

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.

T23 861 7 Turn Over


[15]
~stio ns
Define a class to overload the functi~n print as follows:
voi~ print() to print the fallowing format

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

You might also like