Comparing Times
Mus be hand written into python IDE and written in 3.5 and saved as [login to view URL] file
Write a function called time_compare that will have 4 parameters. These four integers represent 2 times, that is hour and minute of the first time, then the hour and minute of the second time. It returns an integer, which will be 0, 1 or 2. 0 means the two times were the same. 1 means that the first time came before the second one. 2 means the first time came after the second one.
Example calls:
compare(1,2,3,4) would return 1 because 1:02 comes before 3:04.
compare (12, 19, 12, 1) would return 2 because 12:19 comes after 12:01.
compare (3, 4, 3, 4) would return 0 because they are the same time.
Each function that returns a value uses ONE return statement at the bottom of the function definition. Use a variable to hold the return value until execution is done in the function, then return that variable.
The compare function does NOT do any input from the keyboard or output to the screen. Its interaction with the rest of the program is through its parameters and its return value.
compare the two hours first. If they are different, you have your answer without having to look at the minutes at all.
You do NOT want to write a main function for this program. Instead, open your file in your IDE. in the shell, type in a call to the function, like "time_compare(12,15,15,3)". This means you want to compare times 12:15 and 15:03. The result should be a 1.
Develop 4 test cases for this program. Example: "first time comes after second time, hour1 after hour2", 13, 20, 8, 15 (as inputs), expected return value is 2. List them in the program file as comments at the bottom of the file
Small project looking to spend around $10
Hello
I am an experienced developer and would be able to help you in the development of this program I have attached a bid being my time and cost if you are interested or need more information please get in touch