Lab 10, Part 2 -------------- This is the program that converts 'three four one' to 341. It was marked out of 10. 1) Obviously, you scored 0 if yours didn't compile. 2) Obviously, you scored close to nothing if yours was incomplete or if it failed to follow the instructions - for example, if it echoed a '3', then a '4', then a '1', instead of computing 341. 3) Most of you scored 9 out of 10. Well done. Your solution was along the following lines: Get the user's input (a string) Explode it into an array called \$words \$answer = 0; \$exp = count( \$words ); foreach ( \$words as \$word ) { Use a big if-statement to convert \$word to 0 or 1 or 2 or ... Call this \$num; \$count--; \$answer += pow( 10, \$exp ) * \$num; } echo \$answer; The reason you didn't score 10 is that there is a more efficient and cleverer solution than yours - one which does not use count or pow at all. I won't explain it here - because it would confuse most of you. Very well done to the one student who found this solution. 4) If you didn't get 9, but got a high mark such as 7, then it's probably because your solution was more cumbersome (and hence less efficient) that the one sketched above - for example, many of you used a foreach to change the array of words into an array of numbers, and then another foreach to do the calculations.