When your code won't compile, start by looking at the error message.
Pasting the legible part code into an online C++ compiler and trying to compile it, gives the first errors as:
main.cpp:56:9: error: no match for ‘operator<<’ (operand types are ‘std::istream’ {aka ‘std::basic_istream’} and ‘int’)
56 | cin<<pgibg;
| ~~~^~~~~~~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
And there is a lot of information there:
main.cpp:56:9:
That's the file name, and the line and column numbers where the error was detected.
So go there: most editors support CTRL + G to go directly to a line number.
It's this one:
cin<<pgibg;
error: no match for ‘operator<<’ (operand types are ‘std::istream’ {aka ‘std::basic_istream’} and ‘int’)
That's a description of what it found.
It's not that helpful in this case, ut it tells you something: there is no "operator<<" defined for an input stream and an integer.
56 | cin<<pgibg;
| ~~~^~~~~~~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
The rest just show you the line and points out the parts it didn't understand.
Now look at that line with a couple of lines for context:
cout<<"PhilHealth Monthly Contribution: "<<((rate*day)+(ot*otrate)*.035);
cin>>phil;
cout<<"\nPAGIBIG Monthly Contribution: "<<((rate*day)+(ot*otrate)*.02);
cin<<pgibg;
Hmm ... shouldn't
cin
be directed
into a variable, rather than a variable directed into
cin
?
Turn the less thans into greater thans, and the error should go away.
cin >> pgibg;
Recompile, then repeat that process of examination and cogitation for each error message, and you'll soon fix them all!