/* [wxMaxima batch file version 1] [ DO NOT EDIT BY HAND! ]*/

/* [wxMaxima: title   start ]
Gewinnverteilung
   [wxMaxima: title   end   ] */

/* [wxMaxima: section start ]
Problembeschreibung
   [wxMaxima: section end   ] */

/* [wxMaxima: comment start ]
******************************************
Dokumentnummer: D1174
Quelle: Johann Weilharter,
             Wirtschaftsrechnen
******************************************

Gegeben sind der Gewinn und die Einlagen von n Gesellschaftern.
Der Gewinn ist im Verhältnis der Einlagen zu verteilen.

Wir erstellen ein Maxima-Programm für diesen Zweck.
   [wxMaxima: comment end   ] */

/* [wxMaxima: section start ]
Problemlösung
   [wxMaxima: section end   ] */

/* [wxMaxima: comment start ]
EINGABE
   [wxMaxima: comment end   ] */

/* [wxMaxima: input   start ] */
Gewinn:read("Gib den zu verteilenden Gewinn ein");
/* [wxMaxima: input   end   ] */

/* [wxMaxima: comment start ]
Der Verteilungsschlüssel könnte sich z.B, aus den Anteilen der
Gesellschafter ergeben
   [wxMaxima: comment end   ] */

/* [wxMaxima: input   start ] */
Verteiler:read("Gib die Einlagen der Gesellschafter als Liste ein in []");
/* [wxMaxima: input   end   ] */

/* [wxMaxima: comment start ]
VERARBEITUNG
   [wxMaxima: comment end   ] */

/* [wxMaxima: comment start ]
Wie viele Gesellschafter sind beteiligt?
   [wxMaxima: comment end   ] */

/* [wxMaxima: input   start ] */
n:length(Verteiler);
/* [wxMaxima: input   end   ] */

/* [wxMaxima: comment start ]
Wie hoch ist die Summe der Einlagen?
   [wxMaxima: comment end   ] */

/* [wxMaxima: input   start ] */
s:sum(Verteiler[i],i,1,n);
/* [wxMaxima: input   end   ] */

/* [wxMaxima: comment start ]
Welcher Anteil entfällt auf eine GE ? (Verteilungsschlüssel)
   [wxMaxima: comment end   ] */

/* [wxMaxima: input   start ] */
Anteil:Gewinn/s,numer;
/* [wxMaxima: input   end   ] */

/* [wxMaxima: input   start ] */
Teile:Verteiler*Anteil;
/* [wxMaxima: input   end   ] */

/* [wxMaxima: comment start ]
AUSGABE
   [wxMaxima: comment end   ] */

/* [wxMaxima: input   start ] */
for i:1 thru n do
     print(concat(i,".ter Gesellschafter bekommt ",
           ?truncate(Teile[i]*100+0.5)/100.0," GE"))$
/* [wxMaxima: input   end   ] */

/* [wxMaxima: section start ]
Wo wird das im Unterricht verwendet?
   [wxMaxima: section end   ] */

/* [wxMaxima: comment start ]
Rechnungswesen
Verteilungsrechnung
Fortlaufende Proportionen
   [wxMaxima: comment end   ] */

/* Maxima can't load/batch files which end with a comment! */
"Created with wxMaxima"$
