Computer Science, asked by arghasarkar53, 10 hours ago

7. Write a program to accept the name of the member , the name of the book and number of days and calculate the late fine for the member. The fine is calculated depending on the number of days a book is returned late. Number of days. Fine per day For first 10 days. Rs. 1 Next 10 days. Rs 5 More than 20 days. Rs.8 Display the name of the member, the name of the book and total fine​

Answers

Answered by Equestriadash
2

The following co‎des have been written using Python.

\tt na me\ =\ in put("Enter\ your\ na me:\ ")\\nb\ =\ in put("Enter\ the\ na me\ of\ the\ book:\ ")\\d\ =\ int(in put("Enter\ the\ number\ of\ days:\ "))\\if\ d\ <=\ 10:\\{\ \ \ \ \ }f\ =\ 1*d\\elif\ d\ <=\ 20:\\{\ \ \ \ \ }f\ =\ 5*d\\elif\ d\ >\ 20:\\{\ \ \ \ \ }f\ =\ 8*d\\print()\\

\tt {\ \ \ \ \ }print("Na me\ of\ the\ member:\ ", na me)\\{\ \ \ \ \ }print("Na me\ of\ the\ book:\ ", nb)\\{\ \ \ \ \ }print("Total\ fine:\ ", f)\\

Variables with appropriate data types have been used to retrieve the required data from the user(s). The number of days is checked and concluded using conditional statements [if - elif] which are usually used to check for required conditions. The required output is printed later.

Similar questions