7. Define a class Library having the following description:
Data members String name : to store name of the book
int price
: to store the printed price of the book
int day
: to store the number of days for which fine is to be paid
double fine : to store the fine to be paid
Member functions:
void input() : To accept the name of the book and printed price of the book
void cal() : Calculates the fine to be paid
void display() : Displays the name of the book and fine to be paid
Write a program to compute the fine according to the given conditions and display
the fine to be paid.
Fine
Days
First seven days
25 paise per day
Eight to fifteen days 40 paise per day
Sixteen to thirty days 60 paise per day
80 paise per day
More than thirty days
answer in stream class
Answers
Answered by
1
Answer:
Define a class Library having the following description:
Data Members Purpose
String name to store name of the book
int price to store the printed price of the book
int day to store the number of days for which fine is to be paid
double fine to store the fine to be paid
Member functions Purpose
void input() To accept the name of the book and printed price of the book
void cal() Calculates the fine to be paid
void display() Displays the name of the book and fine to be paid
Write a program to compute the fine according to the given conditions and display the fine to be paid.
Days Fine
First seven days 25 paise per day
Eight to fifteen days 40 paise per day
Sixteen to thirty days 60 paise per day
More than thirty days 80 paise per day
Similar questions
Social Sciences,
1 month ago
Physics,
1 month ago
English,
2 months ago
Computer Science,
2 months ago
English,
9 months ago
Social Sciences,
9 months ago