Question: write a cobol program on below requirement . Given the following three values total number of maximum chocolates you can eat. 1 . Money you

write a cobol program on below requirement .Given the following three values total number of maximum chocolates you can eat.
1.Money you have to buy the chocolates.
2.Price: price of a chocolate.
3.wrap number of wrapers to be returned for getting one extra chocolate.
all are positive integers and greathan 1
Please write cobol program and test for 4 inputs and give outputs also.
example:-
Money =15
Price =1
Wrap =3
output =22
explanation :- but and eat 15 chocolates.
return 15 wrapers and get 5 more chocolates (because for every 3 wrapers they will get 1 chocolate)
eat 5 chocolates and give 3 wrapers and hold 2 wrapers with you.
eat 1 chocolate and give 3 wrapers (old 2+ current wrapers)
get 1 more chocolate.
so total 22.
using cobol ACCEPT verb. please test using online compiler also test throughly

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!