Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A librarian charges a fine for books, if returned late. The tariff for the fine is:1- 40 paise per day for the first ten

A librarian charges a fine for books, if returned late. The tariff for the fine is:1- 40 paise per day for the first ten days, 2- 60 paise per day for eleven to twenty days, 3-80 paise per day for more than twenty days. This algorithm *.calculates the fine assuming that a book is returned 'N' days late 4. If D 10 then fine-40*10+((D *60), 5.1f D>20 fine =40*D+60*D+((D-20) *80) O 4. If D>10 & D 20 then fine =40*10+60*10+ ((D-20) *80) 4. If D 20 fine =40*10+60*10+((D-20) *80) O 4. If D>10 & D 20 fine =40*10+60*10+(D*80) O 4. If D 20 then fine =D *80 O This algorithm finds and prints the sum and number of positive numbers for * .ten input values of X 4-lf X>0 then (S%=S+X, N=N+1,l=I+1} 5-lf I 0 then (X=X+S, N=N+1} 5-1If I 0 then (S=S+X, N=N+1} 5-lf l=10 then {I=I+1, go to step 3.) 4-lf X>0 then (S=S+X, N=N+1} 5-If I 0 then (S=S+X} 5-If I 0 then{l=l+1, go to step 3.) O

Step by Step Solution

3.34 Rating (157 Votes )

There are 3 Steps involved in it

Step: 1

Answer 3 Answer is B 4 If D10 D 20 then fine40106010D2080 Explanation For 4 th step in algorithm in ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Derivatives Markets

Authors: Rober L. Macdonald

4th edition

321543084, 978-0321543080

More Books

Students also viewed these Accounting questions