I'm a student and just started learning C++ last week so this question is probably very low level but I can't figure it out.
I've searched around a bit but can't find any results, or maybe I'm looking for the wrong thing.
There are two cin parts. One taking in an int outside the loop, the other taking in a string inside the loop.
I'm getting a compile error saying ""Error no operator matches these commands" even though I just used them 5 lines ago.
Help?
#include <fstream>
#include <iostream>
using namespace std;
int main()
{
// variable declaration
const double payIncrease = 7.6;
string employeeName;
double initialSalary;
double backPay;
double employeeAnnualSalary;
double employeeMonthlySalary;
int numEmployees;
// streams of information
ofstream outStream;
outStream.open("employeeRecords.txt");
// console io's
cout<<"Enter how many employees you have:";
cin>>numEmployees;
for(int i = 0; i <numEmployees;i++)
{
cout<<"What is Employee number: "<<i<<"'s name:";
cin>>employeeName;
cout<<"How much does that employee earn now: ";
cin>>initialSalary;
}
outStream <<"annual salary was: " << numEmployees;
outStream.close();
return 0;
}