Question
pseudo-code and script to count down by getting a number from the user with the following conditions: Condition 1) If the number is between 0
Condition 1) If the number is between 0 and 20, then start counting down from the entered number.
Condition 2) If the number is less then 0, then display an alert stating \" is invalid as it is below 0.\", where is the number that the user entered.
Condition 3) If the number is greater then 20, then display an alert stating \" is invalid as it is above 20.\", where is the number that the user entered.
Must use if, if-else, if-else-if or nested and while or for conditional statements
2) Pseudo-code and script to get the average of X values. You must ask the user \"How many numbers you want to enter (0 to 10)?\", then get each value from the user to calculate the average (round to the nearest tenth with formula below) and display an alert stating \"The average is: \", where is the calculated average.
Must use if, if-else, if-else-if or nested and while or for conditional statements
Formula:
P is the place value you want to round
INTEGER() converts to an integer number
3) pseudo-code and script to display all the odd numbers from 0 to 50. You must store the values separated by white space in a string and display the values on the console.
Use concatenation
Must use if, if-else, if-else-if or nested and while or for conditional statements
4) pseudo-code and script to display theFibonacci Sequence[i]. You must ask the user to enter a number with the following conditions:
Condition 1) If the number is 1, then display the first number in the sequence in the console.
Condition 2) If the number is 2, then display the first and second number in the sequence in the console.
Condition 3) If the number is between 3 and 20 (inclusive), then display the sequence separated by white space stored in a string variable up to the number entered by the user in the console.
Condition 4) If the number is less then 1 or greater then 20, then display an alert stating \"Invalid number was entered! Please enter a number between 1 and 20.\"
After displaying the result, or error, you must ask the sure \"Do you want to try another number for the sequence? (-1 = no or 1 = yes).
Hint: Use a do-while for asking the user if they want to continue. You will need a variable to hold the responds of they do or don't want to continue.
Must use if, if-else, if-else-if or nested and while or for conditional statements
5) pseudo-code and script to display the initials of a full name. For example, \"John Doe\" would display \"JD\" or \"John Henry Do\" would display JHD. You must ask the user to enter a full name, then display the initials as an alert stating \"Your initials are !\", where is the parsed initials from the user input.
You are going to have to use the Trim property of Strings to remove all white space before and after the string before parsing. Ex: name.trim(); where \"name\" is a variable String. You are going to have to use a flag variable to get the next character after reading a white space. Use the String length property to determine length of the string. Ex: name.length; where \"name\" is a variable String.
Must use if, if-else, if-else-if or nested and while or for conditional statements
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started