IL Variables and class variables.
What are library classes? Give an example.
Question 4
class called mobike with the following description:
Define a class called mobike
[10
Instance variables/ data members:
int bno
- to store the bike's number
int phno
- to store the phone number of the customer
String name
- to store the name of the customer
- to store the number of days the bike is taken on rent.
int days
int charge
- to calculate and store the rental charge
Member Methods:
- to input and store the detail of the customer
void input)
- to compute the rental charge.
void compute()
The rent for a mobike is charged on the following rental basis:
500 per day.
First five days
400 per day
Next five days
* 200 per day.
Rest of the days
to display the details in the following format:
void display0
No. of days
Charge
Name
Bike No. Phone No.
Answers
Answered by
1
Answer:
- object-oriented programming ,
- a class library is a collection of prewritten class es or coded templates,
- any of which can be specified and used by a programmer when developing an application program. .
- .. A class library is analogous to a subroutine library in earlier, procedural programming.
Similar questions