Question

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...

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 of nut for each customer. A unit has been programmed to compute the price of an order given the weights of peanuts and cashews. The unit is required to print an invalid data message for weights that are negative or over 20 lb for each kind of nut.

Write a complete unit test plan, that including derivation of test cases, and test cases
0 0
Add a comment Improve this question Transcribed image text
Answer #1

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

Add a comment
Know the answer?
Add Answer to:
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...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT