Students are asked to code the following table:
Number Of passengers  Yearly fee 
< 2  $100 
2  10  $300 
11  20  $500 
> 20  $1000 
All of the solutions are wrong! In each case, draw a flow chart of the solution and find at least one error in each proposed solution. Fill in the following table:
passengers  Sol #1 fee  Sol #2 fee  Sol #3 fee  Sol #4 fee  Sol #5 fee  Sol #6 fee 















fee = 100;
if (passengers > 20)
fee = 1000;
if (passengers > 10)
fee = 500;
if (passengers > 2)
fee = 300;
fee = 100;
if (passengers > 2)
fee = fee + 200;
if (passengers > 10)
fee = fee + 400;
if (passengers > 20)
fee = fee + 900;
fee = 100;
if (passengers >= 2)
fee = fee + 200;
else if (passengers > 10)
fee = fee + 400;
else if (passengers > 20)
fee = fee + 900;
fee = 100;
if (passengers >= 2)
if (passengers >= 10)
if (passengers >= 20)
fee = fee + 900;
else
fee = fee + 400;
else
fee = fee + 200;
fee = 1000;
if (passengers < 20)
fee = 500;
if (passengers < 10)
fee = 300;
if (passengers < 2)
fee = 100;
fee = 100;
if (2 <= passengers && passengers <= 10)
fee = 300;
else if (10 < passengers && passengers <= 20)
fee = 500;
else
fee = 1000;