Previous Section  < Day Day Up >  Next Section

LAB 46: THE select LOOP

  1. Write a script that will do the following:

    1. Provide a comment section at the top of the script, with your name, the date, and the purpose of this program.

    2. Use the select loop to provide a menu of foods. The output will resemble the following:

      
      $ foods
      
      1) steak and potatoes
      
      2) fish and chips
      
      3) soup and salad
      
      Please make a selection. 1
      
      Stick to your ribs
      
      Watch your cholesterol
      
      Enjoy your meal.
      
      
      
      $ foods
      
      1) steak and potatoes
      
      2) fish and chips
      
      3) soup and salad
      
      Please make a selection. 2
      
      British are coming
      
      Enjoy your meal.
      
      
      
      $ foods
      
      1) steak and potatoes
      
      2) fish and chips
      
      3) soup and salad
      
      Please make a selection. 3
      
      Health foods...
      
      Dieting is so boring.
      
      Enjoy your meal.
      
      
      
      $ foods
      
      1) steak and potatoes
      
      2) fish and chips
      
      3) soup and salad
      
      Please make a selection. 5
      
      Not on the menu today!
      
      

  2. Rewrite the lookup script using the select command to create a main menu and a submenu. The menu will resemble the following:

    
    1) Add Entry
    
    2) Delete Entry
    
    3) Update Entry
    
    4) View Entry
    
         a) Name
    
         b) Phone
    
         c) Address
    
         d) Birthday
    
         e) Salary
    
    5) Exit
    
    

    Previous Section  < Day Day Up >  Next Section