Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- class koers {
- public:
- koers();
- void berekenkoers(int dag, int aandeel);
- void maxbedrag();
- void leesbestand();
- void matrix();
- ifstream invoer;
- string invoernaam;
- int n, doeldag; //int voor n en Tw
- float bnul; //float voor B0
- int aandelen;
- float koersmatrix[100][100]; //matrix voor koersen van de dagen [dag][koers[
- float rente[100]; //array voor het opslaan van de rentes [dag]
- }; //class koers
- koers::koers(){
- invoernaam = "";
- }//koers::koers
- void koers::berekenkoers(int dag, int aandeel){
- }//void berekenkoers
- void koers::maxbedrag(){
- }//void maxbedrag
- void koers::matrix(){
- for(int i = 0;i< (doeldag + 1); i++){
- for(int j=0;j<n;j++){
- cout << koersmatrix[i][j] << " ";
- }
- cout << endl;
- }
- for(int i = 0;i< (doeldag); i++){
- cout << rente[i] << endl;
- }
- }
- void koers::leesbestand(){
- cout << "Welk bestand wil je openen?" << endl;
- cin >> invoernaam;
- invoer.open(invoernaam.c_str(), ios::in);
- if( !invoer ){
- cout << "Bestand bestaat niet";
- return;
- }//if
- invoer >> doeldag;
- invoer >> n;
- invoer >> bnul;
- for(int i = 0; i < (doeldag + 1); i++){
- for(int j = 0; j < n; j++){
- invoer >> koersmatrix[i][j];
- }
- }
- for(int i = 0; i < (doeldag ); i++){
- invoer >> rente[i];
- }//for
- }//void leesbestand
- int main (){
- koers start;
- start.leesbestand();
- cout << start.n << " " << start.doeldag << " " << start.bnul << endl;
- start.matrix();
- }//main
Advertisement
Add Comment
Please, Sign In to add comment