Page 482 - CA_Blue( J )_Class10
P. 482
69 departmental_shop ob1 = new departmental_shop(na,mo,pr); // Object
1 created
70 ob1.calculate();
71 ob1.countobject();
72 ob1.display();
73 departmental_shop ob2 = new departmental_shop(); // Object
2 created
74 ob2.input();
75 ob2.calculate();
76 ob2.countobject();
77 ob2.display();
78 }
79 }
Output
Enter name , mobno and price
Amit
45678
340
...................Object Number 1......................
customer name mobile price discount Amount
Amit 45678 340.0 17.0 323.0
Enter name , mobno and cost
Bijay
56789
450
...................Object Number 2......................
customer name mobile price discount Amount
Bijay 56789 450.0 22.5 427.5
Variable Description
NAME DATATYPE DESCRIPTION
cusname String Instance Variable to accept name
mobile long Instance Variable to accept mobile number
price double Instance Variable to accept price
dis double Instance Variable to calculate discount
bill double Instance Variable to calculate bill amount
count int Static variable to count number of objects created
na String Local variable to accept name of customer
mo long Local variable to accept mobile number of customer
pr double Local variable to accept price of item
480480 Touchpad Computer Applications-X

