#K75872. Compute Rental Fees
Compute Rental Fees
Compute Rental Fees
You are given a list of customer rental records. Each record contains a customer's name, a book id and the number of rental days. The program must compute the total rental fee for each customer based on a fixed inventory of books. The inventory and their respective rental rates are given as follows:
- Book 1: \(0.50\)
- Book 2: \(0.75\)
- Book 3: \(0.60\)
- Book 4: \(0.65\)
- Book 5: \(0.55\)
If a customer rents a book whose id is not present in the inventory, output "Book not found". For valid records, compute the fee as:
\( \text{fee} = \text{rental_rate} \times \text{rental_days} \)
Finally, output the results for each record on a separate line. For valid records, print the customer name followed by the fee (formatted with two decimal places), otherwise print "Book not found".
inputFormat
The first line of input contains an integer n representing the number of customers. The following n lines each contain three values: a string customer_name, an integer book_id, and an integer rental_days, separated by spaces.
outputFormat
For each customer, print the computed result on a new line. If the book exists in the inventory, output the customer's name followed by the total rental fee (formatted to two decimal places). Otherwise, print "Book not found".
## sample3
Alice 1 10
Bob 3 5
Charlie 6 7
Alice 5.00
Bob 3.00
Book not found
</p>