antieva / Beep-Boop

Third week project assignment at Epicodus. Arrays and looping.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Beep Boop Converter

A webpage with the user input window to collect user input, convert input into string based on specific rules and return that string.

By Eva Antipina

Description

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."

Specifications

  • 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.]
  • 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!]
  • 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!"]

Setup/Installation Requirements

  • Clone this repository
  • Find index.html file in the repository
  • Open index.html file with your web browser of choice.

Known Bugs

None

Support and contact details

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.}

Technologies Used

  • HTML
  • CSS
  • JavaScript
  • Bootstrap
  • jQuery

License

Not licensed

Copyright (c) 2018 Eva Antipina

About

Third week project assignment at Epicodus. Arrays and looping.


Languages

Language:HTML 50.9%Language:JavaScript 35.3%Language:CSS 13.8%