Advertisement
mess0011

u3_5

Oct 16th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.88 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ue5
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Console.WriteLine("calculate the average heart rate:");
  14.  
  15.             int[] list = new int[5];
  16.  
  17.             for (int i = 0; i < 5; i++)
  18.             {
  19.                 Console.WriteLine("Pls import your nr {0}", i + 1);
  20.                 list[i] = Convert.ToInt32(Console.ReadLine());
  21.             }
  22.             int frequency_sum = list[0] + list[1] + list[2] + list[3] + list[4];
  23.             Console.WriteLine("Total sum of the frequncies is {0}", frequency_sum);
  24.            
  25.             int heart_rate = frequency_sum / 5;
  26.             Console.WriteLine("the average beat of the heart is {0}", heart_rate);
  27.             Console.ReadLine();
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement