Question: Write a function that takes, as arguments, two objects, value1 and value2. If value1 and value2 are either integers or strings containing only digits, cast

Write a function that takes, as arguments, two objects, value1 and value2. If value1 and value2 are either integers or strings containing only digits, cast value1 and value2 to integers and compute their average. If their average is greater than 50, return the string "Above 50" and if the average is less than 50, return the string "Below 50". If the average is equal to 50, return the string "Equal to 50", and if value1 or value2 are not integers or strings containing only digits, return the string "Invalid Input". Name this function compareToFifty(value1, value2) valuel 25 100 "45" 25 24.5 "hello" value2 25 "300" "100" 75 67 world" compareToFifty(value1, value2 "Below 50" "Above 50 "Above 50" "Equal to 50" "Invalid Input" "Invalid Input
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
