quiz حل الأسئلة الجامعية manage_search الأرشيف

تم الحل ✓
categoryبرمجة وتطوير البرمجيات schoolبكالوريوس event_available2026-07-15

السؤال

Transcribed Image Text:

Question 1 (10 points) Write a C program that computes the fee of renting a book from the library. To compute the book's rent fee the following information is provided for each book ■ Book publication year ■Rent duration: how long the book was rented in days. ■Maximum allowed duration: the maximum duration the library allows its members to rent the book in days. ■if this duration is exceeded, a penalty will be taken from the renter The library criteria to compute the rent fees are as follows: if the book's publishing year is after 2010 the fee is 6 Riyals per day. Otherwise it is 3 Riyals per day. if the rent duration exceeds the maximum allowed duration, the daily fee for each additional day is %20 more than the original daily fee. Notes: You should prompt the user to enter the values similarly to the sample run below. Your output should be rounded to a single decimal place Sample runs: C P 3:1 ENG 12/5 Home End Inser ■ You should prompt the user to enter the values similarly to the sample run below. ■ Your output should be rounded to a single decimal place Sample runs: Enter the publication year of the book 1997 Enter the renting duration: 23 Enter the maximum allowed rent duration for this book 15 The rent fee = 73.8 Enter the publication year of the book 2019 Enter the renting duration: 5 Enter the maximum allowed rent duration for this book: 20 The rent fee = 30.0 In []: 1 %code q1 2 //YOUR CODE HERE 3 itt H 22 1- 27 4+ 9 --- *+ ge FE FB 8 ENG 3: 12/ * Home End Inse FID FAY 912

check_circle الجواب — حل مفصل خطوة بخطوة

hourglass_top