scanf("%d%d",pea,cas);
if(pea<20)
{
w1=pea*3;
if(w1>20){
w1=(w1*90)/100
}
}
else{
printf("peanut weight more than 20 pounds")
}
if(cas<20)
{
w2=cas*5;
if(w2>20){
w2=(w2*90)/100
}
}
else{
printf("cashew weight more than 20 pounds")
}
test cases
peanut cashews price of peanut price of cashew discount on peanut discount on cashew
5 6 15 27 no yes
8 5 21.6 22.5 yes yes
21 21 more than 20 pounds more than 20 pounds
5 21 15 more than 20 pounds no
21 6 more than 20 pounds 27 yes
The Brookings Nut house sells peanuts for $3 per pound and cashews for $5 per pound with a 10% discount for orders over $20. Since this is a special offering there is a limit of 20 lb for each kind o...