|
home—info—exams—lectures—labs—hws
Recipe—Laws—lies—syntax—java.lang docs—java.util docs
Write the following functions (in order, without skipping any). Strive for neat-looking, well-organized code1 which follows The Laws of Programming. For each function, include comments, signature, and test cases.
BMI interval | category |
[0,18) | underweight |
[18,25) | normal |
[25,30) | overweight |
[30,∞) | obese |
When printing the hardcopy, have the top sheet be your documentation (the interface view). Alas, since BlueJ curiously omits a 'print' button when you are in interface view, you can print your documentation as follows:
If you used BlueJ's unit test facility, also print out unit test class for your program. (Also, attach that .java file in WebCT/Blackboard as well.)
1It's possible to have a function which gives the correct answers, but with no test cases, no named constants, and bad indentation it could get zero points. ↩
2 This formula takes a person's weight, adjusting for how tall they are. The squaring stems from the fact that if person A is (say) 10% taller than person B, then A is allowed by to 10% wider, but not 10% thicker. So you square the person's height, rather than cube it. ↩
home—info—exams—lectures—labs—hws
Recipe—Laws—lies—syntax—java.lang docs—java.util docs
©2007, Ian Barland, Radford University Last modified 2007.Nov.16 (Fri) |
Please mail any suggestions (incl. typos, broken links) to ibarlandradford.edu |