ALI N
2011-11-28 10:41:11 UTC
2) Loop requesting user input of a single word of data to a maximum of ten times or when user enters “n”. Then display the data entered.
3) (a) prompt the user to enter the letter "l", "p" , "w" or "q"
(b) depending on the input from (a), do the following
(use a C shell case construct ):
l Execute the ls command
p Execute the pwd command
w Execute the whoami command
q Quit the program
If an input other than "l", "p", “w" or “q” is provided,
display the message: "Sorry, that is not a valid option"
(c) The script should continue looping, asking for and processing the input, until the
user enters "q" to quit the program.
4) Perform the following:
- Clear the screen
- Declare an array to hold 10 numbers
- Prompt the user for a number between 1 and 100 (or ENTER to terminate), display an error message if the number is no in this range and reprompt for a number
- Store the number in the array
- Loop repeating steps 3 and 4, include logic so the loop is repeated a maximum of 10 times, terminate the loop if the user just hits return
- Display the following calculations (with labels describing the output):
The sum of all the numbers The average of all the numbers The number of numbers entered The largest number entered The smallest number entered