Question
This is in Swift 1. Please write a program to determine whether or not a string is a Palindrome, which is a word or phrase
This is in Swift
1. Please write a program to determine whether or not a string is a Palindrome, which is a word or phrase that reads the same backward and forward. For example, radar and madam are both palindrome. The functions name MUST be isPalindrome and its return value MUST be a Boolean. You need to decide the parameters.
2. Please write a program to create an array of 20 Integers. Then find how many of those values are odd; how many of those values are even. Your function MUST return two results: the number of odd and the number of even.
3. Please write two functions: MultiplyDoubles and AdditionDoubles. MultiplyDoubles multiplies two Double values together. AdditionDoubles adds two Double values together. Then write a function named SelectOperation with one Boolean parameter named flag. If flag is true, the function SelectOperation returns MultiplyDoubles; otherwise, it returns AdditionDoubles. You must call this SelectOperation function in your code.
4. Please write a closure expression in which decides if a number is a prime number or not. You must assign the closure expression to a constant and use it in your program at least once.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started