Upload files to "ex1A_mean_values"

This commit is contained in:
Jakob Schratter 2025-10-22 15:16:25 +02:00
commit 6be81d2d73
3 changed files with 88 additions and 0 deletions

23
ex1A_mean_values/means.h Normal file
View file

@ -0,0 +1,23 @@
#pragma once
#include <vector>
/**
This function calculates arithmetic mean, geometric mean and harmonic mean of three integers.
@param[in] a first integer
@param[in] b second integer
@param[in] c third integer
@param[out] am arithmetic mean
@param[out] gm geometric mean
@param[out] hm harmonic mean
*/
void calculate_means(int a, int b, int c, double &am, double &gm, double &hm);
/**
This function calculates arithmetic mean, geometric mean and harmonic mean of an integer vector.
@param[in] numbers vector containing integers
@param[out] am arithmetic mean
@param[out] gm geometric mean
@param[out] hm harmonic mean
*/
void calculate_means(std::vector<int> numbers, double &am, double &gm, double &hm);