You are on page 1of 5

1- Create a function that takes a string and returns it as an integer.

Examples
stringInt("6") ➞ 6
stringInt("1000") ➞ 1000
stringInt("12") ➞ 12

2- Create a function that takes a string and changes the word amazing to not amazing. Return the
string without any change if the word edabit is part of the string.

Examples

amazingEdabit("edabit is amazing.") ➞ "edabit is amazing."


amazingEdabit("Mubashir is amazing.") ➞ "Mubashir is not amazing."
amazingEdabit("Infinity is amazing.") ➞ "Infinity is not amazing."

3- WordCharWord
Create a function that will put the first argument, a character, between every word in the second
argument, a string.

Examples

add("❤", "I love Tesh!") ➞ "I❤love❤Tesh!"


add("👍", "Java is a lot of fun.") ➞ "Java👍is👍a👍lot👍of👍fun."
add("#", "hello world!") ➞ "hello#world!"
add("&", "you me world") ➞ "you&me&world"

4- Testing K^K == N?
Write a function that returns  true  if  k^k == n  for input  (n, k)  and return  false  otherwise.

Examples

kToK(4, 2) ➞ true
kToK(387420489, 9) ➞ true
// 9^9 == 387420489
kToK(3124, 5) ➞ false
kToK(17, 3) ➞ false

5-
6-

You might also like