You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
417 lines
10 KiB
417 lines
10 KiB
#include<stdio.h>
|
|
#include<string.h>
|
|
#include<math.h>
|
|
#include<stdlib.h>
|
|
#include"funktion.h"
|
|
|
|
float getValue(char c) {
|
|
float value;
|
|
printf("%c eingeben: ",c);
|
|
scanf("%f", &value);
|
|
return value;
|
|
}
|
|
double marktanteil(double gesamtumsatz,double unternehmensumsatz) {
|
|
return unternehmensumsatz / gesamtumsatz * 100.0;
|
|
}
|
|
|
|
double angebotserfolg(double angeboteneMenge,double verkaufteMenge) {
|
|
return verkaufteMenge / angeboteneMenge * 100.0;
|
|
}
|
|
|
|
double Anlagenabnutzungsgrad(double anfangsbuchwert,double restbuchwert) {
|
|
return (anfangsbuchwert-restbuchwert) / anfangsbuchwert * 100.0;
|
|
}
|
|
|
|
double Anlagenintensitaet(double gesamtkapital, double anlagevermoegen) {
|
|
double anlagenintensitaets = anlagevermoegen / gesamtkapital * 100.0;
|
|
return anlagevermoegen / gesamtkapital * 100.0;
|
|
}
|
|
|
|
double Anlagenproduktivitaet(double anlagevermoegen, double umsatz) {
|
|
double anlagenproduktivitaet = umsatz / anlagevermoegen;
|
|
return umsatz / anlagevermoegen;
|
|
}
|
|
|
|
double Arbeitsproduktivitaet(double arbeitszeit, double produktivitaet){
|
|
double ergebnis = arbeitszeit * produktivitaet;
|
|
return arbeitszeit * produktivitaet;
|
|
}
|
|
|
|
double Kalkulatorische_Zinsen(double kapital, double zinssatz, double zeitraum){
|
|
double ergebnis = kapital * zinssatz * zeitraum / 100;
|
|
return kapital * zinssatz * zeitraum / 100;
|
|
}
|
|
|
|
double Kritische_Menge(double fixkosten, double variablenkosten,double verkaufspreis){
|
|
float ergebnis;
|
|
ergebnis = fixkosten / (verkaufspreis - variablenkosten);
|
|
return fixkosten / (verkaufspreis - variablenkosten);
|
|
}
|
|
|
|
double Effektivverzinsung(double normalzinssatz,double zahlungsintervall){
|
|
float ergebnis;
|
|
ergebnis = pow(1 + normalzinssatz / zahlungsintervall, zahlungsintervall) - 1;
|
|
return ergebnis;
|
|
}
|
|
|
|
double Cashflow_zu_Gesamtkapital(double netto_kassenfluss, double gesamtkapital){
|
|
float ergebnis;
|
|
ergebnis = netto_kassenfluss / gesamtkapital;
|
|
return ergebnis;
|
|
}
|
|
|
|
double Dynamische_Amortisationszeit(double investition, double jaehrlicher_Cashflow){
|
|
float ergebnis;
|
|
ergebnis = investition / jaehrlicher_Cashflow;
|
|
return ergebnis;
|
|
}
|
|
|
|
double Finanzierungsregeln(double durchschnittliche_verzinsung_vermoegenswerte,double durchschnittliche_kosten_kapitalbeschaffung) {
|
|
double regel = durchschnittliche_verzinsung_vermoegenswerte / durchschnittliche_kosten_kapitalbeschaffung;
|
|
return regel;
|
|
}
|
|
|
|
double eigenkapital_Rentabilitaeten(double umsatz,double eigenkapital) {
|
|
double result = umsatz / eigenkapital;
|
|
return result;
|
|
}
|
|
|
|
double gesamtkapital_Rentabilitaeten(double umsatz,double gesamtkapital) {
|
|
double gresult = umsatz / gesamtkapital;
|
|
return gresult;
|
|
}
|
|
|
|
double Zeitlohn(double lohnsatz,double arbeitszeit) {
|
|
double zeitlohn = lohnsatz * arbeitszeit;
|
|
return zeitlohn;
|
|
}
|
|
|
|
double Akkortrichtsatz(double stueckkosten,double akkordzuschlag) {
|
|
double akkordrichtsatz = stueckkosten * (1 + akkordzuschlag);
|
|
return akkordrichtsatz;
|
|
}
|
|
|
|
double Stueckzeitakkort(double stueckkosten,double akkordzuschlag,double arbeitszeit,double menge) {
|
|
double stueckzeitakkord = stueckkosten * (1 + akkordzuschlag) * arbeitszeit * menge;
|
|
printf("%f",stueckzeitakkord);
|
|
return stueckzeitakkord;
|
|
}
|
|
|
|
double erloesfunktion(double p,double q){
|
|
double erloesfunktionn = p * q;
|
|
return p*q;
|
|
}
|
|
|
|
double grenzGewinn(double p,double q,double tc){
|
|
float grenzgewinnn = (p*q) - tc;
|
|
return (p*q) - tc;
|
|
}
|
|
|
|
double GewinnMaximum(double p,double q,double tc,double tr){
|
|
float erloesfunktion = p * q;
|
|
float gewinnmaximumm = erloesfunktion - tc - tr;
|
|
return gewinnmaximumm;
|
|
}
|
|
|
|
double trapezFlaeche(double a, double b, double h) {
|
|
printf("Flaeche vom Trapez beträgt: %f\n",(a + b) * h / 2);
|
|
double result=(a + b) * h / 2;
|
|
return result;
|
|
}
|
|
|
|
float Vshift(float x1, float s1) {
|
|
float result = x1 + s1;
|
|
return result;
|
|
}
|
|
double Vlength(float x1, float x2, float x3) {
|
|
double X1, X2, X3, E;
|
|
double result;
|
|
X1 = x1 * x1;
|
|
X2 = x2 * x2;
|
|
X3 = x3 * x3;
|
|
E = X1 + X2 + X3;
|
|
result = sqrt(E);
|
|
return result;
|
|
}
|
|
float Vadd(float x1, float z1) {
|
|
double result = x1 + z1;
|
|
return result;
|
|
}
|
|
float Vaddx2(float x2, float z2){
|
|
double result = x2 + z2;
|
|
return result;
|
|
}
|
|
float Vaddx3(float x3, float z3){
|
|
double result = x3 + z3;
|
|
return result;
|
|
}
|
|
float Vsubstract(float x1, float z1) {
|
|
double result = x1 - z1;
|
|
return result;
|
|
}
|
|
float Vsubstract2(float x2, float z2) {
|
|
double result = x2 - z2;
|
|
return result;
|
|
}
|
|
float Vsubstract3(float x3, float z3) {
|
|
double result = x3 - z3;
|
|
return result;
|
|
}
|
|
float Vmultiplier(float x1,float m) {
|
|
double result = x1 * m;
|
|
return result;
|
|
}
|
|
float Vmultiplier2(float x2,float m) {
|
|
double result = x2 * m;
|
|
return result;
|
|
}
|
|
float Vmultiplier3(float x3,float m) {
|
|
double result = x3 * m;
|
|
return result;
|
|
}
|
|
double Vparallel(double x1, double x2, double x3, double z1, double z2, double z3) {
|
|
double i, j, k;
|
|
double X1, X2, X3;
|
|
double result;
|
|
if (x1 > z1) {
|
|
X1 = x1 / z1;
|
|
i = X1 * 100;
|
|
} else {
|
|
X1 = z1 / x1;
|
|
i = X1 * 100;
|
|
}
|
|
if (x2 > z2) {
|
|
X2 = x2 / z2;
|
|
j = X2 * 100;
|
|
} else {
|
|
X2 = z2 / x2;
|
|
j = X2 * 100;
|
|
}
|
|
if (x3 > z3) {
|
|
X3 = x3 / z3;
|
|
k = X3 * 100;
|
|
} else {
|
|
X3 = z3 / x3;
|
|
k = X3 * 100;
|
|
}
|
|
if (i == j && j == k) {
|
|
result = 0;
|
|
} else {
|
|
result = 1;
|
|
}
|
|
return result;
|
|
}
|
|
float Vmiddle(float x1, float z1) {
|
|
double result = x1 + z1;
|
|
result = result * 0.5;
|
|
return result;
|
|
}
|
|
float Vmiddle2(float x2,float z2) {
|
|
double result = x2 + z2;
|
|
result = result * 0.5;
|
|
return result;
|
|
}
|
|
float Vmiddle3(float x3, float z3) {
|
|
double result = x3 + z3;
|
|
result = result * 0.5;
|
|
return result;
|
|
}
|
|
float Vskalort(float x1, float x2, float x3, float z1, float z2, float z3) {
|
|
float E;
|
|
double result;
|
|
E = x1 * z1 + x2 * z2 + x3 * z3;
|
|
if (E == 0) {
|
|
result = 1;
|
|
} else {
|
|
result = 0;
|
|
}
|
|
return result;
|
|
}
|
|
double Vangle(float x1, float x2, float x3, float z1, float z2, float z3) {
|
|
double i = x1 * z1 + x2 * z2 + x3 * z3;
|
|
double p = sqrt(x1 * x1 + x2 * x2 + x3 * x3);
|
|
double q = sqrt(z1 * z1 + z2 * z2 + z3 * z3);
|
|
double s = i / (p * q);
|
|
double result = acos(s) * 180 / M_PI;
|
|
return 11;
|
|
}
|
|
float vPunkt(float x1, float x2, float x3, float z1, float z2, float z3, float p1, float p2, float p3) {
|
|
double result;
|
|
float e1 = (p1 - x1) / z1;
|
|
float e2 = (p2 - x2) / z2;
|
|
float e3 = (p3 - x3) / z3;
|
|
|
|
if (e1 == e2 && e2 == e3) {
|
|
result = 1;
|
|
} else {
|
|
result = 0;
|
|
}
|
|
return result;
|
|
}
|
|
double probability_from_tree(double successful_outcomes, double total_outcomes, double branches) {
|
|
double result;
|
|
result = successful_outcomes / (total_outcomes * branches);
|
|
return result;
|
|
}
|
|
int binomial_coefficient(int n, int k) {
|
|
|
|
int result = 1;
|
|
if (k > n - k) {
|
|
k = n - k;
|
|
}
|
|
for (int i = 0; i < k; ++i) {
|
|
result = result * (n - i) / (i + 1);
|
|
}
|
|
return result;
|
|
}
|
|
int ByOne(int n) {
|
|
int orig, count = 0;
|
|
orig = n;
|
|
while (n > 0) {
|
|
n = n >> 1 << 1;
|
|
if (orig - n == 1)
|
|
count++;
|
|
orig = n >> 1;
|
|
n = orig;
|
|
}
|
|
return count;
|
|
}
|
|
int dezimal_to_bin(int dezimal) {
|
|
if (dezimal == 0) {
|
|
return 0;
|
|
} else {
|
|
return (dezimal % 2 + 10 * dezimal_to_bin(dezimal / 2));
|
|
}
|
|
}
|
|
int dezimal_binar_linksverschiebung(int dezimal) {
|
|
dezimal = dezimal * 2;
|
|
if (dezimal == 0) {
|
|
return 0;
|
|
} else {
|
|
return (dezimal % 2 + 10 * dezimal_to_bin(dezimal / 2));
|
|
}
|
|
}
|
|
int dezimal_binar_rechtsverschiebung(int dezimal) {
|
|
dezimal = dezimal / 2;
|
|
if (dezimal == 0) {
|
|
return 0;
|
|
}
|
|
else {
|
|
return (dezimal % 2 + 10 * dezimal_to_bin(dezimal / 2));
|
|
}
|
|
}
|
|
int boolesche_und(int eingabe1, int eingabe2) {
|
|
return (eingabe1 && eingabe2);
|
|
}
|
|
int boolesche_oder(int eingabe1, int eingabe2) {
|
|
return(eingabe1 || eingabe2);
|
|
}
|
|
int boolesche_nicht(int eingabe1) {
|
|
return !eingabe1;
|
|
}
|
|
double prozentwert(double ein, double prozent) {
|
|
return (ein / 100) * prozent;
|
|
}
|
|
double prozentsatz(double ein, double prozent) {
|
|
return (prozent / ein);
|
|
}
|
|
double grundwert(double ein, double prozent) {
|
|
return (ein / prozent) * 100;
|
|
}
|
|
double kreisFlaeche(double r) {
|
|
return M_PI * pow(r, 2);
|
|
}
|
|
double kreisUmfang(double r) {
|
|
return 2 * M_PI * r;
|
|
}
|
|
double dreieckFlaeche(double a, double b, double c) {
|
|
double s = (a + b + c) / 2;
|
|
return sqrt(s * (s - a) * (s - b) * (s - c));
|
|
}
|
|
double dreieckUmfangn(double a, double b, double c) {
|
|
return a + b + c;
|
|
}
|
|
double viereckFlaeche(double a, double b) {
|
|
return a * b;
|
|
}
|
|
double viereckUmfang(double a, double b){
|
|
return (2 * a) + (2 * b);
|
|
}
|
|
double trapezUmfang(double a, double b, double h) {
|
|
return (2 * h) + a + b;
|
|
}
|
|
double multiplikation_2Zahlen(double Zahl1,double Zahl2)
|
|
{
|
|
return Zahl1*Zahl2;
|
|
}
|
|
double multiplikation_3Zahlen(double Zahl1,double Zahl2,double Zahl3)
|
|
{
|
|
return Zahl1*Zahl2*Zahl3;
|
|
}
|
|
double normaleDivision(double dZahl1, double dZahl2)
|
|
{
|
|
if(dZahl2==0)
|
|
{
|
|
return 0;
|
|
}
|
|
return dZahl1/dZahl2;
|
|
}
|
|
double Division_drei_Zahlen(double dZahl1, double dZahl2,double dZahl3)
|
|
{
|
|
if (dZahl2== 0||dZahl3==0)
|
|
{
|
|
return 0;
|
|
}
|
|
return dZahl1/dZahl2/dZahl3;
|
|
}
|
|
double substraction_2Zahlen(double sZahl1,double sZahl2)
|
|
{
|
|
return sZahl1-sZahl2;
|
|
}
|
|
double substraction_3Zahlen(double sZahl1,double sZahl2,double sZahl3)
|
|
{
|
|
return sZahl1-sZahl2-sZahl3;
|
|
}
|
|
double velocity(double v0, double a, double t)
|
|
{
|
|
return v0 + a * t;
|
|
}
|
|
double position(double x0, double v0, double a, double t)
|
|
{
|
|
return x0 + v0 * t + 0.5 * a * t * t;
|
|
}
|
|
double force(double m, double a)
|
|
{
|
|
return m * a;
|
|
}
|
|
double work(double a, double d,double m)
|
|
{
|
|
return (m * a) * d;
|
|
}
|
|
double power(double a, double m, double d, double t)
|
|
{
|
|
return ((m * a) * d) / t;
|
|
}
|
|
double SchwereDruck(double pfi,double g, double h)
|
|
{
|
|
return pfi * g * h;
|
|
}
|
|
double Dichte_der_Fluessigkeit(double ps,double g,double h)
|
|
{
|
|
return ps / (g * h);
|
|
}
|
|
double Eintauchtiefe(double ps, double pfi, double g)
|
|
{
|
|
return ps/(pfi*g);
|
|
}
|
|
double Ortsfaktor(double ps,double pfi,double h)
|
|
{
|
|
return ps / (pfi * h);
|
|
}
|
|
double Druck(double F, double A)
|
|
{
|
|
double p;
|
|
p = F / A;
|
|
printf("Druck (p) = %.2lf\n", p);
|
|
return p;
|
|
}
|