Uservorstellung: starscream89



  • Guten Tag zusammen

    Ich bin starscream89, komme aus der Schweiz und bin zurzeit in der schulischen Ausbildung zum Kaufmann. Für mein Wahlpflichtfach Wirtschaftsinformatik muss ich eine Aufnahmearbeit schreiben und ich habe vordergründig mal das Thema "C++" im Sinn. Geplant ist eine theoretisch/praktische Arbeit, irgend ein eher einfacheres Programm, welches aber trotzdem brauchbar sein soll.

    Zu mir gesagt, ich bin ein totaler Anfänger und werde je nach dem sehr grundlegende Fragen stellen. Ich freue mich auf lange Nächte am PC und ein Haufen ungelöster Probleme...

    Freundlicher Gruss

    starscream89



  • Well then... welcome 😃

    Ich studier' Wirtschaftsinformatik @ UZH 🤡



  • Willkommen!

    ... in der schulischen Ausbildung zum Kaufmann

    Vielleicht kannst Du aus diesem Kredit-Programm noch etwas Schickes machen:

    #include <iostream>
    #include <iomanip>
    using namespace std;
    
    void wait() 
    {
     std::cin.clear();
     std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
     std::cin.get();
    }
    
    int main()
    {
      int     jahre, monate;
      double  zinssatz, zins, tilgung, kapital, monatsrate, 
              zinssumme=0, tilgungsumme=0;
    
      cout << "Kapital:    "   ; cin >> kapital;
      cout << "Zinssatz:   "   ; cin >> zinssatz;
      cout << "Jahre:      "   ; cin >> jahre;
      cout << "Monatsrate: "   ; cin >> monatsrate;
      cout << endl;
    
      monate = 12 * jahre;
    
      cout << setw(10) << " "       << setw(18) << "Zins" 
           << setw(16) << "Tilgung" << setw(16) << "Kapital" << endl << endl;  
    
      for(int i=1; i<=monate; ++i)
      {
        zins       = kapital * zinssatz/1200.0; // monatlicher Zins
        tilgung    = monatsrate - zins;
        kapital    = kapital - tilgung;
    
        cout.setf(ios::fixed,ios::floatfield); // Formatierung
        if((zins >= 0) && ((kapital + monatsrate) > 0) )
        {
            cout << setw( 4) << i <<". Monat: "
                 << setw(15) << setprecision(2) << zins    << ' ';
    
          if(kapital >=0)
          {
            cout << setw(15) << setprecision(2) << tilgung 
                 << setw(16) << setprecision(2) << kapital << endl;
            tilgungsumme += tilgung;
            zinssumme    += zins;
          }
          else
          {
            tilgung +=kapital;
            kapital  = 0; 
            cout << setw(15) << setprecision(2) << tilgung 
                 << setw(16) << setprecision(2) << kapital << endl;
            tilgungsumme += tilgung;
            zinssumme    += zins;
          }
        }
      }
      cout << setw(12) << endl << "Summe:"
           << setw(16) << setprecision(2) << zinssumme    << ' '
           << setw(15) << setprecision(2) << tilgungsumme << endl; 
      wait(); 
    }
    

    Als Online-Kurs empfehle ich für C++ folgende Links:
    http://www.cpp-tutor.de/cpp/index.html
    http://tutorial.schornboeck.net/inhalt.htm
    http://de.geocities.com/throni3/
    http://www.fh-augsburg.de/informatik/vorlesungen/c_cplus/tutorial/henkel/ (alter Stil, aber didaktisch hervorragend)


Anmelden zum Antworten