Implement your own random function that builds on this function, returning an integer between a low and a high number supplied by the user, but that can be called with the low number optional (default to 0). Show us that your function works by creating a tester function that uses logical statements to test that returns true if the function worked correctly. The inputs for the function should be the value to test, and the min and max values that you are testing out.
// Your code here
2. String Formatting Function Write a function that expects 2 inputs. The first input is an array of titles (strings), and the second input is a number. Given these inputs print the following string (replacing N and Title with the dynamic values passed in to the function each time it runs). The number N bestseller today is: Title If not already title-cased, the function should title-case the string. Build another function making the second input optional (keeping the 1st required). Build one function making the first input optional (keeping the 2nd required). Build a third function making both inputs optional.
3. Password Validation Function Write a password validation function. The user should input a password that meets the criteria listed below. You can pass the password as a function argument. Validate that the user’s password matches this criteria. If password is valid, print a helpful success message. password length must be 8-14 characters password must contain at least 2 digits password must contain at least 1 uppercase letter password must contain at least 1 special character from this set !@#$%^&*()-_+= Inputs: A string that will be tested for the password requirements. The string can be passed as an argument to the function, or as an input through the input function. Outputs A success message if the password works, otherwise an error message.
4. Exponentiation Function Create a function called exp that asks for two digits and then prints an exponentiation, without using the exponentiation operator (**). You may assume these are positive integers. Use at least one custom-defined function. For example, some outputs of this function could be: 2 , 3 => 8 5 , 4 => 625 Inputs: An integer that will be recursively multiplied An integer that will define the number of times to multiply the number to get the exponentiation. Outputs: An integer that is the result of the exponentiation. Hint: You can recursively multiply a number. The second number defines the number of times the recursive loop happens. Every time the loop happens, you can redefine the variable that gets multiplied.
6. Hangman Game (BONUS) Implement a basic hangman game through functions. Show a user the word or phrase (5-15 letters) that they have to guess with dashes as placeholders for unsolved letters. You can hardcode this word into your source. Prompt the user to guess a letter or solve the puzzle through the user input function. They get up to 8 guesses. After each guess, show the word with any instances of correctly guessed letters filled in. Show the number of tries left. Handle possible issues with user input in a consistent way. Continue to prompt the user until either they’ve used up their 8 guesses or solved. If they solve the puzzle in time, show the completed word and a congratulatory message. If they fail to solve the puzzle, show the completed word and a Game Over message. Here’s a sample transcript. You have 8 Guesses to solve this word. Guess a letter or solve: b b--b--b-- (7 tries left) guess a letter or solve: x b--b--b-- (6 tries left) guess a letter or solve: e b--b-ebee (5 tries left) guess a letter or solve: bumblebee bumblebee (4 tries left) Congratulations, you won! Inputs: A string that will be tested to see whether or not it is part of the secret word. Outputs: A message that shows the user the number of guessed letters at the time. A success message if the user wins, otherwise a try again message.