I do not want a program written for this. Just a, b, and c explained to me pleas
ID: 3197214 • Letter: I
Question
I do not want a program written for this. Just a, b, and c explained to me please.
5. (15 pts extra credit) Professor McGonagall has provided the young wizard Ron with three magical batteries whose sizes are 42, 27, and 16 morts, respectively. (A mort is a unit of wizard energy.) The 27-mort and 16-mort batteries are fully charged (containing 27 and 16 morts of energy, respectively), while the 42-mort battery is empty, with 0 morts. McGonagall says that Ron is only allowed to use, repeatedly, if necessary, the mort transfer spell when working with these batteries. This spell transfers all the morts in one battery to another battery, and it halts the transfer either when the source battery has no morts remaining or when the destination battery is fully charged (whichever comes first)Explanation / Answer
1stly we know that there are three bettary ..with capacity of 27,16,42 morts .
total morts availbale is 27+16+0=43
now our ques is transfer the morts from 27 or 16 and that left with 12 morts .
so for this if we transfer 15 morts from 27 that it remain with 12 morts .
27-15=12
for 15 transfer in morts 16 we need 1 morts already there .
so find below image for transfer .
1) as shown above its a graph example .of transfer morts from one to another file but with some basic common logic .
Thanks
if u need any helf then comment .
battery name current morts transfer from 27 to 43 transfer from 16 to 43 transfer from 43 to 27 transfer from 27 to 16 16 size battery 16 16 1 1 16 27 sizs battery 27 0 0 27 12 42 size battery 0 27 42 15 15 comment battery is full so 1 left in 16 battery 16 battery is full show it left with 12.Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.