i have following code, i am starting a college project and need help
#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
class ba146{
private:
int capacity;
int totalSeatWindow;
int totalSeatAisle;
int totalSeatMiddle;
public:
string timeOfArrival;
string timeOfDeparture;
string departureCity;
string arrivalCity;
string flight;
string seatType;
int occupiedSeatWindow ;
int occupiedSeatAisle;
int occupiedSeatMiddle;
ba146(){ //Constructor
capacity=120;
totalSeatWindow=40;
totalSeatAisle=40;
totalSeatMiddle=40;
occupiedSeatWindow=0;
occupiedSeatAisle=0;
occupiedSeatMiddle=0;
};
int freeSeat(){
return capacity-(occupiedSeatWindow+occupiedSeatAisle+occupiedSeatMiddle);
}
};
int main(int argc, char* argv[])
{
printf("Hello World!\n");
ba146 fly;
fly.timeOfArrival="Dublin\n";
cout<<fly.timeOfArrival;
cout<<fly.freeSeat;
return 0;
}
but it gives me a warning , and doesnt print out the 120 like i thought it should.