class AirlineTicket
class AirlineTicket
{
public:
AirlineTicket();
~AirlineTicket();
int calculatePriceInDollars();
string getPassengerName();
void setPassengerName(string inName);
int getNumberOfMiles();
void setNumberOfMiles(int inMiles);
bool getHasEliteSuperRewardsStatus();
void setHasEliteSuperRewardsStatus(bool inStatus);
private:
string mPassengerName;
int mNumberOfMiles;
bool fHasEliteSuperRewardsStatus;
};
Sunday, October 19, 2008
Questions about this code snippet
Well, I have been learning my c++ from a book. I'm quite confused with some parts of code, so a bit of help would be appreciated. Here's the code:
Wednesday, August 27, 2008
Structures
Just messing around with structures, got this example from a book.
#include "stdafx.h"
#include
using namespace std;
int main()
{
//creating the structure
typedef struct {
char firstInitial;
char middleInitial;
char lastInitial;
int employeeNumber;
int salary;
} EmployeeT;
//Creating and Populating an Employee
//Employee Declaration
EmployeeT anEmployee;
//Building and Defining the Employee
anEmployee.firstInitial = 'M';
anEmployee.middleInitial = 'R';
anEmployee.lastInitial = 'G';
anEmployee.employeeNumber = 42;
anEmployee.salary = 317000;
//Output the values of an employee, in other words, assigns the values
//Prints the values to the screen
cout << "Employee: " <<>
Structures
Just messing around with structures, got this example from a book.
#include "stdafx.h"
#include
using namespace std;
int main()
{
//creating the structure
typedef struct {
char firstInitial;
char middleInitial;
char lastInitial;
int employeeNumber;
int salary;
} EmployeeT;
//Creating and Populating an Employee
//Employee Declaration
EmployeeT anEmployee;
//Building and Defining the Employee
anEmployee.firstInitial = 'M';
anEmployee.middleInitial = 'R';
anEmployee.lastInitial = 'G';
anEmployee.employeeNumber = 42;
anEmployee.salary = 317000;
//Output the values of an employee, in other words, assigns the values
//Prints the values to the screen
cout << "Employee: " << anEmployee.firstInitial <<
anEmployee.middleInitial <<
anEmployee.lastInitial << endl;
cout << "Number: " << anEmployee.employeeNumber << endl;
cout << "Salary: $" << anEmployee.salary << endl;
return 0;
}
First Post
Well, the first post isn't going to be an amazing program. It's just the simple "Hello World" c++ program. After I'm done with c++ I'll be going to ASM, Then C#, Then Visual Basic.
______________________________________________________________________
// Hello World Complete.cpp : Defines the entry point for the console application.
// My First c++ Program
#include "stdafx.h"
#include
using namespace std;
int main( )
{
cout <<"Hello World!\n";
return 0;
}
______________________________________________________________________
______________________________________________________________________
// Hello World Complete.cpp : Defines the entry point for the console application.
// My First c++ Program
#include "stdafx.h"
#include
using namespace std;
int main( )
{
cout <<"Hello World!\n";
return 0;
}
______________________________________________________________________
Subscribe to:
Posts (Atom)