Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static int CalculateSumOfCubes()
- {
- Console.Write("Input Number of Inputs: ");
- int number_of_inputs = Convert.ToInt32(Console.ReadLine());
- int sum = 0;
- for (int i = 0; i < number_of_inputs; i++)
- {
- Console.Write("Input Number: ");
- int input = Convert.ToInt32(Console.ReadLine());
- sum += input * input * input;
- }
- return sum;
- }
- public static double CalculateAverage()
- {
- Console.Write("Input Number of Inputs: ");
- int number_of_inputs = Convert.ToInt32(Console.ReadLine());
- double average = 0;
- int sum = 0;
- for (int i = 0; i < number_of_inputs; i++)
- {
- Console.Write("Input Number: ");
- int input = Convert.ToInt32(Console.ReadLine());
- sum += input;
- }
- average = sum / number_of_inputs;
- return average;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement