saving file using fstream - newbie help

N

newsleecher

hi, i need to use fstream to save the individual customer data into
an external txt file. Can anyone help.
Following is my code :

#include<iostream.h>
#include<stdio.h>
#include<conio.h>
#include<ctime>
#include<string.h>
#include<stdlib.h>

#define MAX 50
#define SIZE 25
#define SINGLEPRICE 12
#define DOUBLEPRICE 22
#define MINORDISCOUNT 4
#define MAJORDISCOUNT 2
#define CARDPRICE 75
#define MINORCARDDISCOUNT 15
#define MAJORCARDDISCOUNT 10
#define CORPORATECARD 400
#define BLOCKBOOKING 1800
#define GLOVESRENT 2
#define FINEAMOUNT 100


class CIndividual
{

char m_Name[MAX][SIZE];

protected:
int m_HeadCount;
char m_Session[MAX];
int m_Age[MAX];

public:
CIndividual();
~CIndividual(){};

void Set_IndividualData(char);
void Print_IndividualData(char);
};


class CTicket : public CIndividual
{
protected:
float m_GrossAmt;
float m_NetAmt;
float m_Discount;
struct tm *m_pDate;

public:
CTicket();
~CTicket(){};

void Calc_GrossAmt(char);
void Calc_Discount();
void Calc_NetAmt(char);
void Calc_Date(char,char);
};


class CCard : public CTicket
{
float m_GrossAmt;
float m_NetAmt;
float m_Discount;


public:
CCard();
~CCard(){};

void Calc_GrossAmt();
void Calc_Discount();
void Calc_NetAmt();

};


class CGroup : public CTicket
{

public:
CGroup();
~CGroup(){};

void Calc_Discount();
};


class CCorporate
{
char m_Name[SIZE];
int m_Hour;
float m_GrossAmt;
float m_NetAmt;
struct tm *m_pDate;
char m_Choice;
public:
CCorporate();
~CCorporate(){};

void Set_Details();
void Calc_GrossAmt();
void Calc_NetAmt();
void Set_Date();
};



class CFine
{
public:
void Fine_Amt();
};
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top