The following projects were created using the programmatic capabilities of the Salesforce platform
Given Integers a, b, and c, determine if any two of them add up to the third and return 'a', 'b', 'c' depending on which the sum is. If no two numbers add up to a third number, return an empty string. Assume that multiple solutions do not exist.
Example 1: whichTwo(5, 10, 5) = 'b'
Example 2: whichTwo(2, 0, 3) = ''
Given an Integer, return 'even' if the Integer is even, or 'odd' if the Integer is odd. Remember to use the Math.mod function.
Example 1: evenOrOdd(15) = 'odd'
Example 2: evenOrOdd(-64) = 'even'
A student passes a course if any two of the following three conditions are true: they have passed the exam, they have passed assignments, and they have passed the course project.
Implement the function isPassed that takes in three parameters passedExam, passedAssignments, and passedProject, and returns true of at least two of the passed variables are true.
Example 1: isPassed(true, false, true) = true. Student did not pass assignments, but passes overall because they passed the exam and the project.
Example 2: isPassed(false, false, true) = false. Student only passed the project, and therefore does not pass overall.
Given an integer, return true if the integer ends with 0, otherwise return false.
Example 1: isEndWithZero(12) == false
Example 2: isEndWithZero(1230) == true
Given a work, prepend it with the correct indefinite article ("a" or "an") followed by a space based on the following rule: words starting with a vowel (a, e, i, o, or u) are prepended with "an", while words starting with any other letter are prepended with "a".
Example 1: aOrAn('apple') = 'an apple'
Example 2: aOrAn('banana') = 'a banana'
Given three Integers, return the largest.
Given Integers a, b, and c, return true if a and b add up to c.
Example 1: sumEquals(5, 5, 10) = true
Example 2: sumEquals(2, 8, 9) = false
Given three Integers a, b, and c, return true if they are in ascending order. For our purposes, two equal numbers will be considered to be in an ascending order.
Example 1: ascendingOrder(10, 10, 15) = true
Example 2: ascendingOrder(15, 14, 13) = false
Given a person's age, return true if the person is a teenager (age 13 - 19).
Example 1: isTeenager(5) = false
Example 2: isTeenager(15) = true
Implement a function diff that calculates the absolute difference between two integers.
Example 1: diff(5, 2) = 3
Example 2: diff(2, 5) = 3