| re: Please Help Me
Part2
//---------------------------------------------------------------------------
#ifndef ProductH
#define ProductH
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
//---------------------------------------------------------------------------
class Product{
private:
char id;
char name;
double price;
double weight;
double vatPrice;
public:
//accessor function for id
char getid();
//accessor function for id
char getname();
//accessor function for id
double getprice();
//accessor function for id
double getweight();
//accessor function for id
double getvatPrice();
void products();
Product();
Product(char aid,char aname,double aprice,
double aweight, double avatPrice);
~Product();
};
#endif
#include <vcl.h>
#pragma hdrstop
//---------------------------------------------------------------------------
#include <stdio.h>
#include<string>
#include<fstream.h>
#include<iostream>
#pragma hdrstop
#include "Product.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
using namespace std;
Product::Product()
{
}
Product::Product(char aid,char aname,double aprice,
double aweight, double avatPrice){
id = aid;
name = aname;
price = aprice;
weight = aweight;
vatPrice = avatPrice;
}
char Product::getid()
{
return id; }
char Product::getname()
{
return id; }
double Product::getweight(){
return weight;}
double Product::getprice(){
return price;}
double Product::getvatPrice(){
return vatPrice;}
Product::~Product(){
delete current;
}
Thank you
|