Question: Part A: Some comparators We often need to determine quickly whether or not some values are the same, or are different, or are in sorted
Part A: Some comparators We often need to determine quickly whether or not some values are the same, or are different, or are in sorted order. For this first part of the assignment, you will write several functions to answer this when we have three values. Please note that none of these functions is permitted to print that is, the only effect had by the black box of the functions is to return the value of True or False 1. in order(a, b, c) will return True if a comes before bin numeric order, and b comes before c in numeric order, otherwise False is returned. For example: in order(4, 10, 12) would return True: in order (4, 12, 10) would return false : inorder(4, 4, 4) would return false 2. all equiv(a, b, c) will return True if a, b, and e are all the same integer value; otherwise Palse is returned. For example, all equiv(4, 10, 12) would return valse : all equiv(4, 12, 10) would return false; all_equiv(4, 4, 4) would return True 3. all other(a, b, c) will return True W . , and are different integer values, otherwise Yalse is returned. For example, all other(4, 10, 12) would return True: all other(4, 12, 10) would return True: all other (4, 4, 4) would return false. And please note that your function must work for integer values other than those given above as examples! For all functions you may assume that only integers (either integer literals or variables referring to a integer) will be given as arguments. Please write a main() function that will test your work. Some starter code for in order and main has been provided to you. You must change and add to all of this in order to complete the assignment In your solution you are not permitted to add any additional functions to the three required
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
