Write a function called Reverse that takes in a string value and returns the string with the characters in reverse. If the string reads the same forwards as it does backwards the function should output “[word] is a palindrome!”.
Ex:
Reverse(“apple”)
outputs elppa
Reverse(“racecar”)
outputs racescar is a palindrome!
Hint: Make sure you take in your input and then make it lower case using the .lower() method.
Create a stack class in java where the stack is defined using an String type array and the size of the stack is provided by an instance variable. There should be an instance variable to track the top index of the stack. Define a constructor to initialize the size of the stack and the variable to track the top index of the stack. It is to be said that the minimum size of the stack should be 10. Define two methods void push(String item) and String pop() to conduct the insertion and deletion process in the stack. After filling up the stack with the maximum items possible, pop out 4 items from the stack and then output the sum of the remaining items in the stack.
USE;Dynamic Event Listeners
Achieve the given functionality.
CSS Colors used:
Text colors Hex code values used:
#0000ff
USE;
Creating and Appending Elements Dynamically with JS.
Use the below reference image.
Achieve the given design using JS.
CSS Colors used:
Text colors Hex code values used:
#0000ff
Achieve the given functionality using JS.
In main take two numbers as input num1 and num2. Main thread will create 2 more threads.
1. T1: Output sum of numbers from min(num1 , num2) to max(num1 , num2)
2. T2: Take a string as input and count num1 and num2 in it.
Define a function named "calAverage" which take a list of integers as parameter. This function will then calculate and store the average into a variable named "result". Finally, the function MUST return the result with 2 decimal place only. For Example given the following list, [2,6,8,3,4,6], the function will return 4.83 (float).
Define a function named "secondLarge" which take a list of numbers (integer) as parameter. This function will then identify and return the 2nd largest number in the list. The function will return smallest number if the parameter only contains two numbers. While the function will return the only number if the list contain only single number. On some odd case, the function will return -999 if the parameter contains other datatype i.e. string or floaat in the list.
Define a function named "isValidPassword" which take a string as parameter. The function will
then check if the supplied string fulfilled the following password criterias:
1) must have combination of uppercase and lowercase
2) must have at least 3 digits
3) must have at least 2 special character (including whitespace).
4) must have at least 10 characters (combination of alphanumeric and special symbol)
The function will return a Boolean value i.e. True if all criterias are met or return False
otherwise.
Make sure you test your function with every single possible input that may return False value
as well.