Consider the follow code segment It is designed to classify

Consider the follow code segment. It is designed to classify widgets as too small if they are less than 10mm in diameter or too large if they are 15mm in diameter or more. Otherwise they should be classified as just right. However, this code may contain a bug. Examine the program, and identify what bug, if any, is present.

Solution

if(size >=0 && size <10);

print(\"Too Small\")

elif(size >=10 && size <15);

print(\"Just right\")

elif size >=15;

print(\"Too big\")

 Consider the follow code segment. It is designed to classify widgets as too small if they are less than 10mm in diameter or too large if they are 15mm in diame

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site