0 Replies - 473 Views - Last Post: 26 December 2008 - 07:02 PM Rate Topic: -----

#1 ankurkumar11  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 16-June 08

Need Help in Program in C++ and C++ graphics

Post icon  Posted 26 December 2008 - 07:02 PM

Dear friends,
I need your help in my program!!!
I have made the program using static allocation of class objects
It's become too long and takes lot of memory and thus graphics fail to load fonts
Please help me to reduce the program length with dynamic allocation of objects
Also suggest some graphics

[code]
#include<fstream.h>
#include<conio.h>
#include<stdio.h>
#include<string.h>
#include<process.h>
#include<ctype.h>
#include<dos.h>
#include<stdlib.h>
#include<iomanip.h>
#include<graphics.h>
struct date d;
ifstream inf;
ofstream ouf;
char m[][12]={"January ","February ","March ","April ",
"May ","June ","July ","August ",
"September","October ","November ","December "};
/*****************************************************************************
* DECLARATIONS OF THE CLASSES *
******************************************************************************/
struct salary
{
double basic;
int month;
int year;
float hra;
float da;
float tax;
float total;
};
class employee
{
protected:
long int decide; //Decides the designation and basic
char name[40];
char post[40];
char add[40];
char email[20];
long int phone;
salary s[12];
int imonth;
void calsalary(void);
void personal(void);
public :
void getdata1(void);
void display1(void);
long int ecode;
}emp[10];
class rawmatter
{
protected:
int select;
char name[15];
char unit[11];
float yfeed;
float deposit;
float demand;
float supply;
float cost;
char supplier[40];
char address[40];
void consume(void);
void stock(void);
public :
void getdata2(void);
void display2(void);
long int mcode;
}raw[10];
class preview : protected employee, protected rawmatter,protected pro_sales
{
void efils(void); // display functions
void mfil(void);
void pfl(void);
long int code;
long int bno;
char bhead[20];
char oname[20];
char pnam[20];
char padd[30];
char ounit[8];
char type;
float cp;
float sp;
int day;
int month;
int year;
float qtity;
public:
void order(void);
void menu(void);
void getdata4(int);
void printdata4(void);
}ntry[10];
/*****************************************************************************
* DECLARATIONS OF THE FUNCTIONS *
******************************************************************************/
void employee::calsalary(void)
{
int i;
for(i=0;i<=d.da_mon-1;i++)
{
s[i].basic=s[0].basic;
if(i>=imonth)
s[i].basic=s[i].basic+1000;
s[i].month=i+1;
s[i].year=2008;
s[i].hra=0.20*s[i].basic;
s[i].da=0.41*s[i].basic;
s[i].tax=0.1*s[i].basic;
s[i].total =s[i].basic+s[i].hra+s[i].da-s[i].tax;
}
ofstream f1("Paymonthly.txt",ios::app);
cout<<"\n\nPAY SLIP for employee "<< ecode;
cout<<"\n\nName :-- "<<name;
cout<<"\nDesignation :-- "<<post;
cout<<"\n--------------------------------------------------------------------------------"
<<" Month\t Basic Pay\t HRA\t DA\t TAX\t Total"
<<" --------------------------------------------------------------------------------\n";
f1<<"\n\nPAY SLIP for employee "<<ecode;
f1<<"\n\nName :-- "<<name;
f1<<"\nDesignation :-- "<<post;
f1<<"\n------------------------------------------------------------------------------------------------\n"
<<" Month\t\tBasic Pay\t HRA\t DA\t TAX\t Total"
<<"\n------------------------------------------------------------------------------------------------\n";
for(i=0;i<=d.da_mon-1;i++)
{
cout<<" ";
cout.write(m[i],9);
cout<<"\t "<<s[i].basic<<"\t "<<s[i].hra<<"\t "<<s[i].da<<"\t "<<s[i].tax<<"\t "<<s[i].total<<"\n";
f1<<" ";
f1.write(m[i],9);
if(i>=3&&i<=6)
f1<<"\t";
f1<<"\t"<<s[i].basic<<"\t "<<s[i].hra<<"\t "<<s[i].da<<"\t "<<s[i].tax<<"\t "<<s[i].total<<"\n";
}
cout<<"--------------------------------------------------------------------------------\n";
f1<<"\n------------------------------------------------------------------------------------------------\n";
}
void employee::personal(void)
{
cout<<"\n\t\tPERSONAL INFORMATION\n\n";
cout<<"\nEmployee Code : "<<ecode<<"\n"
<<"Name : "<<name<<"\n"
<<"Designation : "<<post<<"\n"
<<"Next Increment : "<<m[imonth-1]<<d.da_year+1<<"\n"
<<"Address : "<<add<<"\n"
<<"Phone Number : "<<phone<<"\n"
<<"Email : "<<email<<"\n";
}
void employee::getdata1(void)
{
ofstream ouf("code1.txt",ios::out|ios::app);
int z;
do{
z = 0;
cout<<"\nEnter 5 digit employee code : ";
cin>>ecode;
ouf<<ecode<<'\n';
ouf.close();
decide = ecode/10000;
if(decide<1||decide>5||ecode<10000||ecode>99999)
{
cout<<"\n\nError! Error!\n";
z=1;
}
}while(z==1);
switch (decide)
{
case 1 : s[0].basic = 65000;
strcpy(post,"Director");
break;
case 2 : s[0].basic = 45000;
strcpy(post,"CEO");
break;
case 3 : s[0].basic = 25000;
strcpy(post,"Sr.Manager");
break;
case 4 : s[0].basic = 10000;
strcpy(post,"Clerk");
break;
case 5 :s[0].basic = 7000;
strcpy(post,"Worker");
break;
default : cout<<"\n\nError!!";
exit(0);
}
cout<<"\nEnter name : ";
gets(name);
cout<<"Enter increment month in number : ";
cin>>imonth;
cout<<"Enter your address : ";
gets(add);
cout<<"Enter your phone number : ";
cin>>phone;
cout<<"Enter your email : ";
gets(email);
cout<<"\n";
}
void employee::display1(void)
{
int a;
clrscr();
cout<<"Employee Code : "<<ecode<<"\n"
<<"Name : "<<name<<"\n"
<<"Designation : "<<post
<<"\n\n\t1.Salary\n\t2.Personal Information\n\n"
<<"\n\n\tEnter your choice : ";
cin>>a;
switch(a)
{
case 1 : clrscr();
calsalary();
getch();
break;
case 2: clrscr();
personal();
getch();
break;
default : cout<<"\nNo Match Found!!\n";
break;
}
}
void rawmatter::consume(void)
{
ofstream f2("rawdata.txt",ios::app);
int i,y; char s;
float month,daily,total=0;
month=yfeed/12;
daily=yfeed/365;
cout<<"\n\n\tCONSUMPTION of RAW MATERIAL "<<mcode;
f2<<"\n\n\tCONSUMPTION of RAW MATERIAL "<<mcode;
cout<<"\n\nName :-- "<<name;
f2<<"\n\nName :-- "<<name;
cout<<"\nUnit of Consumption :-- "<<unit;
f2<<"\nUnit of Consumption :-- "<<unit;
cout<<"\nCost per unit :-- Rs "<<cost;
cout<<"\nConsumption of "<<name<<"\n\n"
<<" 1. Daily\n"
<<" 2. Monthly\n\t"
<<"\tEnter your choice : ";
cin>>y;
switch(y)
{
case 1 : goto dayw;
case 2 : goto monthw;
default : cout<<"\nNo choice found!!\n";
getch();
exit(0);
}
dayw :
clrscr();
f2<<"\n\nDAILY CONSUMPTION";
cout<<"\n\t\t\tDAILY CONSUMPTION\n";
cout<<"\n--------------------------------------------------------------------------------"
<<"\tDate\t\t\tConsumption\n"
<<"--------------------------------------------------------------------------------\n";
f2<<"\n--------------------------------------------------------------------------------"
<<"\n\tDate\t\t\tConsumption\n"
<<"--------------------------------------------------------------------------------\n";
for(i=0;i<=d.da_day-1;i++)
{
if(i==15)
{
cout<<"\nPress a Key ............\n\n";
getch();
}
int o=d.da_mon;
cout<<"\t";
f2<<"\t";
cout<<i+1<<"/";
f2<<i+1<<"/";
printf("%d",d.da_mon);
f2<<o;
cout<<"/"<<d.da_year<<"\t\t"<<daily<<"\n";
f2<<"/"<<d.da_year<<"\t\t\t"<<daily<<"\n";
total=total+daily;
}
cout<<"\n--------------------------------------------------------------------------------"
<<"\tTotal for the month = "<<total<<"\n"
<<"--------------------------------------------------------------------------------\n";
f2<<"\n--------------------------------------------------------------------------------"
<<"\n\tTotal for the month = "<<total<<"\n"
<<"--------------------------------------------------------------------------------\n";

cout<<"\nWant to see monthly information? (y/n) : ";
cin>>s;
if(s=='y')
goto monthw;
else
goto end;
monthw :
clrscr();
total=0;
f2<<"\n\nMONTHLY CONSUMPTION";
cout<<"\n\t\t\tMONTHLY CONSUMPTION\n";
cout<<"\n--------------------------------------------------------------------------------"
<<"\tMonth\t\t\tConsumption\n"
<<"--------------------------------------------------------------------------------\n";
f2<<"\n--------------------------------------------------------------------------------"
<<"\n\tMonth\t\t\tConsumption\n"
<<"--------------------------------------------------------------------------------\n";
for(i=0;i<=d.da_mon-1;i++)
{
if(i==15)
{
cout<<"\nPress a Key.......\n\n";
getch();
}
cout<<"\t";
cout.write(m[i],9);
cout<<" "<<d.da_year<<"\t\t"<<month<<"\n";
f2<<"\t";
f2.write(m[i],9);
if(i<=7)
f2<<"\t";
f2<<" "<<d.da_year<<"\t\t"<<month<<"\n";
total=total+month;
}
cout<<"\n--------------------------------------------------------------------------------"
<<"\tTotal for "<<i<<" months = "<<total<<"\n"
<<"--------------------------------------------------------------------------------\n";
f2<<"\n--------------------------------------------------------------------------------"
<<"\n\tTotal for "<<i<<" months = "<<total<<"\n"
<<"--------------------------------------------------------------------------------\n";
cout<<"\nWant to see daily information? (y/n) : ";
cin>>s;
if(s=='y')
goto dayw;
end:
f2.close();
}
void rawmatter::stock(void)
{
int y; char s1;
ofstream f3("sreport.txt",ios::app);
cout<<"\n\t\tSTOCK INFORMATION\n\n";
f3<<"\n\t\tSTOCK INFORMATION\n\n";
cout<<"\nMaterial Code :"<<mcode<<"\n"
<<"Name :"<<name<<"\n"
<<"Unit of Consumption :"<<unit<<"\n"
<<"Cost per unit : Rs "<<cost<<"\n"
<<"Supplier of RAW MATERIAL :"<<supplier<<"\n"
<<"Address :"<<address<<"\n";
f3<<"\nMaterial Code :"<<mcode<<"\n"
<<"Name :"<<name<<"\n"
<<"Unit of Consumption :"<<unit<<"\n";
cout<<"\nSTOCK INFORMATION of "<<name<<"\n\n"
<<" 1. Daily\n"
<<" 2. Monthly\n\t"
<<"\tEnter your choice : ";
cin>>y;
switch(y)
{
case 1 : goto dayw;
case 2 : goto monthw;
default : cout<<"\nNo choice found!!\n";
getch();
exit(0);
}
int i,l1;
dayw :
clrscr();
cout<<"\n\t\tDAILY STOCK REPORT\n";
f3<<"\n\t\tDAILY STOCK REPORT\n";
cout<<"\n--------------------------------------------------------------------------------"
<<"\tDate\t Demand\t\t Supply\t\tStock Position\n"
<<"--------------------------------------------------------------------------------\n";
f3<<"\n-------------------------------------------------------------------------------------------------------------"
<<"\n\tDate\t Demand\t Supply\t Stock Position\n"
<<"-------------------------------------------------------------------------------------------------------------\n";
cout<<setprecision(3);
for(i=0;i<=d.da_day-1;i++)
{
if((deposit/supply)<=1)
{
cout<<"\nDANGER LEVEL\nINCREASE STOCK\n\n";
f3<<"\nDANGER LEVEL\nINCREASE STOCK\n\n";
break;
}
if(i==5)
{
cout<<"\nPress a key....\n\n";
getch();
}
cout<<" ";
f3<<" ";
cout<<i+1<<"/";
f3<<i+1<<"/";
l1=d.da_mon;
printf("%d",d.da_mon);
f3<<l1;
deposit=deposit-(supply/30);
cout<<"/"<<d.da_year<<"\t "<<demand/30<<"\t\t"<<supply/30<<"\t\t "<<deposit<<"\n";
f3<<"/"<<d.da_year<<"\t "<<demand/30<<"\t "<<supply/30<<"\t "<<deposit<<"\n";
}
cout<<"\n--------------------------------------------------------------------------------"
<<"\tTotal\t "<<(demand/30)*i<<"\t\t "<<(supply/30)*i<<"\t\t "<<deposit<<"\n"
<<"--------------------------------------------------------------------------------\n";
f3<<"\n-------------------------------------------------------------------------------------------------------------\n"
<<"\n\tTotal\t "<<(demand/30)*i<<"\t\t"<<(supply/30)*i<<"\t\t"<<deposit<<"\n"
<<"-------------------------------------------------------------------------------------------------------------\n";
cout<<"\nWant to see monthly information? (y/n) : ";
cin>>s1;
if(s1=='y')
goto monthw;
else
goto end;
monthw:
clrscr();
cout<<"\n\t\tMONTHLY STOCK REPORT\n";
cout<<"\n--------------------------------------------------------------------------------"
<<" Month\t\t Demand\t\tSupply\t\t Stock Position\n"
<<"--------------------------------------------------------------------------------\n";
f3<<"\n\t\tMONTHLY STOCK REPORT\n";
f3<<"\n-----------------------------------------------------------------------------------------------------------"
<<"\nMonth\t\t Demand\t Supply\t Stock Position\n"
<<"----------------------------------------------------------------------------------------------------------\n";
cout<<setprecision(5);
for(i=0;i<=d.da_mon-1;i++)
{
if((deposit/supply)<=1)
{
cout<<"\nDANGER LEVEL\nINCREASE STOCK\n\n";
f3<<"\nDANGER LEVEL\nINCREASE STOCK\n\n";
break;
}
if(i==10)
{
cout<<"\nPress a Key.........\n\n";
getch();
}
cout<<" ";
f3<<" ";
cout.write(m[i],9);
f3.write(m[i],9);
cout<<" "<<d.da_year;
f3<<" "<<d.da_year;
deposit=deposit-(supply);
cout<<"\t "<<demand<<"\t\t"<<supply<<"\t\t "<<deposit<<"\n";
f3<<"\t "<<demand<<"\t\t"<<supply<<"\t\t"<<deposit<<"\n";
}
cout<<"\n--------------------------------------------------------------------------------"
<<"\tTotal\t "<<demand*i<<"\t\t "<<supply*i<<"\t\t "<<deposit<<"\n"
<<"--------------------------------------------------------------------------------\n";
f3<<"\n--------------------------------------------------------------------------------"
<<"\n\tTotal\t "<<demand*i<<"\t\t"<<supply*i<<"\t\t "<<deposit<<"\n"
<<"--------------------------------------------------------------------------------\n";
cout<<"\nWant to see daily information? (y/n) : ";
cin>>s1;
if(s1=='y')
goto dayw;
end:
f3.close();
}
void rawmatter::getdata2(void)
{
ofstream ouf("code2.txt",ios::out|ios::app);
int z=0;
do{
cout<<"\nEnter 5-digit material code :";
cin>>mcode;
ouf<<mcode<<'\n';
ouf.close();
select = mcode/10000;
if(select<1||select>5||mcode<10000||mcode>99999)
{
cout<<"\n\nError! Error!\n";
z=1;
}
}while(z==1);
switch (select)
{
case 1 : cost = 50000;
strcpy(name,"Iron");
strcpy(unit,"Tons");
break;
case 2 : cost = 40000;
strcpy(name,"Coal");
strcpy(unit,"Tons");
break;
case 3 : cost = 10;
strcpy(name,"Electricity");
strcpy(unit,"Kwh");
break;
case 4 : cost = 15000;
strcpy(name,"Limestone");
strcpy(unit,"Tons");
break;
case 5 : cost = 3000;
strcpy(name,"Water");
strcpy(unit,"Cubic Metre");
break;
default : cout<<"\n\nError!!";
exit(0);
}
cout<<"Enter Yearly Consumption :";
cin>>yfeed;
cout<<"Enter Positon of Stock: ";
cin>>deposit;
cout<<"Enter Monthly Supply: ";
cin>>supply;
cout<<"Enter Monthly Demand of Material: ";
cin>>demand;
cout<<"Enter Supplier of the MATERIAL: ";
gets(supplier);
cout<<"Enter Supplier Address: ";
gets(address);
}
void rawmatter::display2(void)
{
int a;
clrscr();
cout<<"MATERIAL Code :"<<mcode<<"\n"
<<"Name :"<<name<<"\n"
<<"\n\n\t1.Consumption\n\t2.Stock information\n\n"
<<"\n\n\tEnter your choice : ";
cin>>a;
switch(a)
{
case 1 : clrscr();
consume();
getch();
break;
case 2: clrscr();
stock();
getch();
break;
default : cout<<"\nNo Match Found!!\n";
break;
}
}
void preview::efils(void)
{
int ch1,i,q=0;long int e,fg; char pass[11]="iwant2nter",check[11];
clrscr();
cout<<"\n\t----------------***** EMPLOYEE SECTION *****------------------\n";
cout<<"________________________________________________________________________________\n\n";
cout<<"\n\tEnter your choice :\n"
<<"\t1. View Data\n"
<<"\t2. New Entry\n"
<<"\t3. Main Menu\n\t\t\t :";
cin>>ch1;
switch(ch1)
{
case 1 : clrscr();
cout<<"\n\t----------------***** EMPLOYEE SECTION *****------------------\n";
cout<<"________________________________________________________________________________\n\n";
cout<<"\n\nEnter the employee code : ";
cin>>e;
inf.open("code1.txt",ios::in);
while(inf)
{
inf>>fg;
if(e==fg)
{
inf.close();
break;
}
}
inf.open("emp.txt",ios::in);
for(i=0;i<10;i++)
{
inf.read((char*)&emp[i],sizeof(emp[i]));
if(e==emp[i].ecode)
{
emp[i].display1();
break;
}
}
inf.close();
break;
case 2 : clrscr();
cout<<"\n\t----------------***** EMPLOYEE SECTION *****------------------\n";
cout<<"________________________________________________________________________________\n\n";
cout<<"\n\tEnter the password : ";
gets(check);
if(strcmp(pass,check)==0)
{
clrscr();
cout<<"Enter details for the new employee of the company\n";
ouf.open("emp.txt",ios::app);
for(i=q;i<q+1;i++)
{
emp[i].getdata1();
ouf.write((char*)&emp[i],sizeof(emp[i]));
ouf.close();
q=i;
}
}
else
cout<<"\nIllegal entry!!!!\n";
break;
case 3 : menu();
break;
default : cout<<"\nERROR! NO MATCH!!\n";
break;
}
menu();
}
void preview::mfil(void)
{
int ch2,j,r=0;long int e1,fg1;char check1[10];
clrscr();
cout<<"\n\t----------------*** RAW MATERIAL SECTION ***------------------\n";
cout<<"________________________________________________________________________________\n\n";
cout<<"\n\tEnter your choice :\n"
<<"\t1. View Data\n"
<<"\t2. New Entry\n"
<<"\t3. Main Menu\n\t\t\t : ";
cin>>ch2;
switch(ch2)
{
case 1 : clrscr();
cout<<"\n\t----------------*** RAW MATERIAL SECTION ***------------------\n";
cout<<"________________________________________________________________________________\n\n";
cout<<"\n\nEnter the MATERIAL code : ";
cin>>e1;
inf.open("code2.txt",ios::in);
while(inf)
{
inf>>fg1;
if(e1==fg1)
{
inf.close();
break;
}
}
inf.open("rawmat.txt",ios::in);
for(j=0;j<10;j++)
{
inf.read((char*)&raw[j],sizeof(raw[j]));
if(e1==raw[j].mcode)
{
raw[j].display2();
break;
}
}
inf.close();
break;
case 2 : clrscr();
cout<<"\n\t----------------*** RAW MATERIAL SECTION ***------------------\n";
cout<<"________________________________________________________________________________\n\n";
cout<<"\n\tEnter the password : ";
gets(check1);
if(strcmp("peaksneak",check1)==0)
{
clrscr();
cout<<"Enter details for the new vmaterial\n";
ouf.open("rawmat.txt",ios::app);
for(j=r;j<r+1;j++)
{
raw[j].getdata2();
ouf.write((char*)&raw[j],sizeof(raw[j]));
ouf.close();
r=j;
}
}
else
cout<<"\nIllegal entry!!!!\n";
break;
case 3 : menu();
break;
default : cout<<"\nERROR! NO MATCH!!\n";
break;
}
menu();
}
void preview::pfl(void)
{
int ch3,k,s=0;long int e2,fg2;char check2[10];
clrscr();
cout<<"\n\t------------*** PRODUCTION AND SALES SECTION ***------------------\n";
cout<<"________________________________________________________________________________\n\n";
cout<<"\n\tEnter your choice :\n"
<<"\t1. View Data\n"
<<"\t2. New Entry\n"
<<"\t3. Main Menu\n\t\t\t : ";
cin>>ch3;
switch(ch3)
{
case 1 : clrscr();
cout<<"\n\t------------*** PRODUCTION AND SALES SECTION ***------------------\n";
cout<<"________________________________________________________________________________\n\n";
cout<<"\n\nEnter the PRODUCT code : ";
cin>>e2;
inf.open("code3.txt",ios::in);
while(inf)
{
inf>>fg2;
if(e2==fg2)
{
inf.close();
break;
}
}
inf.open("pnsales.txt",ios::in);
for(k=0;k<10;k++)
{
inf.read((char*)&pn[k],sizeof(pn[k]));
if(e2==pn[k].pcode)
{
pn[k].display3();
break;
}
}
inf.close();
break;
case 2 : clrscr();
cout<<"\n\t------------*** PRODUCTION AND SALES SECTION ***------------------\n";
cout<<"________________________________________________________________________________\n\n";
cout<<"\n\tEnter the password : ";
gets(check2);
if(strcmp("dontgoplz",check2)==0)
{
clrscr();
cout<<"Enter details for the product\n";
ouf.open("pnsales.txt",ios::app);
for(k=s;k<s+1;k++)
{
pn[k].getdata3();
ouf.write((char*)&pn[k],sizeof(pn[k]));
ouf.close();
s=k;
}
}
else
cout<<"\nIllegal entry!!!!\n";
break;
case 3 : menu();
break;
default : cout<<"\nERROR! NO MATCH!!\n";
break;
}
menu();
}
void preview::getdata4(int ch5)
{
clrscr();
randomize();
int counter =rand()%100; //for unique bill no.
long int s1;
type=ch5;
cout<<"\n\t-----------------** ORDER & PURCHASE SECTION **------------------\n";
cout<<"________________________________________________________________________________\n\n";
switch (ch5)
{
case 1 : strcpy(bhead,"PURCHASE");
cout<<"\nEnter code : ";
cin>>code;
s1=code/10000;
bno=s1*10000+type+counter;
ofstream of7("code4.txt",ios::out|ios::app);
of7<<bno<<'\n';
of7.close();
switch (s1)
{
case 1 : cp = 4000;
strcpy(oname,"Carbon Steel");
strcpy(ounit,"Tons");
break;
case 2 : cp = 12000;
strcpy(oname,"Alloy Steel");
strcpy(ounit,"Tons");
break;
case 3 : cp = 8000;
strcpy(oname,"Stainless Steel");
strcpy(ounit,"Tons");
break;
case 4 : cp = 3000;
strcpy(oname,"Tools Steel");
strcpy(ounit,"Tons");
break;
default : cout<<"\n\nError!!";
exit(0);
}
break;
case 2 : strcpy(bhead,"SALE");
cout<<"\nEnter code : ";
cin>>code;
s1=code/10000;
bno=s1*10000+type+counter;
ofstream of8("code5.txt",ios::out|ios::app);
of8<<bno<<'\n';
of8.close();
switch (s1)
{
case 1 : cp = 50000;
strcpy(oname,"Iron");
strcpy(ounit,"Tons");
break;
case 2 : cp = 40000;
strcpy(oname,"Coal");
strcpy(ounit,"Tons");
break;
case 3 : cp = 10;
strcpy(oname,"Electricity");
strcpy(ounit,"Kwh");
break;
case 4 : cp = 15000;
strcpy(oname,"Limestone");
strcpy(ounit,"Tons");
break;
case 5 : cp = 3000;
strcpy(oname,"Water");
strcpy(ounit,"Cubic Metre");
break;
default : cout<<"\n\nError!!";
exit(0);
}
break;
default : cout<<"\nError! Error!\n";
exit(0);
}
cout<<"Enter your name : ";
gets(pnam);
cout<<"Enter your address : ";
gets(padd&#

This post has been edited by ankurkumar11: 27 December 2008 - 01:15 AM


Is This A Good Question/Topic? 0
  • +

Page 1 of 1