diff --git a/src/c/funktionen.c b/src/c/funktionen.c index 1b33bb3..8a5efbe 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -327,4 +327,8 @@ float average(float x, float y) { // Function to calculate the remainder of division between two numbers float remainderValue(float x, float y) { return fmod(x, y); +} + +float f(float m) { + return m * 9.81; } \ No newline at end of file diff --git a/src/c/funktionen.h b/src/c/funktionen.h index 5958b04..7cdc807 100644 --- a/src/c/funktionen.h +++ b/src/c/funktionen.h @@ -151,4 +151,7 @@ float average(float x, float y); // Function to calculate the remainder of division between two numbers float remainderValue(float x, float y); +float f(float m); +// berechnet die Gewichtkraft + #endif \ No newline at end of file diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index 6f2966b..4094322 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -424,4 +424,18 @@ void test_tangentDegrees(void) { // Add more test cases for different inputs and expected outputs } +void test_weight_at_mass100(void) +{ + /* arrange */ + float actual; + float expected = 981; + + /* act */; + float m = 100; + actual = f(m); + + /* assert */ + TEST_ASSERT_EQUAL_FLOAT(expected, actual); +} + #endif \ No newline at end of file