Anshul transport company charges for the parcels of its customers as per the following
specifications given below:
Class name : Atransport
Member variables: String name – to store the name of the customer
int w – to store the weight of the parcel in Kg
int charge – to store the charge of the parcel
Member functions: void accept ( ) – to accept the name of the customer,
weight of the parcel from the user (using
Scanner class)
void calculate ( ) – to calculate the charge as per the weight
of the parcel as per the following
criteria.
Weight in Kg Charge per Kg
Upto 10 Kgs Rs.25 per Kg
Next 20 Kgs Rs.20 per Kg
Above 30 Kgs Rs.10 per Kg
[15]
ICSE Specimen Paper 2020 onwards 4
A surcharge of 5% is charged on the bill.
void print ( ) – to print the name of the customer, weight of the parcel, total bill
inclusive of surcharge in a tabular form in the following format :
Name Weight Bill amount
------- --------- ---------------
Define a class with the above-mentioned specifications, create the main method,
create an object and invoke the member methods.
Answers
Answered by
0
Answer:
h sb sis ke km rha k mal sis hediwiei
jaujsj
Explanation:
hajuejdkßkrujskßkdjsjjßjdj
Similar questions