0

I literally copied thus code which perfectly worked. Why the he'll I get so many errors. Could so.eone tell me please?

https://code.sololearn.com/c5n75D2BIdb8/?ref=app

22nd Aug 2018, 9:28 PM
Hls
Hls - avatar
8 Respostas
+ 1
ohh, now I see. such a fool! thanks a lot KrOW,
22nd Aug 2018, 10:19 PM
Hls
Hls - avatar
0
Simple... Follow error console log, and you will see where (and probably what) are your problems
22nd Aug 2018, 10:00 PM
KrOW
KrOW - avatar
0
well thanks, but I'm a total begins and I don't get to understand what the error means. if you'd please tell me
22nd Aug 2018, 10:14 PM
Hls
Hls - avatar
0
beginner
22nd Aug 2018, 10:14 PM
Hls
Hls - avatar
0
You have yet corrected the first (missing semicolon). The other problem is at libe 48 and precisely that you dont call printInfo method correclty. Try with: p.printInfo() ;
22nd Aug 2018, 10:17 PM
KrOW
KrOW - avatar
0
👍👍👍
22nd Aug 2018, 10:19 PM
KrOW
KrOW - avatar
0
#include <iostream> using namespace std; class Id{ public : Id(double i) :id(i) {} void printId(){ cout<<"your Id is: "<<id<<endl; } private: double id; }; class Money{ public : Money(int m) :money(m) {} void printMoney(){ cout<<"Your cash is: "<<money<<endl; } private : int money; }; class Person{ public : Person (string n, Id ii, Money mm) :name(n), identification(ii), cash(mm) {} void printInfo(){ cout<<name<<endl; identification.printId(); cash.printMoney(); } private : string name; Id identification ; Money cash; }; int main(){ Money cash(12000); Id identification(49588892); Person p("johnny",identification ,cash); p.printInfo(); }
22nd Aug 2018, 10:19 PM
Steppenwolf
Steppenwolf - avatar
0
thanksman
22nd Aug 2018, 11:17 PM
Hls
Hls - avatar