Lab Nov 24

  1. Write a function game that randomly generate 10 integers between -5 and 5. The function counts the number of positives, negatives and zeros, and returns the average of three counters. Write main to test your function.

  2. Write a function avePos that has one parameter - the number of input integers. The function inputs integers, and finds and RETURNs the average of the POSITIVE inputs. If there are no positive inputs, the function returns -1. USE LOOP FOR in this function.

    Write a function countEvenNeg that has NO parameters. The function inputs the series of NON ZERO integers. The first zero terminates the input. The function finds and RETURNs the number of EVEN NEGATIVE inputs. If there are no such inputs, the function returns 0. In this function you can only use LOOP WHILE.

    Write a function menu that has one parameter - choice. The function performs the following: if the choice is EVEN, user is asked to enter the number of inputs and the function avePos is called. MAKE SURE: your program outputs the appopriate message if there are no positive inputs. If the choice is ODD, function countEevenNeg is called. MAKE SURE: your program outputs the appopriate message if there are no even negative inputs.

    Write main function that reads one integer - user's choice and call function menu.

  3. Write the following functions:

  4. In this program you need to implement the simplified version of the new score system in the Figure Skating competition. Description of the simplified version: There are 12 judges that are present. First step: all 12 judges submit their scores. Second step: the highest and lowest score are thrown out from the 12 submitted grades. Third step: the remaining 10 scores are averaged. Write a program that reads 12 scores submitted by 12 judges for the specific event and calculates the final score according to the rules written above. Each input score is an integer number between 0 and 100. You can assume that the input is valid. You can write everything in main.