LESSON+6

 **LESSON 6** //**Selective structures: Case Construct**// Case construct is an efficient way to creating menus. It does not however allow the coder to do anything that an if statement can't do; it's just better at handling certain tasks. Try this:

**var command: int**
 * loop**


 * put "Choose from 1 to 4:"..**
 * get command**
 * casecommand of**


 * label 1:**


 * put "Hi there"**


 * label 2: **


 * put "How are you? " **


 * label 3: **


 * put "Really?" **


 * label 4: **


 * put "Bye Bye" **


 *  label: **


 * put "That is not an option " **
 * exit **


 * end case **


 * end loop **

Notice that the final label functions similarly to an else. //** Task: **// 1) Write a traffic light program. The traffic light itself should be a graphic. It will flash a light colour at random.Ask the user what colour the light is and output the correct instructions for the chosen light colour. 2) Write a program that will convert the user's weight to the equivalent weight on any other planet.The user should be able to choose which planet. 3) Modify 2 such that a picture of the planet is displayed. <span style="font-family: Arial,Helvetica,sans-serif;">**For Part 3 your will need to use Pic.ScreenLoad. Often when coding a program you may not have all the knowledge about the subject of the program.You should, however, have all the knowledge you need to research it.**