Question: Write a program using processing that includes the following three functions and their tests. o Function 1, tickets: You are planning a trip to the
Write a program using processing that includes the following three functions and their tests. o Function 1, tickets: You are planning a trip to the Winter Olympics, and you have asked a bunch of your friends to join you. Each of your friends who comes to the Olympics brings one friend with them. Write a function called tickets that accepts the number of your friends who are joining you at the Olympics, and returns the total number of tickets you should buy to the Olympics. Your function should guard against an illegal input such a negative number of friends. In this case, the function prints an error message and returns -1 to indicate the error. Test Function 1, tickets: Write a function to test your tickets function. Include all the appropriate test cases for different types of output. You will lose points for missing important test cases. Your test function should give each test a name, e.g. Test 1, Test 2, etc. The test function should print the name of the test and whether the test succeeded or failed. Use java to write the input code not C++
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
