1. Write a C shell script called greeting that asks the user how they are doing today. If the user enters anything other than “fine”, the script should ask the user again how they are doing. Eventually, when the user enters “fine” for their answer, the script should write out a message saying the computer is fine too. You will need to use a while loop
while true; do
read -p "How are you doing today:" yn
if [ "$yn" = 'fine' ];
then
echo 'Computer is fine too.!';
exit;
fi
done
1. Write a C shell script called greeting that asks the user how they are doing...
Write a short, interactive shell script that Asks the user for a numeric variable A Asks the user for a numeric variable B Echoes the text “A minus B equals:”
Write a script that asks the user to input a number. If the value the user enters is a negative value, call the pre-defined function neg_value which consumes no arguments and returns no values. If the user enters a positive value, call the pre-defined function pos_value which consumes no arguments and returns no values. If the user enters a zero, display the message "Invalid Value". Doing this on Python. This is what I have: number = int(input("Enter a number: "))...
Write a Bash script called hello that uses command line arguments to allow the user to put two strings after the command name, when the script is being executed. These strings should represent a first and last name. The script should then write out a greeting to the user that includes the first and last name. Here is an example of how the script might work (the first line represents what the user types to launch the script): [user@HAL] hello...
RandomGame.cpp (2pt) Write a program that asks the user to enter his/her name. Then begin a do while loop that asks the user to enter a number between 1 and 10. Have the random number generator produce a number 1 and 10. Display the user’s name and both numbers to the screen. Compare the two numbers and report if the entered number is greater than, less than, or the same as the generated number. Ask the user if he/she’d like...
Write a program that asks the user to type an even number or 111 to stop. When the user types an even number, display the message “Great Work”, and then ask for input again. When the user types an odd number, display the message “Try again” and ask the user to enter again. When the user enters the sentinel value of 111 the program ends I've attempted this but it went horribly wrong. we are only suppose to use while,...
Write a script called makeChange that prompts the user for a monetary amount in cents less than or equal to 99 cents (i.e. less than a loonie) and then prints how change would be made for that amount out of quarters (25-cent coins), dimes (10-cent coins), nickels (5-cent coins) and pennies (1-cent coins). The change your script specifies should be the minimum number of coins. For example, when making change for 88 cents, the result should indicate 3 quarters, 1...
Write a piece of code that enters a loop and asks the user to input anon-negative number. If the user enters a negative number, the code goes back into the loop and asks the user again to enter a non-negative number. The code keeps going back into the loop until the user enters a non-negative number. Notice that the code enters the loop at least once. This is an application of 1 to N loop.Therefore, use a Do While statement.
NIT1202 Operating Systems UNIX Script You are required to write a Bourne Again Shell Script (bash) to manage a menu driven program. When executed the user should be presented with a menu with 4 (four) options: Print the following user information: the home directory, path, userid , login shell together with the current date and time. Ask a user a range and it displays eight random number between the range. [Range difference must be 100. Example Enter a range: 200...
Script 1: Sum of Numbers Write a python program that asks the user to enter a series of single-digit numbers with nothing separating them. The program should display the sum of all the single digit numbers in the string. For example, if the user enters 2514, the method should return 12, which is the sum of 2, 5, 1, and 4.
in Linux, BASH Shell Write a while loop script called count that counts and prints the numbers 0 thru 9 without issuing a new line after each output.