A webpage with the user input window to collect user input, convert input into string based on specific rules and return that string.
This webpage takes following user input: number, user's name, and lets user to choose the order of the number conversion. The program accept user input only if number contains digits, otherwise it throws an alert message: "Please enter an integer number!" and user name is not an empty string, otherwise it throws an alert message: "Please enter your name!". Then the program returns a range of numbers from 0 to the chosen number with the following exceptions:
- Numbers that contain a 0 are replaced (all digits) with "Beep!"
- Numbers that contain a 1 are replaced (all digits) with "Boop!"
- Numbers divisible by 3 are replaced with "I'm sorry, Dave. I'm afraid I can't do that."
-
Program replaces 0 with "Beep!"
- Example Input: 0
- Example Output: ["Beep!"]
-
Program replaces 1 with "Boop!"
- Example Input: 1
- Example Output: ["Boop!"]
-
Program replaces numbers divisible by 3 with "I'm sorry, [user name]. I'm afraid I can't do that."
- Example Input: 1
- Example Output: ["I'm sorry, [user name]. I'm afraid I can't do that."]
-
If a number contains both 0 and 1, program replaces the whole number with "Boop!"
- Example Input: 10
- Example Output: ["Boop!"]
-
If a number contains 0 and/or 1, and divisible by 3, program replaces the whole number with "I'm sorry, [user name]. I'm afraid I can't do that."
- Example Input: 180
- Example Output: ["I'm sorry, [user name]. I'm afraid I can't do that."]
-
If a user checked "From 0 to the chosen number" radio button then program returns numbers in a range from 0 to chosen number with exceptions listed above
- Example Input:
- 4
- Dave
- From 0 to the chosen number: checked
- Example Output: [Beep! Boop! 2. I'm sorry, Dave. I'm afraid I can't do that. 4.]
- Example Input:
-
If a user checked "In reversed order" radio button then program returns numbers in a range from chosen number to 0 with exceptions listed above
- Example Input:
- 5
- John
- In reversed order: checked
- Example Output: [5. 4. I'm sorry, John. I'm afraid I can't do that. 2. Boop! Beep!]
- Example Input:
-
Program throws an alert message "Please enter an integer number!" if user input contains an empty string.
- Example Input: ""
- Example Output: ["Please enter an integer number!"]
-
Program throws an alert message "Please enter an integer number!" if user input doesn't contain digits (user input contains only letters).
- Example Input: a
- Example Output: ["Please enter an integer number!"]
-
Program throws an alert message "Please enter an integer number!" if user input contains letters or other signs among the digits.
- Example Input: 7i
- Example Output: ["Please enter an integer number!"]
-
Program throws an alert message "Please enter your name!" if user input at name window is empty string.
- Example Input: ""
- Example Output: ["Please enter your name!"]
- Clone this repository
- Find index.html file in the repository
- Open index.html file with your web browser of choice.
None
If You run into any issues or have questions, ideas, concerns or would like to make a contribution to the code, please contact Eva Antipina via email: eva.antipina@gmail.com.}
- HTML
- CSS
- JavaScript
- Bootstrap
- jQuery
Not licensed
Copyright (c) 2018 Eva Antipina