Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

need help i need 2 instead of 8 for leftovers how do i do it? for number 6 Finde

ID: 3872760 • Letter: N

Question

need help i need 2 instead of 8 for leftovers how do i do it? for number 6

Finder File Edit View Go Window Help Ocs150-2337 x D MobilePhotou x-DCS 150 (69 u xi D cho2-Variable X" Dcs501DE x YI, cs 150-c+-x-e //processings x tavi C à Secure | https://ide.cs50.io/soctavio98/.de50#openfile-x Screen Shot 2017-09-...08.41 PM C$50 IDE File Edit Find View Go Window cs150 11 string STUDENT = "soctavio". // Add your Canvas login nome 12 extern string ASSIGNMENT 13 Screen Shot 2017-09-…08.02 PM 15 16 the purpose of this program is to show what prizes you can get with the amount of points you get from redeem cuopons 17 ereturn for success 18 19 int run) 102 h02.app h02.0 21 input: title and number of coupons to redeem output:shows the amount of coupons you typed and what coupons awards you can get from the amount you typed given:for 10 coupons 1 full length downlood current feature film, 3 coupons-downlood half hour episode 1968 classic old rerun televison show processing-films coupons 18, 23 ibh02.a 26 27 28 Screen Shot 2017-07-.. 27.44 PM / title cout

Explanation / Answer

Dear Student,

-------------------------------------------------------------------------------------------------------------------------------------------

If number input number is 18 then, your given code must be changed to following if you want to print the leftovers value = 2;

The code snippet will be as following...

int films = coupans / 10;

int leftovers = coupans % 10;

int sitcoms = leftovers / 3;

leftovers = leftovers/3;       //in this statement the leftovers value = 2 if the input is 18.

----------------------------------------------------------------------------------------------------------------------------------------

If number number is 6 then, your given code must be changed to following if you want to print the leftovers value = 2;

The code snippet will be as following...

int films = coupans / 4;

int leftovers = coupans % 4;

int sitcoms = leftovers / 3;

----------------------------------------------------------------------------------------------------------------------------------------

Kindly Check and Verify Thanks...!!!