In this program you will find the total number of eggs collected during Easter Egg Hunt Game, the average number of eggs per child and the number of children participated in the game.
Write a program that reads a sequence of positive integers, first zero or negative terminates the input. Each positive integer represents the number of eggs collected by one child. The program finds and prints the total number of eggs collected during Easter Egg Hunt Game, the average number of eggs per child and the number of children participated in the game.
Use look WHILE in this program
Example 1:
Input: 2 5 7 -9
Output: 3 children participated, total = 14, average = 4.666667
Example 2:
Input: -5
Output: NO children arrived to the game.
Some banks offer diferent interest rate based on certain rules. In this program you will follow the following rules:
USE LOOP FOR IN THIS PROGRAM
Example:
Input: 45890 6 2 6 1 2 4 10 1 2 5 6 4
Output:
month 1 balance 49102.300000
month 2 balance 49593.323000
month 3 balance 53064.855610
month 4 balance 53595.504166
month 5 balance 54131.459208
month 6 balance 54672.773800
month 7 balance 59046.595704
month 8 balance 59637.061661
month 9 balance 60233.432277
month 10 balance 65052.106860
month 11 balance 70256.275408
month 12 balance 70958.838163
Balance at the end of the First Year 70958.838163
Average Interest 0.037500