In this lab, you will practice using an if-statement to determine the color of a pocket on a roulette wheel. You will also practice while loops to improve on a sales commission program.
On a roulette wheel, the pockets are numbered from 0 to 36. The colors of the pockets are as follows:
Write a program that asks the user to enter a pocket number. Display whether the pocket is green, red, or black. Display an error message if the user enters a number that is outside of the range 0 through 36.
Improve the sales commission calculator from lecture (code shown below). The two improvements to make are:
Your final version of this program must still use a sentinel value to end the loop. If you want to change the sentinel value used, justify this decision in your assignment information sheet.
Answer the following question on your assignment information sheet.
Complete the Assignment Information Sheet.
Submit your final program and assignment information sheet (zipped into one file) to CourseWeb in the Lab 3 assignment.
The grading rubric can be found here: Rubric (doc).
The assignment is due Monday, June 8 by 11:30 am. As with all programming assignments, you have unlimited uploads (before the deadline), so you may upload the assignment before the deadline. If you later decide to upload another, you may do so without penalty (as long as it's before the assignment deadline). The last submission uploaded before the deadline will be the one graded. If you would like ungraded feedback on a programming assignment, you may send an email to your TA or the instructor and ask for feedback; please send your code as well.
For more advice on submitting your assignment, see the Programming Assignments section of the Tips for Success page.