Arihant- Computer 15 th sample paper icse class 10
Arihant- Computer 15 th sample paper icse class 10
System.out.println
("Value: " + value); My
objl.display():
obj2.display();
obj3.display():
Clas (90);
public static void obj4.displ ay();
main(String[] args)
(x) Consider the
MyClass objl = new
MyClass (10); segment and following
answer theprogram
MyClass obj2 = new given below: questions
MyC1ass (70); [2
int x[JC]={(1,2),(3,4), "Analysis
MyClass obj3 = new hate (5.6}.{7,8).{9,10},(11,12|):
MyClass (80);
MyC1ass obj4 = new (a) What is the position of 9?
(b) What is the position of 10?
Section B Answer any four questions from this section.
3. DTDCa courier company
charges for
the courier based on the weight
4. Define a class MergeDesc to enter two
of the Sorted arrays and merge into one array
parcel. Define a class with the following in descending order.
specifications: [15] (15]
e.g.
Class name
Member variables
Courier
Array A:
Input:a
2,6,9,12,23
name name of the customer Array B: 1, 11, 12, 32, 45
weight weight of the parcel in Output:
kilograms Merge Array: 45, 32, 23, 12, 12,
address address of the recipient lot 11,9,6,2,1
bill amount to be paid . UnderstandinglAyplication
type D-domestic, I-intermational 5. Define aJava class StringConverter that
Member methods
accepts a string and modifies it
void accept) to accept the details using the according to the following rules: 13]
-15 methods of the Scanner class
only. Convert all consonants in the string to
void calculate() to calculate the bill as per the uppercase. UnderstandinglAylication
following criteria: Replace all spaces in the string with '.
Weight in Kgs Rate per Kg
First 5Kgs 1010
6. Define a class to accept values into ?
array and find and display the sum of
Next 5 Kgs 950 [15)
each row.
Above 10 Kgs 799 "UnderstandinglAyplication
An additional amount of Rs. number
1500 is charged if the type of 7. Write aJava programto entera
number is
the courier is I (nternational) and check whether entered [15]
Pronic number or not.
void print) To print the details whichis
void main() Pronic number is the number integers.
to create and object of the consecutive
class and invoke the the product of two
methods e.g. 110=10*11
UnderstandinglApplication 56-7*8
12=3*4 . Unders
tandinglAyplication
Paper15
QkQuestion
137
&Define a class to overload the method void display(int to
display) as follows: [15] print the
division of mquotient
n, int m) of the
. UnderstandinglApplication and n if m i
vOid display) to print the following format
greater than n otherwise print
the sumn of twice n and thrice
using nested loop.
e eee e double to print the value of z
e eeee
display(double a, z-p°q and p-atb/c andwhere
eeeee double b, double gratbtc
c)
Answers
L )(a) (ü) (d) (ii) (b) (iv) (b) (v) (c)
(vi) (a) (viüi) (a) (vii) (c) (ix) (a) (<) (d) For anSwers, scan
(i) (b) (xii) (a) (xii) (c) (áv) (c) (xv) (b) the given QR code.
(xvi) (a) (xvi) (a) (xvii) (a) (xix) (b) (o) (a)
SP-15