Well this is quite a large program so there is a lot of information to sort through, but when I compile it now it comes up with this:
/Users/Adam/Adam's Work/Programming/C++/Code/OS2.cpp: In member function ‘virtual int dbase::todo()’:
/Users/Adam/Adam's Work/Programming/C++/Code/OS2.cpp:393: error: invalid conversion from ‘const char*’ to ‘int’
/Users/Adam/Adam's Work/Programming/C++/Code/OS2.cpp:394: error: invalid conversion from ‘const char*’ to ‘int’
/Users/Adam/Adam's Work/Programming/C++/Code/OS2.cpp:420: error: a function-definition is not allowed here before ‘{’ token
/Users/Adam/Adam's Work/Programming/C++/Code/OS2.cpp:4034: error: expected `}' at end of input
/Users/Adam/Adam's Work/Programming/C++/Code/OS2.cpp:4034: error: expected `while' at end of input
/Users/Adam/Adam's Work/Programming/C++/Code/OS2.cpp:4034: error: expected `(' at end of input
/Users/Adam/Adam's Work/Programming/C++/Code/OS2.cpp:4034: error: expected primary-expression at end of input
/Users/Adam/Adam's Work/Programming/C++/Code/OS2.cpp:4034: error: expected `)' at end of input
/Users/Adam/Adam's Work/Programming/C++/Code/OS2.cpp:4034: error: expected `;' at end of input
/Users/Adam/Adam's Work/Programming/C++/Code/OS2.cpp:4034: error: expected `}' at end of input
I have gone to these lines but I just can't seem to identify the problem. If you could come up with any suggestions that would be great. Here is my program code:
#include <iostream>
#include <string>
#include <fstream>
#include <ctime>
#include <sstream>
using namespace std;
class base
{
public:
virtual int prod(){return -1;}
virtual int todo(){return -1;}
virtual int calendar(){return -1;}
};
class dbase2:public base
{
public:
int calendar();
};
int dbase2::calendar()
{
int cme;
int cd;
string cdd;
int cw;
string cwd;
int cm;
string cmd;
int cy;
string cyd;
cout<<endl;
cout<<"========"<<endl;
cout<<"Calendar"<<endl;
cout<<"========"<<endl;
cout<<"---------------------------"<<endl;
cout<<"| View (1) | Settings (2) | "<<endl;
cout<<"---------------------------"<<endl;
cin>>cme;
// calendar display
switch(cd)
{
{case 1:cdd = "-1-"; break;}
}
cout<<"|"<<cdd<<"|"<<endl;
// calendar display
}
class dbase:public base
{
public:
int prod();
int todo();
};
int dbase::prod()
{
char nt[20];
string ntw;
int me;
char ma[5];
int cl;
string ys = "yes";
string dn;
string dp;
string de;
char mp[20];
string mpx;
string adx;
string dex;
string ntwx;
char mp1[20];
string rc;
string adr;
char lit[20];
char nf[20];
string fn;
string fnk;
string fnx;
char co[20];
string tf;
do
{
cout<<endl;
cout<<"========"<<endl;
cout<<"Contacts"<<endl;
cout<<"========"<<endl;
cout<<"--------------------------------------"<<endl;
cout<<"| Add Contact (1) | View Contact (2) | "<<endl;
cout<<"--------------------------------------"<<endl;
cin>>me;
if(me == 1)
{
cout<<"Enter any number (Reference number)"<<endl;
cin>>lit;
cout<<"Enter Name:";
getline(cin, dn);
getline(cin, dn);
cout<<endl;
cout<<"+ Add Phone Number? type 'yes' or 'no'"<<endl;
cin>>mp;
if(mp == ys)
{
cout<<"Phone Number:";
getline(cin, dp);
getline(cin, dp);
mpx += ("|Phone Number: " + dp);
}
else
{
dp = "";
}
cout<<endl;
cout<<"+ Add Address? type 'yes' or 'no'"<<endl;
cin>>ma;
if(ma == ys)
{
cout<<"Address:";
getline(cin, adr);
getline(cin, adr);
adx += ("|Address: " + adr);
}
else
{
adr = "";
}
cout<<endl;
cout<<"+ Add Email? type 'yes' or 'no'"<<endl;
cin>>mp1;
if(mp1 == ys)
{
cout<<"Email Address:";
getline(cin, de);
getline(cin, de);
dex += ("|Email: " + de);
}
else
{
de = "";
}
cout<<endl;
cout<<"+ Add Notes? type 'yes' or 'no'"<<endl;
cin>>nt;
if(nt == ys)
{
cout<<"Notes:";
getline(cin, ntw);
getline(cin, ntw);
ntwx += ("|Notes: " + ntw);
}
cout<<endl;
cout<<"+ Add Custom Field? type 'yes' or 'no'"<<endl;
cin>>nf;
if(nf == ys)
{
cout<<"Field Name:";
getline(cin, fn);
getline(cin, fn);
cout<<fn<<":";
getline(cin, fnk);
fnx += ("|" + fn + ": " + fnk);
}
// add ntw
rc += ("-" + dn + "-" + "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" + "|----------------------" + "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" + mpx + "" + "\t\t\t\t\t\t\t\t\t\t\t" + adx + "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" + dex + "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" + ntwx + "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" + fnx);
ofstream fileo (lit);
fileo<<rc;
}
if(me == 2)
{
cout<<endl;
cout<<"Enter reference number:";
cin>>co;
ifstream fileop(co);
if(! fileop.eof())
{
cout<<endl;
getline(fileop, tf);
cout<<endl;
cout<<"====================="<<endl;
cout<<tf<<endl;
cout<<"====================="<<endl;
cin.get();
cin.get();
}
}
cout<<endl;
cout<<"Back to menu - 1"<<endl;
cout<<"Exit - 2"<<endl;
cin>>cl;
}while(cl == 1);
}
int dbase::todo()
{
string yxa = "(Done)";
string svi;
int tpx;
int tkm;
int alt;
char it[20];
string done;
string jn;
int nj;
int tmm;
int th;
int tmh;
do
{
cout<<endl;
cout<<"==========="<<endl;
cout<<"Task Center"<<endl;
cout<<"==========="<<endl;
cout<<"----------------------"<<endl;
cout<<"| New (1) | View (2) | "<<endl;
cout<<"----------------------"<<endl;
cin>>tkm;
alt = tkm;
if(tkm == 1)
{
cout<<"Enter any number (task number)"<<endl;
cin>>it;
int imp;
string prt;
string ji;
string di;
string ni;
string all;
cout<<endl;
cout<<"Task Title:";
getline(cin, ji);
getline(cin, ji);
cout<<endl;
cout<<"Due:";
getline(cin, di);
cout<<endl;
cout<<"Notes:";
getline(cin, ni);
cout<<endl;
cout<<"Set Priority | 1 | 2 | 3 |"<<endl;
cin>>imp;
if(imp == 1)
{
prt = "Low";
}
if(imp == 2)
{
prt = "Medium";
}
if(imp == 3)
{
prt = "High";
}
all += ("-" + ji + "-" + "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" + "|----------------------" + "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" + "|Notes: " + ni + "" + "\t\t\t\t\t\t\t\t\t\t\t" + "|Due: " + di + "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" + "|Priority: " + prt + "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t");
ofstream file(it);
file<<all;
}
if(alt == 1)
{
string cht;
ifstream filest(it);
if(! filest.eof())
{
getline(filest, cht);
cout<<endl;
cout<<"==========================="<<endl;
cout<<cht<<endl;
cout<<"==========================="<<endl;
cin.get();
cin.get();
}
}
if(tkm == 2)
{
string chs;
char dm[20];
cout<<"Task number:";
cin>>dm;
ifstream files(dm);
if(! files.eof())
{
getline(files, chs);
cout<<"==========================="<<endl;
cout<<chs<<endl;
cout<<"==========================="<<endl;
cin.get();
cin.get();
if(chs == yxa)
{
cout<<"";
}
cout<<"- Mark as Done (1) - Set Task Time (2) -"<<endl;
cin>>nj;
if(nj == 1)
{
done = "(Done)";
jn = (done + chs);
ofstream dfile (dm);
dfile<<jn;
}
if(nj == 2)
{
// set time code
cout<<"Set how much time this task might take"<<endl;
cout<<"Minutes: "<<endl;
cin>>tmm;
cout<<"Hours: "<<endl;
cin>>th;
tmm += ("Minutes: " + tmm);
th += ("Hours: " + th);
tmh = (tmm + th);
}
cout<<endl;
cout<<"Back to menu - 1"<<endl;
cout<<"Exit - 2"<<endl;
cin>>tpx;
}while(tpx == 1);
}
class Time
{
public:
void Timer();
};
// COUNTDOWN TIMER
void Time::Timer()
{
unsigned int zxi;
do
{
unsigned int zt;
unsigned int xt;
unsigned int yt;
cout<<endl;
cout<<"==============="<<endl;
cout<<"Countdown Timer"<<endl;
cout<<"==============="<<endl;
cout<<endl;
cout<<"Time in minutes - 1"<<endl;
cout<<"Time in seconds - 2"<<endl;
cin>>yt;
if(yt == 1)
{
cout<<endl;
cout<<"Enter how many minutes to count down from:";
cin>>xt;
cout<<"-"<<xt<<"-";
cout<<flush;
for(xt >= 0; xt --;)
{
cout<<"-"<<xt<<"-";
sleep(60);
cout<<flush;
}
}
if(yt == 2)
{
cout<<endl;
cout<<"Enter how many seconds to count down from:";
cin>>zt;
cout<<"-"<<zt<<"-";
cout<<flush;
for(zt >= 0; zt--;)
{
cout<<"-"<<zt<<"-";
sleep(1);
cout<<flush;
}
}
cout<<endl;
cout<<"---"<<endl;
cout<<"End"<<endl;
cout<<"---"<<endl;
cout<<"(press enter)"<<endl;
cin.get();
cin.get();
cout<<"Start another countdown - 1"<<endl;
cout<<"Exit - 2"<<endl;
cin>>zxi;
}
while(zxi == 1);
}
class Sdt
{
public:
void Speed();
void Distance();
void Time();
};
void Sdt::Time()
{
float one;
float hr;
float hr1;
float mnt;
float scd;
float hr2;
float hr12;
float mnt2;
float scd2;
do
{
unsigned int ch;
cout<<endl;
cout<<"==============="<<endl;
cout<<"Time Calculator"<<endl;
cout<<"==============="<<endl;
cout<<endl;
cout<<"Hours - 1"<<endl;
cout<<"Hours(MPH) - 2"<<endl;
cout<<"Minutes - 3"<<endl;
cout<<"Seconds - 4"<<endl;
cin>>ch;
if(ch == 4)
{
cout<<"Enter the meters:";
cin>>scd;
cout<<"Enter speed meters/second:";
cin>>scd2;
cout<<endl;
cout<<(scd / scd2)<<" Seconds"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(ch == 3)
{
cout<<"Enter the meters:";
cin>>mnt;
cout<<"Enter speed meters/minute:";
cin>>mnt2;
cout<<endl;
cout<<(mnt / mnt2)<<" Minutes"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(ch == 2)
{
cout<<"Enter the meters:";
cin>>hr1;
cout<<"Enter speed MPH:";
cin>>hr12;
cout<<endl;
cout<<(hr1 / hr12)<<" Hours"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(ch == 1)
{
cout<<"Enter the kilometers:";
cin>>hr;
cout<<"Enter speed KM/H:";
cin>>hr2;
cout<<endl;
cout<<(hr / hr2)<<" Hours"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
cout<<endl;
cout<<"Do another convertion - 1"<<endl;
cout<<"Exit - 2"<<endl;
cin>>ch;
}while(one == 1);
}
// DISTANCE CALCULATOR
void Sdt::Distance()
{
int vp;
int xpi;
float ks;
float kt;
do
{
cout<<endl;
cout<<"==================="<<endl;
cout<<"Distance Calculator"<<endl;
cout<<"==================="<<endl;
cout<<endl;
cout<<"KM - 1"<<endl;
cout<<"Miles - 2"<<endl;
cout<<"Meters - 3"<<endl;
cin>>xpi;
if(xpi == 1)
{
cout<<endl;
cout<<"Enter the speed (KM/H):";
cin>>ks;
cout<<endl;
cout<<"Enter the minutes:";
cin>>kt;
kt = (kt / 60);
cout<<endl;
cout<<(ks * kt)<<" KM"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(xpi == 2)
{
cout<<endl;
cout<<"Enter the speed (MPH):";
cin>>ks;
cout<<endl;
cout<<"Enter the minutes:";
cin>>kt;
kt = (kt / 60);
cout<<endl;
cout<<(ks * kt)<<" Miles"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(xpi == 3)
{
cout<<endl;
cout<<"Enter the speed (Meters/Second):";
cin>>ks;
cout<<endl;
cout<<"Enter the minutes:";
cin>>kt;
kt = (kt * 60);
cout<<endl;
cout<<(ks * kt)<<" Meters"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
cout<<endl;
cout<<"Do another convertion - 1"<<endl;
cout<<"Exit - 2"<<endl;
cin>>vp;
}while(vp == 1);
}
// SPEED CALCULATOR
void Sdt::Speed()
{
float dx;
float tx;
int xp;
int lp;
do
{
cout<<endl;
cout<<"================"<<endl;
cout<<"Speed Calculator"<<endl;
cout<<"================"<<endl;
cout<<endl;
cout<<"M/S - 1"<<endl;
cout<<"KM/H - 2"<<endl;
cout<<"MPH - 3"<<endl;
cin>>xp;
if(xp == 1)
{
cout<<endl;
cout<<"Type in the meters:";
cin>>dx;
cout<<endl;
cout<<"Type in the seconds:";
cin>>tx;
cout<<endl;
cout<<(dx / tx)<<" M/S"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(xp == 2)
{
cout<<endl;
cout<<"Type in the kilometers:";
cin>>dx;
cout<<endl;
cout<<"Type in the mintues:";
cin>>tx;
tx = (tx / 60);
cout<<endl;
cout<<(dx / tx)<<" KM/H"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(xp == 3)
{
cout<<endl;
cout<<"Type in the miles:";
cin>>dx;
cout<<endl;
cout<<"Type in the mintues:";
cin>>tx;
tx = (tx / 60);
cout<<endl;
cout<<(dx / tx)<<" MPH"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
cout<<endl;
cout<<"Do another conversion - 1"<<endl;
cout<<"Exit - 2"<<endl;
cin>>lp;
}while(lp == 1);
}
class Unit
{
public:
void Con();
};
void Unit::Con()
{
int hh;
do
{
int zx;
cout<<endl;
cout<<"=============="<<endl;
cout<<"Unit Converter"<<endl;
cout<<"=============="<<endl;
cout<<endl;
cout<<"Temperature - 1"<<endl;
cout<<"Length - 2"<<endl;
cout<<"Time - 3"<<endl;
cin>>zx;
if(zx == 1)
{
int v;
float vv;
cout<<endl;
cout<<"==================================================="<<endl;
cout<<"Celsius to Fahrenheit - 1"<<endl;
cout<<"Fahrenheit to Celsius - 2"<<endl;
cout<<endl;
cout<<"Celsius to Kelvin - 3"<<endl;
cout<<"Fahrenheit to Kelvin - 4"<<endl;
cout<<endl;
cout<<"Kelvin to Fahenheit - 5"<<endl;
cout<<"Kelvin to Celsius - 6"<<endl;
cout<<endl;
cin>>v;
if(v == 1)
{
cout<<"Type in your Celsius Value:";
cin>>vv;
cout<<endl;
cout<<(vv * 9/5 + 32)<<" Degrees Fahrenheit"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(v == 2)
{
cout<<"Type in your Fahrenheit Value:";
cin>>vv;
cout<<endl;
cout<<(vv - 32) * 5/9<<"Degrees Celsius"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(v == 3)
{
cout<<"Type in your Celsius Value:";
cin>>vv;
cout<<endl;
cout<<(vv + 273.15)<<" Kelvin"<<endl;
cin.get();
cin.get();
}
if(v == 4)
{
cout<<"Type in your Fahrenheit Value:";
cin>>vv;
cout<<endl;
cout<<((vv - 32) * 5/9 + 273.15)<<" Kelvin"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(v == 5)
{
cout<<"Type in your Kelvin Value:";
cin>>vv;
cout<<endl;
cout<<((vv - 273.15) * 9/5 + 32)<<" Degrees Fahrenheit"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(v == 6)
{
cout<<"Type in your Kelvin Value:";
cin>>vv;
cout<<endl;
cout<<(vv - 273.15)<<" Degrees Celsius"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
}
if(zx == 2)
{
string aa = "mm-m";
string ab = "mm-km";
string ac = "mm-ft";
string ad = "mm-inch";
string bb = "m-km";
string cc = "ft-inch";
string dd = "inch-ft";
string dda = "inch-m";
string ddb = "inch-mm";
string ee = "m-mm";
string ff = "km-m";
string gg = "ft-m";
string ga = "ft-km";
string hh = "m-ft";
string hha = "km-mm";
string ii = "inch-mm";
string ib = "m-ft";
string ic = "m-inch";
string mm = "km-mile";
string mma = "mile-km";
string mb = "m-mile";
string mba = "mile-m";
string mc = "ft-mile";
string mca = "mile-ft";
string xy;
float yy;
cout<<endl;
cout<<"==================================================="<<endl;
cout<<"Type in your length to convert from and to:"<<endl;
cout<<"(i.e. mm-m, ft-inch, km-mile)"<<endl;
cout<<endl;
cin>>xy;
// MM-M
if(xy == aa)
{
cout<<endl;
cout<<"Type in your millimetre value:";
cin>>yy;
cout<<(yy / 1000)<<" Meters"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// MM-KM
if(xy == ab)
{
cout<<endl;
cout<<"Type in your millimetre value:";
cin>>yy;
cout<<(yy / 1000 / 1000)<<" Kilometers"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// MM-FT
if(xy == ac)
{
cout<<endl;
cout<<"Type in your millimetre value:";
cin>>yy;
cout<<(yy * 0.03937) / 12<<" Feet"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// MM-INCH
if(xy == ad)
{
cout<<endl;
cout<<"Type in your millimetre value:";
cin>>yy;
cout<<(yy * 0.03937)<<" Inches"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// M-KM
if(xy == bb)
{
cout<<endl;
cout<<"Type in your metre value:";
cin>>yy;
cout<<(yy / 1000)<<" Kilometers"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// FT-INCH
if(xy == cc)
{
cout<<endl;
cout<<"Type in your Feet value:";
cin>>yy;
cout<<(yy * 12)<<" Inches"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// INCH-FT
if(xy == dd)
{
cout<<endl;
cout<<"Type in your Inch value:";
cin>>yy;
cout<<(yy / 12)<<" Feet"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(xy == dda)
{
cout<<endl;
cout<<"Type in your Inch value:";
cin>>yy;
cout<<(yy * 0.3048) / 12<<" Meters"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// M-MM
if(xy == ee)
{
cout<<endl;
cout<<"Type in your Meter value:";
cin>>yy;
cout<<(yy * 1000)<<" Millimeters"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// KM-M
if(xy == ff)
{
cout<<endl;
cout<<"Type in your Kilometer value:";
cin>>yy;
cout<<(yy * 1000)<<" Meters"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// FT-MM
if(xy == gg)
{
cout<<endl;
cout<<"Type in your Feet value:";
cin>>yy;
cout<<(yy * 0.3048)<<" Meters"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(xy == ga)
{
cout<<endl;
cout<<"Type in your Feet value:";
cin>>yy;
cout<<(yy * 0.0003048)<<" Kilometers"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// KM-MM
if(xy == hha)
{
cout<<endl;
cout<<"Type in your kilometer value:";
cin>>yy;
cout<<(yy * 1000 * 1000)<<" Millimeters"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// INCH-MM
if(xy == ii)
{
cout<<endl;
cout<<"Type in your inch value:";
cin>>yy;
cout<<(yy / 0.03937)<<" Millimeters"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// MM-FT
if(xy == ib)
{
cout<<endl;
cout<<"Type in your Meter value:";
cin>>yy;
cout<<((yy * 39.37) / 12)<<" Feet"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// MM-INCH
if(xy == ic)
{
cout<<endl;
cout<<"Type in your Meter value:";
cin>>yy;
cout<<(yy * 39.37)<<" Inches"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// KM-Miles
if(xy == mm)
{
cout<<endl;
cout<<"Type in your Kilometer value:";
cin>>yy;
cout<<(yy * 0.6214)<<" Miles"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// MILE-KM
if(xy == mma)
{
cout<<endl;
cout<<"Type in your Mile value:";
cin>>yy;
cout<<(yy * 1.609)<<" Kilometers"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// M-MILE
if(xy == mb)
{
cout<<endl;
cout<<"Type in your Meter value:";
cin>>yy;
cout<<(yy * 0.0006214)<<" Miles"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
}
// TIME CONVERTER
if(zx == 3)
{
string at = "mins-hours";
string ata = "mins-days";
string atb = "mins-weeks";
string atc = "mins-months";
string atd = "mins-years";
string bt = "hours-mins";
string bta = "hours-days";
string btb = "hours-weeks";
string btc = "hours-months";
string btd = "hours-years";
string ct = "days-mins";
string cta = "days-hours";
string ctb = "days-weeks";
string ctc = "days-months";
string ctd = "days-years";
string dt = "weeks-mins";
string dta = "weeks-hours";
string dtb = "weeks-days";
string dtc = "weeks-months";
string dtd = "weeks-years";
string et = "months-mins";
string eta = "months-hours";
string etb = "months-days";
string etc = "months-weeks";
string etd = "months-years";
string ft = "years-mins";
string fta = "years-hours";
string ftb = "years-days";
string ftc = "years-weeks";
string ftd = "years-months";
string coni;
float mt;
cout<<endl;
cout<<"Type in your time to convert from and to:"<<endl;
cout<<"(i.e. mins-hours, months-weeks, days-years)"<<endl;
cin>>coni;
if(coni == at)
{
cout<<endl;
cout<<"type in your minute value:";
cin>>mt;
cout<<endl;
cout<<(mt / 60)<<" Hours"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == ata)
{
cout<<endl;
cout<<"type in your minute value:";
cin>>mt;
cout<<endl;
cout<<(mt / 60) / 24<<" Days"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == atb)
{
cout<<endl;
cout<<"type in your minute value:";
cin>>mt;
cout<<endl;
cout<<((mt / 60) / 24) / 7<<" Weeks"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == atc)
{
cout<<endl;
cout<<"type in your minute value:";
cin>>mt;
cout<<endl;
cout<<(((mt / 60) / 24) / 7) / 4.3<<" Months"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == atd)
{
cout<<endl;
cout<<"type in your minute value:";
cin>>mt;
cout<<endl;
cout<<((((mt / 60) / 24) / 7) / 4.3) / 12<<" Years"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == bt)
{
cout<<endl;
cout<<"type in your hours value:";
cin>>mt;
cout<<endl;
cout<<(mt * 60)<<" Minutes"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == bta)
{
cout<<endl;
cout<<"type in your hours value:";
cin>>mt;
cout<<endl;
cout<<(mt / 24)<<" Days"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == btb)
{
cout<<endl;
cout<<"type in your hours value:";
cin>>mt;
cout<<endl;
cout<<(mt / 24) / 7<<" Weeks"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == btc)
{
cout<<endl;
cout<<"type in your hours value:";
cin>>mt;
cout<<endl;
cout<<((mt / 24) / 7) / 4.3<<" Months"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == btd)
{
cout<<endl;
cout<<"type in your hours value:";
cin>>mt;
cout<<endl;
cout<<(((mt / 24) / 7) / 4.3) / 12<<" Years"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == ct)
{
cout<<endl;
cout<<"type in your days value:";
cin>>mt;
cout<<endl;
cout<<(mt * 24) * 60<<" Minutes"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == cta)
{
cout<<endl;
cout<<"type in your days value:";
cin>>mt;
cout<<endl;
cout<<(mt * 24)<<" Hours"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == ctb)
{
cout<<endl;
cout<<"type in your days value:";
cin>>mt;
cout<<endl;
cout<<(mt / 7)<<" Weeks"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == ctc)
{
cout<<endl;
cout<<"type in your days value:";
cin>>mt;
cout<<endl;
cout<<(mt / 7) / 4.3<<" Months"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == ctd)
{
cout<<endl;
cout<<"type in your days value:";
cin>>mt;
cout<<endl;
cout<<((mt / 7) / 4.3) / 12<<" Years"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == dt)
{
cout<<endl;
cout<<"type in your weeks value:";
cin>>mt;
cout<<endl;
cout<<((mt * 7) * 24) * 60<<" Minutes"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == dta)
{
cout<<endl;
cout<<"type in your weeks value:";
cin>>mt;
cout<<endl;
cout<<(mt * 7) * 24<<" Hours"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == dtb)
{
cout<<endl;
cout<<"type in your weeks value:";
cin>>mt;
cout<<endl;
cout<<(mt * 7)<<" Days"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == dtc)
{
cout<<endl;
cout<<"type in your weeks value:";
cin>>mt;
cout<<endl;
cout<<(mt / 4.3)<<" Months"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == dtd)
{
cout<<endl;
cout<<"type in your weeks value:";
cin>>mt;
cout<<endl;
cout<<(mt / 4.3) / 12<<" Years"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == et)
{
cout<<endl;
cout<<"type in your months value:";
cin>>mt;
cout<<endl;
cout<<(mt * 4.3 * 7 * 24 * 60)<<" Minutes"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == eta)
{
cout<<endl;
cout<<"type in your months value:";
cin>>mt;
cout<<endl;
cout<<(mt * 4.3 * 7 * 24)<<" Hours"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == etb)
{
cout<<endl;
cout<<"type in your months value:";
cin>>mt;
cout<<endl;
cout<<(mt * 4.3 * 7)<<" Days"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == etc)
{
cout<<endl;
cout<<"type in your months value:";
cin>>mt;
cout<<endl;
cout<<(mt * 4.3 * 7)<<" Weeks"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == etd)
{
cout<<endl;
cout<<"type in your months value:";
cin>>mt;
cout<<endl;
cout<<(mt / 7)<<" Years"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == ft)
{
cout<<endl;
cout<<"type in your years value:";
cin>>mt;
cout<<endl;
cout<<(mt * 12 * 4.3 * 7 * 24 * 60)<<" Minutes"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == fta)
{
cout<<endl;
cout<<"type in your years value:";
cin>>mt;
cout<<endl;
cout<<(mt * 12 * 4.3 * 7 * 24)<<" Hours"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == fta)
{
cout<<endl;
cout<<"type in your years value:";
cin>>mt;
cout<<endl;
cout<<(mt * 12 * 4.3 * 7)<<" Days"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == ftb)
{
cout<<endl;
cout<<"type in your years value:";
cin>>mt;
cout<<endl;
cout<<(mt * 12 * 4.3)<<" Weeks"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == ftc)
{
cout<<endl;
cout<<"type in your years value:";
cin>>mt;
cout<<endl;
cout<<(mt * 12)<<" Months"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
}
cout<<endl;
cout<<"Do another conversion - press 1"<<endl;
cout<<"Exit - Press 2"<<endl;
cin>>hh;
}
while(hh == 1);
}
//
class Small
{
public:
void white();
};
void Small::white()
{
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
}
class Read
{
public:
void helpsh();
};
void Read::helpsh()
{
cout<<endl;
cout<<"print - this will let the you input text and it will print this text in a comfortable reading format"<<endl;
cout<<endl;
cout<<"run_writer - this will launch the writer application"<<endl;
cout<<endl;
cout<<"run_calc - this will launch the calculator application"<<endl;
cout<<endl;
cout<<"run_calc.av - this will launch the average calculator application"<<endl;
cout<<endl;
cout<<"run_rand - this will launch the random number generator application"<<endl;
cout<<endl;
cout<<"run_grid - runs the table application, which lets you display numbers in a table format"<<endl;
cout<<endl;
cout<<"run_convert - opens the unit converter application"<<endl;
cout<<endl;
cout<<"run_speed - opens the speed calculator"<<endl;
cout<<endl;
cout<<"run_distance - this will launch the distance calculator"<<endl;
cout<<endl;
cout<<"version - this will present information about the version of this software"<<endl;
cout<<endl;
cout<<"clear - clears all the contents off the window"<<endl;
cout<<endl;
cout<<"help - defines all commands (how you got here)"<<endl;
}
class Math
{
private:
float aa, bb, cc, dd, ee;
public:
void Calc();
void Av();
void Rando();
void Ncell();
};
// NCELL DECRLARATION
void Math::Ncell()
{
int nap;
float na;
float nb;
float nc;
float nd;
float ne;
float nf;
float ng;
float nh;
float ni;
float nj;
float nk;
float nl;
float nm;
float nn;
float no;
float np;
float nq;
float nr;
float ns;
string ch;
int cy;
do
{
cout<<endl;
cout<<"============="<<endl;
cout<<"Number Grider"<<endl;
cout<<"============="<<endl;
cout<<endl;
cout<<"How many cells are you working with (max 20)"<<endl;
cin>>cy;
if(cy == 2)
{
cout<<"Enter cell 1:";
cin>>na;
cout<<"Enter cell 2:";
cin>>nb;
cout<<"------"<<"------"<<endl;
cout<<"|-"<<na<<"-|-"<<nb<<"-|"<<endl;
cout<<"------"<<"------"<<endl;
cin.get();
cin.get();
}
if(cy == 3)
{
cout<<"Enter cell 1:";
cin>>na;
cout<<endl;
cout<<"Enter cell 2:";
cin>>nb;
cout<<"Enter cell 3:";
cin>>nc;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<na<<"-|-"<<nb<<"-|-"<<nc<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cin.get();
cin.get();
}
if(cy == 4)
{
cout<<"Enter cell 1:";
cin>>na;
cout<<"Enter cell 2:";
cin>>nb;
cout<<endl;
cout<<"Enter cell 3:";
cin>>nc;
cout<<"Enter cell 4:";
cin>>nd;
cout<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<na<<"-|-"<<nb<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<endl;
cout<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<nc<<"-|-"<<nd<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<endl;
cin.get();
cin.get();
}
if(cy == 5)
{
cout<<"Enter cell 1:";
cin>>na;
cout<<endl;
cout<<"Enter cell 2:";
cin>>nb;
cout<<"Enter cell 3:";
cin>>nc;
cout<<endl;
cout<<"Enter cell 4:";
cin>>nd;
cout<<"Enter cell 5:";
cin>>ne;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<na<<"-|-"<<nb<<"-|-"<<nc<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<nd<<"-|-"<<ne<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<endl;
cin.get();
cin.get();
}
if(cy == 6)
{
cout<<"Enter cell 1:";
cin>>na;
cout<<"Enter cell 2:";
cin>>nb;
cout<<endl;
cout<<"Enter cell 3:";
cin>>nc;
cout<<"Enter cell 4:";
cin>>nd;
cout<<endl;
cout<<"Enter cell 5:";
cin>>ne;
cout<<"Enter cell 6:";
cin>>nf;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<na<<"-|-"<<nb<<"-|-"<<nc<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<nd<<"-|-"<<ne<<"-|-"<<nf<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cin.get();
cin.get();
}
if(cy == 7)
{
cout<<"Enter cell 1:";
cin>>na;
cout<<endl;
cout<<"Enter cell 2:";
cin>>nb;
cout<<"Enter cell 3:";
cin>>nc;
cout<<endl;
cout<<"Enter cell 4:";
cin>>nd;
cout<<"Enter cell 5:";
cin>>ne;
cout<<endl;
cout<<"Enter cell 6:";
cin>>nf;
cout<<"Enter cell 7:";
cin>>ng;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<na<<"-|-"<<nb<<"-|-"<<nc<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<nd<<"-|-"<<ne<<"-|-"<<nf<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"------"<<endl;
cout<<"|-"<<ng<<"-|"<<endl;
cout<<"------"<<endl;
cin.get();
cin.get();
}
if(cy == 8)
{
cout<<"Enter cell 1:";
cin>>na;
cout<<"Enter cell 2:";
cin>>nb;
cout<<endl;
cout<<"Enter cell 3:";
cin>>nc;
cout<<"Enter cell 4:";
cin>>nd;
cout<<endl;
cout<<"Enter cell 5:";
cin>>ne;
cout<<"Enter cell 6:";
cin>>nf;
cout<<endl;
cout<<"Enter cell 7:";
cin>>ng;
cout<<"Enter cell 8";
cin>>nh;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<na<<"-|-"<<nb<<"-|-"<<nc<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<nd<<"-|-"<<ne<<"-|-"<<nf<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"------"<<"------"<<endl;
cout<<"|-"<<ng<<"-|-"<<nh<<"-|"<<endl;
cout<<"------"<<"------"<<endl;
cin.get();
cin.get();
}
if(cy == 9)
{
cout<<"Enter cell 1:";
cin>>na;
cout<<"Enter cell 2:";
cin>>nb;
cout<<endl;
cout<<"Enter cell 3:";
cin>>nc;
cout<<"Enter cell 4:";
cin>>nd;
cout<<endl;
cout<<"Enter cell 5:";
cin>>ne;
cout<<"Enter cell 6:";
cin>>nf;
cout<<endl;
cout<<"Enter cell 7:";
cin>>ng;
cout<<"Enter cell 8:";
cin>>nh;
cout<<endl;
cout<<"Enter cell 9:";
cin>>ni;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<na<<"-|-"<<nb<<"-|-"<<nc<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<nd<<"-|-"<<ne<<"-|-"<<nf<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<ng<<"-|-"<<nh<<"-|-"<<ni<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cin.get();
cin.get();
}
if(cy == 10)
{
cout<<"Enter cell 1:";
cin>>na;
cout<<"Enter cell 2:";
cin>>nb;
cout<<endl;
cout<<"Enter cell 3:";
cin>>nc;
cout<<"Enter cell 4:";
cin>>nd;
cout<<endl;
cout<<"Enter cell 5:";
cin>>ne;
cout<<"Enter cell 6:";
cin>>nf;
cout<<endl;
cout<<"Enter cell 7:";
cin>>ng;
cout<<"Enter cell 8:";
cin>>nh;
cout<<endl;
cout<<"Enter cell 9:";
cin>>ni;
cout<<"Enter cell 10:";
cin>>nj;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<na<<"-|-"<<nb<<"-|-"<<nc<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<nd<<"-|-"<<ne<<"-|-"<<nf<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<ng<<"-|-"<<nh<<"-|-"<<ni<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"------"<<endl;
cout<<"|-"<<nj<<"-|"<<endl;
cout<<"------"<<endl;
cin.get();
cin.get();
}
if(cy == 11)
{
cout<<"Enter cell 1:";
cin>>na;
cout<<"Enter cell 2:";
cin>>nb;
cout<<endl;
cout<<"Enter cell 3:";
cin>>nc;
cout<<"Enter cell 4:";
cin>>nd;
cout<<endl;
cout<<"Enter cell 5:";
cin>>ne;
cout<<"Enter cell 6:";
cin>>nf;
cout<<endl;
cout<<"Enter cell 7:";
cin>>ng;
cout<<"Enter cell 8:";
cin>>nh;
cout<<endl;
cout<<"Enter cell 9:";
cin>>ni;
cout<<"Enter cell 10:";
cin>>nj;
cout<<endl;
cout<<"Enter cell 11:";
cin>>nk;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<na<<"-|-"<<nb<<"-|-"<<nc<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<nd<<"-|-"<<ne<<"-|-"<<nf<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<ng<<"-|-"<<nh<<"-|-"<<ni<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"------"<<"------"<<endl;
cout<<"|-"<<nj<<"-|-"<<nk<<"-|"<<endl;
cout<<"------"<<"------"<<endl;
cin.get();
cin.get();
}
if(cy == 12)
{
cout<<"Enter cell 1:";
cin>>na;
cout<<"Enter cell 2:";
cin>>nb;
cout<<endl;
cout<<"Enter cell 3:";
cin>>nc;
cout<<"Enter cell 4:";
cin>>nd;
cout<<endl;
cout<<"Enter cell 5:";
cin>>ne;
cout<<"Enter cell 6:";
cin>>nf;
cout<<endl;
cout<<"Enter cell 7:";
cin>>ng;
cout<<"Enter cell 8:";
cin>>nh;
cout<<endl;
cout<<"Enter cell 9:";
cin>>ni;
cout<<"Enter cell 10:";
cin>>nj;
cout<<endl;
cout<<"Enter cell 11:";
cin>>nk;
cout<<"Enter cell 12:";
cin>>nl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<na<<"-|-"<<nb<<"-|-"<<nc<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<nd<<"-|-"<<ne<<"-|-"<<nf<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<ng<<"-|-"<<nh<<"-|-"<<ni<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<nj<<"-|-"<<nk<<"-|-"<<nl<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cin.get();
cin.get();
}
if(cy == 13)
{
cout<<"Enter cell 1:";
cin>>na;
cout<<"Enter cell 2:";
cin>>nb;
cout<<endl;
cout<<"Enter cell 3:";
cin>>nc;
cout<<"Enter cell 4:";
cin>>nd;
cout<<endl;
cout<<"Enter cell 5:";
cin>>ne;
cout<<"Enter cell 6:";
cin>>nf;
cout<<endl;
cout<<"Enter cell 7:";
cin>>ng;
cout<<"Enter cell 8:";
cin>>nh;
cout<<endl;
cout<<"Enter cell 9:";
cin>>ni;
cout<<"Enter cell 10:";
cin>>nj;
cout<<"Enter cell 11:";
cin>>nk;
cout<<"Enter cell 12:";
cin>>nl;
cout<<"Enter cell 13:";
cin>>nm;
cout<<"------"<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<na<<"-|-"<<nb<<"-|-"<<nc<<"-"<<nm<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<nd<<"-|-"<<ne<<"-|-"<<nf<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<ng<<"-|-"<<nh<<"-|-"<<ni<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<nj<<"-|-"<<nk<<"-|-"<<nl<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cin.get();
cin.get();
}
if(cy == 14)
{
cout<<"Enter cell 1:";
cin>>na;
cout<<"Enter cell 2:";
cin>>nb;
cout<<endl;
cout<<"Enter cell 3:";
cin>>nc;
cout<<"Enter cell 4:";
cin>>nd;
cout<<endl;
cout<<"Enter cell 5:";
cin>>ne;
cout<<"Enter cell 6:";
cin>>nf;
cout<<endl;
cout<<"Enter cell 7:";
cin>>ng;
cout<<"Enter cell 8:";
cin>>nh;
cout<<endl;
cout<<"Enter cell 9:";
cin>>ni;
cout<<"Enter cell 10:";
cin>>nj;
cout<<"Enter cell 11:";
cin>>nk;
cout<<"Enter cell 12:";
cin>>nl;
cout<<"Enter cell 13:";
cin>>nm;
cout<<endl;
cout<<"Enter cell 14:";
cin>>nn;
cout<<"------"<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<na<<"-|-"<<nb<<"-|-"<<nc<<"-"<<ne<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<nf<<"-|-"<<ng<<"-|-"<<nh<<"-"<<ni<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<nj<<"-|-"<<nk<<"-|-"<<nl<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<nm<<"-|-"<<nn<<"-|-"<<no<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cin.get();
cin.get();
}
if(cy == 15)
{
cout<<"Enter cell 1:";
cin>>na;
cout<<"Enter cell 2:";
cin>>nb;
cout<<endl;
cout<<"Enter cell 3:";
cin>>nc;
cout<<"Enter cell 4:";
cin>>nd;
cout<<endl;
cout<<"Enter cell 5:";
cin>>ne;
cout<<"Enter cell 6:";
cin>>nf;
cout<<endl;
cout<<"Enter cell 7:";
cin>>ng;
cout<<"Enter cell 8:";
cin>>nh;
cout<<endl;
cout<<"Enter cell 9:";
cin>>ni;
cout<<"Enter cell 10:";
cin>>nj;
cout<<"Enter cell 11:";
cin>>nk;
cout<<"Enter cell 12:";
cin>>nl;
cout<<"Enter cell 13:";
cin>>nm;
cout<<endl;
cout<<"Enter cell 14:";
cin>>nn;
cout<<"Enter cell 15:";
cin>>no;
cout<<"------"<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<na<<"-|-"<<nb<<"-|-"<<nc<<"-"<<nd<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<ne<<"-|-"<<nf<<"-|-"<<ng<<"-"<<nh<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<ni<<"-|-"<<nj<<"-|-"<<nk<<"-"<<nl<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cout<<"|-"<<nm<<"-|-"<<nn<<"-|-"<<no<<"-|"<<endl;
cout<<"------"<<"------"<<"------"<<"------"<<endl;
cin.get();
cin.get();
}
cout<<endl;
cout<<"Make another grid - 1"<<endl;
cout<<"Exit - 2"<<endl;
cin>>nap;
}while(nap == 1);
}
// RANDOM NUMBER DECLARATION
void Math::Rando()
{
int xn;
do
{
int pi;
int phi;
int o;
int ii;
int ddd;
cout<<endl;
cout<<"======================="<<endl;
cout<<"Random Number Genorator"<<endl;
cout<<"======================="<<endl;
cout<<endl;
cout<<"|Custom - Press 1 | ";
cout<<"1 to 10 - Press 2 | ";
cout<<"1 to 50 - Press 3 | ";
cout<<"1 to 100 - Press 4|";
cin>>o;
cout<<endl;
cout<<"Amount of numbers (20 max):";
cin>>phi;
do
{
if(o == 1)
{
pi++;
cout<<endl;
cout<<"From 1 to : ";
cin>>ddd;
srand(time(0));
for(ii = 0; ii < 1; ii++)
{
if(phi == 1)
{
cout<<endl;
cout<<"Random Number: "<<rand()%ddd<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get();
cin.get();
}
if(phi == 2)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()%ddd<<", "<<rand()%ddd<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get();
cin.get();
}
if(phi == 3)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get();
cin.get();
}
if(phi == 4)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get();
cin.get();
}
if(phi == 5)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get();
cin.get();
}
if(phi == 6)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get();
cin.get();
}
if(phi == 7)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get();
cin.get();
}
if(phi == 8)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get();
cin.get();
}
if(phi == 9)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get();
cin.get();
}
if(phi == 10)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get();
cin.get();
}
if(phi == 11)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get();
cin.get();
}
if(phi == 12)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get();
cin.get();
}
if(phi == 13)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get();
cin.get();
}
if(phi == 14)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get();
cin.get();
}
if(phi == 15)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get();
cin.get();
}
if(phi == 16)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get();
cin.get();
}
if(phi == 17)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get();
cin.get();
}
if(phi == 18)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get();
cin.get();
}
if(phi == 19)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get();
cin.get();
}
if(phi == 20)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get();
cin.get();
}
}
}
}while(pi == phi);
if(o == 2)
{
do
{
if(o == 1)
{
pi++;
cout<<endl;
cout<<"From 1 to : ";
cin>>ddd;
srand(time(0));
for(ii = 0; ii < 1; ii++)
{
if(phi == 1)
{
cout<<endl;
cout<<"Random Number: "<<rand()%ddd<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get();
cin.get();
}
if(phi == 2)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()%ddd<<", "<<rand()%ddd<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get();
cin.get();
}
if(phi == 3)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get();
cin.get();
}
if(phi == 4)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get();
cin.get();
}
if(phi == 5)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get();
cin.get();
}
if(phi == 6)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get();
cin.get();
}
if(phi == 7)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get();
cin.get();
}
if(phi == 8)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get();
cin.get();
}
if(phi == 9)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get();
cin.get();
}
if(phi == 10)
{
cout<<endl;
cout<<"Random Numbers: "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<", "<<rand()%ddd<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cin.get();
cin
softwaretime 0 Newbie Poster
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
Nobody will read four thousand lines of unformatted code to tell you what you did wrong, but judging by the errors I'd wager that formatting it will highlight the error promptly and obviously.
phorce 131 Posting Whiz in Training Featured Poster
What the hell is this:
// new averaging system
float pp;
float x;
float xx;
float xxx;
float xxxx;
float xxxxx;
float xxxxxx;
float xxxxxxx;
float xxxxxxxx;
float xxxxxxxxx;
float xxxxxxxxxx;
float xxxxxxxxxxx;
float xxxxxxxxxxxx;
float xxxxxxxxxxxxx;
float xxxxxxxxxxxxxx;
float xxxxxxxxxxxxxxx;
float xxxxxxxxxxxxxxxx;
float xxxxxxxxxxxxxxxxx;
float xxxxxxxxxxxxxxxxxx;
float xxxxxxxxxxxxxxxxxxx;
float xxxxxxxxxxxxxxxxxxxx;
If that is the "new averaging system" then I would hate to see the old one!
spacebro 0 Newbie Poster
Ahem, what is that program supposed to be doing?
ravenous 266 Posting Pro in Training
You can't do this:
tmm += ("Minutes: " + tmm);
th += ("Hours: " + th);
tmm
is an int
. What would it mean to increment and int
with the sum of a character array and an int
?. There are probably a bunch of other things wrong with this code too, but this is the first thing that the compiler is complaing about in the messages you posted.
Ribalimies66 0 Newbie Poster
5/5 would laugh again
nnxbtz 0 Newbie Poster
Congrats, you made it on 4chan!
A word of advice: Scrap everything. Get a book about how to program, then start over.
You are a deafmute quadruple amputee when it comes to coding, giving you a crutch wont do any good.
Schol-R-LEA 1,446 Commie Mutant Traitor Featured Poster
OK, now that the necessary roughness is out of the way, we can actually begin helping you.
I do have to admit that this is terrible code, and most likely cannot be remediated; but it would be remiss of me not to point out why it is bad, or else the OP won't learn from the experience.
Aside from the formatting issues, the main problem is repetitiveness; you have cut and pasted the same basic code, with only a trivial addition made to it at each step, roughly 20 times, jut in one section of the code alone. This entirely black of code could be replaced with a single for()
loop about five lines long. Such repetition is found throughout the code, making it larger and harder to read across the baord.
Similarly, you have (as Phorce points out) created 20 variables with the name in the form x
{nth} for what would normally be a 20 element array. Not only is this an exceedly bad naming convention, it limits how you can use the values compared to the equivalent array. Equally atrocious is the use of the n
{letter} for what would again be a single 20-element array normally. In fact, the naming conventions use in the program are uniformly awful.
Still, as Deceptikon says, it is the completely lack of indentation that is really doing you in here, as it makes it well-nigh impossible to be certain how the braces match to each other. Even if one is disinclined to indent their code themselves, virtually any modern editor will support either auto-indent, or an block-indenting feature, and most provide both. If all else fails, you can use a stand-alone program such as program such as astyle, after the fact. Lack of indentation, and inconsistent indentation, are not excusable given the tools available today.
As for the specific error that is causing so much trouble, a quick run through AStyle does indeed show it clearly: you are failing to close the function dbase::todo()
around line 409
of the source code (line 430 in your post).
#include <iostream>
#include <string>
#include <fstream>
#include <ctime>
#include <sstream>
using namespace std;
class base
{
public:
virtual int prod(){return -1;}
virtual int todo(){return -1;}
virtual int calendar(){return -1;}
};
class dbase2:public base
{
public:
int calendar();
};
int dbase2::calendar()
{
int cme;
int cd;
string cdd;
int cw;
string cwd;
int cm;
string cmd;
int cy;
string cyd;
cout<<endl;
cout<<"========"<<endl;
cout<<"Calendar"<<endl;
cout<<"========"<<endl;
cout<<"---------------------------"<<endl;
cout<<"| View (1) | Settings (2) | "<<endl;
cout<<"---------------------------"<<endl;
cin>>cme;
// calendar display
switch(cd)
{
{case 1:cdd = "-1-"; break;}
}
cout<<"|"<<cdd<<"|"<<endl;
// calendar display
}
class dbase:public base
{
public:
int prod();
int todo();
};
int dbase::prod()
{
char nt[20];
string ntw;
int me;
char ma[5];
int cl;
string ys = "yes";
string dn;
string dp;
string de;
char mp[20];
string mpx;
string adx;
string dex;
string ntwx;
char mp1[20];
string rc;
string adr;
char lit[20];
char nf[20];
string fn;
string fnk;
string fnx;
char co[20];
string tf;
do
{
cout<<endl;
cout<<"========"<<endl;
cout<<"Contacts"<<endl;
cout<<"========"<<endl;
cout<<"--------------------------------------"<<endl;
cout<<"| Add Contact (1) | View Contact (2) | "<<endl;
cout<<"--------------------------------------"<<endl;
cin>>me;
if(me == 1)
{
cout<<"Enter any number (Reference number)"<<endl;
cin>>lit;
cout<<"Enter Name:";
getline(cin, dn);
getline(cin, dn);
cout<<endl;
cout<<"+ Add Phone Number? type 'yes' or 'no'"<<endl;
cin>>mp;
if(mp == ys)
{
cout<<"Phone Number:";
getline(cin, dp);
getline(cin, dp);
mpx += ("|Phone Number: " + dp);
}
else
{
dp = "";
}
cout<<endl;
cout<<"+ Add Address? type 'yes' or 'no'"<<endl;
cin>>ma;
if(ma == ys)
{
cout<<"Address:";
getline(cin, adr);
getline(cin, adr);
adx += ("|Address: " + adr);
}
else
{
adr = "";
}
cout<<endl;
cout<<"+ Add Email? type 'yes' or 'no'"<<endl;
cin>>mp1;
if(mp1 == ys)
{
cout<<"Email Address:";
getline(cin, de);
getline(cin, de);
dex += ("|Email: " + de);
}
else
{
de = "";
}
cout<<endl;
cout<<"+ Add Notes? type 'yes' or 'no'"<<endl;
cin>>nt;
if(nt == ys)
{
cout<<"Notes:";
getline(cin, ntw);
getline(cin, ntw);
ntwx += ("|Notes: " + ntw);
}
cout<<endl;
cout<<"+ Add Custom Field? type 'yes' or 'no'"<<endl;
cin>>nf;
if(nf == ys)
{
cout<<"Field Name:";
getline(cin, fn);
getline(cin, fn);
cout<<fn<<":";
getline(cin, fnk);
fnx += ("|" + fn + ": " + fnk);
}
// add ntw
rc += ("-" + dn + "-" + "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" + "|----------------------" + "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" + mpx + "" + "\t\t\t\t\t\t\t\t\t\t\t" + adx + "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" + dex + "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" + ntwx + "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" + fnx);
ofstream fileo (lit);
fileo<<rc;
}
if(me == 2)
{
cout<<endl;
cout<<"Enter reference number:";
cin>>co;
ifstream fileop(co);
if(! fileop.eof())
{
cout<<endl;
getline(fileop, tf);
cout<<endl;
cout<<"====================="<<endl;
cout<<tf<<endl;
cout<<"====================="<<endl;
cin.get();
cin.get();
}
}
cout<<endl;
cout<<"Back to menu - 1"<<endl;
cout<<"Exit - 2"<<endl;
cin>>cl;
}while(cl == 1);
}
int dbase::todo()
{
string yxa = "(Done)";
string svi;
int tpx;
int tkm;
int alt;
char it[20];
string done;
string jn;
int nj;
int tmm;
int th;
int tmh;
do
{
cout<<endl;
cout<<"==========="<<endl;
cout<<"Task Center"<<endl;
cout<<"==========="<<endl;
cout<<"----------------------"<<endl;
cout<<"| New (1) | View (2) | "<<endl;
cout<<"----------------------"<<endl;
cin>>tkm;
alt = tkm;
if(tkm == 1)
{
cout<<"Enter any number (task number)"<<endl;
cin>>it;
int imp;
string prt;
string ji;
string di;
string ni;
string all;
cout<<endl;
cout<<"Task Title:";
getline(cin, ji);
getline(cin, ji);
cout<<endl;
cout<<"Due:";
getline(cin, di);
cout<<endl;
cout<<"Notes:";
getline(cin, ni);
cout<<endl;
cout<<"Set Priority | 1 | 2 | 3 |"<<endl;
cin>>imp;
if(imp == 1)
{
prt = "Low";
}
if(imp == 2)
{
prt = "Medium";
}
if(imp == 3)
{
prt = "High";
}
all += ("-" + ji + "-" + "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" + "|----------------------" + "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" + "|Notes: " + ni + "" + "\t\t\t\t\t\t\t\t\t\t\t" + "|Due: " + di + "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" + "|Priority: " + prt + "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t");
ofstream file(it);
file<<all;
}
if(alt == 1)
{
string cht;
ifstream filest(it);
if(! filest.eof())
{
getline(filest, cht);
cout<<endl;
cout<<"==========================="<<endl;
cout<<cht<<endl;
cout<<"==========================="<<endl;
cin.get();
cin.get();
}
}
if(tkm == 2)
{
string chs;
char dm[20];
cout<<"Task number:";
cin>>dm;
ifstream files(dm);
if(! files.eof())
{
getline(files, chs);
cout<<"==========================="<<endl;
cout<<chs<<endl;
cout<<"==========================="<<endl;
cin.get();
cin.get();
if(chs == yxa)
{
cout<<"";
}
cout<<"- Mark as Done (1) - Set Task Time (2) -"<<endl;
cin>>nj;
if(nj == 1)
{
done = "(Done)";
jn = (done + chs);
ofstream dfile (dm);
dfile<<jn;
}
if(nj == 2)
{
// set time code
cout<<"Set how much time this task might take"<<endl;
cout<<"Minutes: "<<endl;
cin>>tmm;
cout<<"Hours: "<<endl;
cin>>th;
tmm += ("Minutes: " + tmm);
th += ("Hours: " + th);
tmh = (tmm + th);
}
cout<<endl;
cout<<"Back to menu - 1"<<endl;
cout<<"Exit - 2"<<endl;
cin>>tpx;
}while(tpx == 1);
}
class Time
{
public:
void Timer();
};
// COUNTDOWN TIMER
void Time::Timer()
{
unsigned int zxi;
do
{
unsigned int zt;
unsigned int xt;
unsigned int yt;
cout<<endl;
cout<<"==============="<<endl;
cout<<"Countdown Timer"<<endl;
cout<<"==============="<<endl;
cout<<endl;
cout<<"Time in minutes - 1"<<endl;
cout<<"Time in seconds - 2"<<endl;
cin>>yt;
if(yt == 1)
{
cout<<endl;
cout<<"Enter how many minutes to count down from:";
cin>>xt;
cout<<"-"<<xt<<"-";
cout<<flush;
for(xt >= 0; xt --;)
{
cout<<"-"<<xt<<"-";
sleep(60);
cout<<flush;
}
}
if(yt == 2)
{
cout<<endl;
cout<<"Enter how many seconds to count down from:";
cin>>zt;
cout<<"-"<<zt<<"-";
cout<<flush;
for(zt >= 0; zt--;)
{
cout<<"-"<<zt<<"-";
sleep(1);
cout<<flush;
}
}
cout<<endl;
cout<<"---"<<endl;
cout<<"End"<<endl;
cout<<"---"<<endl;
cout<<"(press enter)"<<endl;
cin.get();
cin.get();
cout<<"Start another countdown - 1"<<endl;
cout<<"Exit - 2"<<endl;
cin>>zxi;
}
while(zxi == 1);
}
class Sdt
{
public:
void Speed();
void Distance();
void Time();
};
void Sdt::Time()
{
float one;
float hr;
float hr1;
float mnt;
float scd;
float hr2;
float hr12;
float mnt2;
float scd2;
do
{
unsigned int ch;
cout<<endl;
cout<<"==============="<<endl;
cout<<"Time Calculator"<<endl;
cout<<"==============="<<endl;
cout<<endl;
cout<<"Hours - 1"<<endl;
cout<<"Hours(MPH) - 2"<<endl;
cout<<"Minutes - 3"<<endl;
cout<<"Seconds - 4"<<endl;
cin>>ch;
if(ch == 4)
{
cout<<"Enter the meters:";
cin>>scd;
cout<<"Enter speed meters/second:";
cin>>scd2;
cout<<endl;
cout<<(scd / scd2)<<" Seconds"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(ch == 3)
{
cout<<"Enter the meters:";
cin>>mnt;
cout<<"Enter speed meters/minute:";
cin>>mnt2;
cout<<endl;
cout<<(mnt / mnt2)<<" Minutes"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(ch == 2)
{
cout<<"Enter the meters:";
cin>>hr1;
cout<<"Enter speed MPH:";
cin>>hr12;
cout<<endl;
cout<<(hr1 / hr12)<<" Hours"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(ch == 1)
{
cout<<"Enter the kilometers:";
cin>>hr;
cout<<"Enter speed KM/H:";
cin>>hr2;
cout<<endl;
cout<<(hr / hr2)<<" Hours"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
cout<<endl;
cout<<"Do another convertion - 1"<<endl;
cout<<"Exit - 2"<<endl;
cin>>ch;
}while(one == 1);
}
// DISTANCE CALCULATOR
void Sdt::Distance()
{
int vp;
int xpi;
float ks;
float kt;
do
{
cout<<endl;
cout<<"==================="<<endl;
cout<<"Distance Calculator"<<endl;
cout<<"==================="<<endl;
cout<<endl;
cout<<"KM - 1"<<endl;
cout<<"Miles - 2"<<endl;
cout<<"Meters - 3"<<endl;
cin>>xpi;
if(xpi == 1)
{
cout<<endl;
cout<<"Enter the speed (KM/H):";
cin>>ks;
cout<<endl;
cout<<"Enter the minutes:";
cin>>kt;
kt = (kt / 60);
cout<<endl;
cout<<(ks * kt)<<" KM"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(xpi == 2)
{
cout<<endl;
cout<<"Enter the speed (MPH):";
cin>>ks;
cout<<endl;
cout<<"Enter the minutes:";
cin>>kt;
kt = (kt / 60);
cout<<endl;
cout<<(ks * kt)<<" Miles"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(xpi == 3)
{
cout<<endl;
cout<<"Enter the speed (Meters/Second):";
cin>>ks;
cout<<endl;
cout<<"Enter the minutes:";
cin>>kt;
kt = (kt * 60);
cout<<endl;
cout<<(ks * kt)<<" Meters"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
cout<<endl;
cout<<"Do another convertion - 1"<<endl;
cout<<"Exit - 2"<<endl;
cin>>vp;
}while(vp == 1);
}
// SPEED CALCULATOR
void Sdt::Speed()
{
float dx;
float tx;
int xp;
int lp;
do
{
cout<<endl;
cout<<"================"<<endl;
cout<<"Speed Calculator"<<endl;
cout<<"================"<<endl;
cout<<endl;
cout<<"M/S - 1"<<endl;
cout<<"KM/H - 2"<<endl;
cout<<"MPH - 3"<<endl;
cin>>xp;
if(xp == 1)
{
cout<<endl;
cout<<"Type in the meters:";
cin>>dx;
cout<<endl;
cout<<"Type in the seconds:";
cin>>tx;
cout<<endl;
cout<<(dx / tx)<<" M/S"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(xp == 2)
{
cout<<endl;
cout<<"Type in the kilometers:";
cin>>dx;
cout<<endl;
cout<<"Type in the mintues:";
cin>>tx;
tx = (tx / 60);
cout<<endl;
cout<<(dx / tx)<<" KM/H"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(xp == 3)
{
cout<<endl;
cout<<"Type in the miles:";
cin>>dx;
cout<<endl;
cout<<"Type in the mintues:";
cin>>tx;
tx = (tx / 60);
cout<<endl;
cout<<(dx / tx)<<" MPH"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
cout<<endl;
cout<<"Do another conversion - 1"<<endl;
cout<<"Exit - 2"<<endl;
cin>>lp;
}while(lp == 1);
}
class Unit
{
public:
void Con();
};
void Unit::Con()
{
int hh;
do
{
int zx;
cout<<endl;
cout<<"=============="<<endl;
cout<<"Unit Converter"<<endl;
cout<<"=============="<<endl;
cout<<endl;
cout<<"Temperature - 1"<<endl;
cout<<"Length - 2"<<endl;
cout<<"Time - 3"<<endl;
cin>>zx;
if(zx == 1)
{
int v;
float vv;
cout<<endl;
cout<<"==================================================="<<endl;
cout<<"Celsius to Fahrenheit - 1"<<endl;
cout<<"Fahrenheit to Celsius - 2"<<endl;
cout<<endl;
cout<<"Celsius to Kelvin - 3"<<endl;
cout<<"Fahrenheit to Kelvin - 4"<<endl;
cout<<endl;
cout<<"Kelvin to Fahenheit - 5"<<endl;
cout<<"Kelvin to Celsius - 6"<<endl;
cout<<endl;
cin>>v;
if(v == 1)
{
cout<<"Type in your Celsius Value:";
cin>>vv;
cout<<endl;
cout<<(vv * 9/5 + 32)<<" Degrees Fahrenheit"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(v == 2)
{
cout<<"Type in your Fahrenheit Value:";
cin>>vv;
cout<<endl;
cout<<(vv - 32) * 5/9<<"Degrees Celsius"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(v == 3)
{
cout<<"Type in your Celsius Value:";
cin>>vv;
cout<<endl;
cout<<(vv + 273.15)<<" Kelvin"<<endl;
cin.get();
cin.get();
}
if(v == 4)
{
cout<<"Type in your Fahrenheit Value:";
cin>>vv;
cout<<endl;
cout<<((vv - 32) * 5/9 + 273.15)<<" Kelvin"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(v == 5)
{
cout<<"Type in your Kelvin Value:";
cin>>vv;
cout<<endl;
cout<<((vv - 273.15) * 9/5 + 32)<<" Degrees Fahrenheit"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(v == 6)
{
cout<<"Type in your Kelvin Value:";
cin>>vv;
cout<<endl;
cout<<(vv - 273.15)<<" Degrees Celsius"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
}
if(zx == 2)
{
string aa = "mm-m";
string ab = "mm-km";
string ac = "mm-ft";
string ad = "mm-inch";
string bb = "m-km";
string cc = "ft-inch";
string dd = "inch-ft";
string dda = "inch-m";
string ddb = "inch-mm";
string ee = "m-mm";
string ff = "km-m";
string gg = "ft-m";
string ga = "ft-km";
string hh = "m-ft";
string hha = "km-mm";
string ii = "inch-mm";
string ib = "m-ft";
string ic = "m-inch";
string mm = "km-mile";
string mma = "mile-km";
string mb = "m-mile";
string mba = "mile-m";
string mc = "ft-mile";
string mca = "mile-ft";
string xy;
float yy;
cout<<endl;
cout<<"==================================================="<<endl;
cout<<"Type in your length to convert from and to:"<<endl;
cout<<"(i.e. mm-m, ft-inch, km-mile)"<<endl;
cout<<endl;
cin>>xy;
// MM-M
if(xy == aa)
{
cout<<endl;
cout<<"Type in your millimetre value:";
cin>>yy;
cout<<(yy / 1000)<<" Meters"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// MM-KM
if(xy == ab)
{
cout<<endl;
cout<<"Type in your millimetre value:";
cin>>yy;
cout<<(yy / 1000 / 1000)<<" Kilometers"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// MM-FT
if(xy == ac)
{
cout<<endl;
cout<<"Type in your millimetre value:";
cin>>yy;
cout<<(yy * 0.03937) / 12<<" Feet"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// MM-INCH
if(xy == ad)
{
cout<<endl;
cout<<"Type in your millimetre value:";
cin>>yy;
cout<<(yy * 0.03937)<<" Inches"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// M-KM
if(xy == bb)
{
cout<<endl;
cout<<"Type in your metre value:";
cin>>yy;
cout<<(yy / 1000)<<" Kilometers"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// FT-INCH
if(xy == cc)
{
cout<<endl;
cout<<"Type in your Feet value:";
cin>>yy;
cout<<(yy * 12)<<" Inches"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// INCH-FT
if(xy == dd)
{
cout<<endl;
cout<<"Type in your Inch value:";
cin>>yy;
cout<<(yy / 12)<<" Feet"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(xy == dda)
{
cout<<endl;
cout<<"Type in your Inch value:";
cin>>yy;
cout<<(yy * 0.3048) / 12<<" Meters"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// M-MM
if(xy == ee)
{
cout<<endl;
cout<<"Type in your Meter value:";
cin>>yy;
cout<<(yy * 1000)<<" Millimeters"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// KM-M
if(xy == ff)
{
cout<<endl;
cout<<"Type in your Kilometer value:";
cin>>yy;
cout<<(yy * 1000)<<" Meters"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// FT-MM
if(xy == gg)
{
cout<<endl;
cout<<"Type in your Feet value:";
cin>>yy;
cout<<(yy * 0.3048)<<" Meters"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(xy == ga)
{
cout<<endl;
cout<<"Type in your Feet value:";
cin>>yy;
cout<<(yy * 0.0003048)<<" Kilometers"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// KM-MM
if(xy == hha)
{
cout<<endl;
cout<<"Type in your kilometer value:";
cin>>yy;
cout<<(yy * 1000 * 1000)<<" Millimeters"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// INCH-MM
if(xy == ii)
{
cout<<endl;
cout<<"Type in your inch value:";
cin>>yy;
cout<<(yy / 0.03937)<<" Millimeters"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// MM-FT
if(xy == ib)
{
cout<<endl;
cout<<"Type in your Meter value:";
cin>>yy;
cout<<((yy * 39.37) / 12)<<" Feet"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// MM-INCH
if(xy == ic)
{
cout<<endl;
cout<<"Type in your Meter value:";
cin>>yy;
cout<<(yy * 39.37)<<" Inches"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// KM-Miles
if(xy == mm)
{
cout<<endl;
cout<<"Type in your Kilometer value:";
cin>>yy;
cout<<(yy * 0.6214)<<" Miles"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// MILE-KM
if(xy == mma)
{
cout<<endl;
cout<<"Type in your Mile value:";
cin>>yy;
cout<<(yy * 1.609)<<" Kilometers"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// M-MILE
if(xy == mb)
{
cout<<endl;
cout<<"Type in your Meter value:";
cin>>yy;
cout<<(yy * 0.0006214)<<" Miles"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
}
// TIME CONVERTER
if(zx == 3)
{
string at = "mins-hours";
string ata = "mins-days";
string atb = "mins-weeks";
string atc = "mins-months";
string atd = "mins-years";
string bt = "hours-mins";
string bta = "hours-days";
string btb = "hours-weeks";
string btc = "hours-months";
string btd = "hours-years";
string ct = "days-mins";
string cta = "days-hours";
string ctb = "days-weeks";
string ctc = "days-months";
string ctd = "days-years";
string dt = "weeks-mins";
string dta = "weeks-hours";
string dtb = "weeks-days";
string dtc = "weeks-months";
string dtd = "weeks-years";
string et = "months-mins";
string eta = "months-hours";
string etb = "months-days";
string etc = "months-weeks";
string etd = "months-years";
string ft = "years-mins";
string fta = "years-hours";
string ftb = "years-days";
string ftc = "years-weeks";
string ftd = "years-months";
string coni;
float mt;
cout<<endl;
cout<<"Type in your time to convert from and to:"<<endl;
cout<<"(i.e. mins-hours, months-weeks, days-years)"<<endl;
cin>>coni;
if(coni == at)
{
cout<<endl;
cout<<"type in your minute value:";
cin>>mt;
cout<<endl;
cout<<(mt / 60)<<" Hours"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == ata)
{
cout<<endl;
cout<<"type in your minute value:";
cin>>mt;
cout<<endl;
cout<<(mt / 60) / 24<<" Days"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == atb)
{
cout<<endl;
cout<<"type in your minute value:";
cin>>mt;
cout<<endl;
cout<<((mt / 60) / 24) / 7<<" Weeks"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == atc)
{
cout<<endl;
cout<<"type in your minute value:";
cin>>mt;
cout<<endl;
cout<<(((mt / 60) / 24) / 7) / 4.3<<" Months"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == atd)
{
cout<<endl;
cout<<"type in your minute value:";
cin>>mt;
cout<<endl;
cout<<((((mt / 60) / 24) / 7) / 4.3) / 12<<" Years"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == bt)
{
cout<<endl;
cout<<"type in your hours value:";
cin>>mt;
cout<<endl;
cout<<(mt * 60)<<" Minutes"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == bta)
{
cout<<endl;
cout<<"type in your hours value:";
cin>>mt;
cout<<endl;
cout<<(mt / 24)<<" Days"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == btb)
{
cout<<endl;
cout<<"type in your hours value:";
cin>>mt;
cout<<endl;
cout<<(mt / 24) / 7<<" Weeks"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == btc)
{
cout<<endl;
cout<<"type in your hours value:";
cin>>mt;
cout<<endl;
cout<<((mt / 24) / 7) / 4.3<<" Months"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == btd)
{
cout<<endl;
cout<<"type in your hours value:";
cin>>mt;
cout<<endl;
cout<<(((mt / 24) / 7) / 4.3) / 12<<" Years"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == ct)
{
cout<<endl;
cout<<"type in your days value:";
cin>>mt;
cout<<endl;
cout<<(mt * 24) * 60<<" Minutes"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == cta)
{
cout<<endl;
cout<<"type in your days value:";
cin>>mt;
cout<<endl;
cout<<(mt * 24)<<" Hours"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == ctb)
{
cout<<endl;
cout<<"type in your days value:";
cin>>mt;
cout<<endl;
cout<<(mt / 7)<<" Weeks"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == ctc)
{
cout<<endl;
cout<<"type in your days value:";
cin>>mt;
cout<<endl;
cout<<(mt / 7) / 4.3<<" Months"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == ctd)
{
cout<<endl;
cout<<"type in your days value:";
cin>>mt;
cout<<endl;
cout<<((mt / 7) / 4.3) / 12<<" Years"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == dt)
{
cout<<endl;
cout<<"type in your weeks value:";
cin>>mt;
cout<<endl;
cout<<((mt * 7) * 24) * 60<<" Minutes"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == dta)
{
cout<<endl;
cout<<"type in your weeks value:";
cin>>mt;
cout<<endl;
cout<<(mt * 7) * 24<<" Hours"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == dtb)
{
cout<<endl;
cout<<"type in your weeks value:";
cin>>mt;
cout<<endl;
cout<<(mt * 7)<<" Days"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == dtc)
{
cout<<endl;
cout<<"type in your weeks value:";
cin>>mt;
cout<<endl;
cout<<(mt / 4.3)<<" Months"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == dtd)
{
cout<<endl;
cout<<"type in your weeks value:";
cin>>mt;
cout<<endl;
cout<<(mt / 4.3) / 12<<" Years"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == et)
{
cout<<endl;
cout<<"type in your months value:";
cin>>mt;
cout<<endl;
cout<<(mt * 4.3 * 7 * 24 * 60)<<" Minutes"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == eta)
{
cout<<endl;
cout<<"type in your months value:";
cin>>mt;
cout<<endl;
cout<<(mt * 4.3 * 7 * 24)<<" Hours"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == etb)
{
cout<<endl;
cout<<"type in your months value:";
cin>>mt;
cout<<endl;
cout<<(mt * 4.3 * 7)<<" Days"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == etc)
{
cout<<endl;
cout<<"type in your months value:";
cin>>mt;
cout<<endl;
cout<<(mt * 4.3 * 7)<<" Weeks"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(coni == etd)
{
cout<<endl;
cout<<"type in your months value:";
cin>>mt;
cout<<endl;
cout<<(mt / 7)<<" Years"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
#include <iostream>
#include <string>
#include <fstream>
#include <ctime>
#include <sstream>
using namespace std;
class base
{
public:
virtual int prod(){return -1;}
virtual int todo(){return -1;}
virtual int calendar(){return -1;}
};
class dbase2:public base
{
public:
int calendar();
};
int dbase2::calendar()
{
int cme;
int cd;
string cdd;
int cw;
string cwd;
int cm;
string cmd;
int cy;
string cyd;
cout<<endl;
cout<<"========"<<endl;
cout<<"Calendar"<<endl;
cout<<"========"<<endl;
cout<<"---------------------------"<<endl;
cout<<"| View (1) | Settings (2) | "<<endl;
cout<<"---------------------------"<<endl;
cin>>cme;
// calendar display
switch(cd)
{
{case 1:cdd = "-1-"; break;}
}
cout<<"|"<<cdd<<"|"<<endl;
// calendar display
}
class dbase:public base
{
public:
int prod();
int todo();
};
int dbase::prod()
{
char nt[20];
string ntw;
int me;
char ma[5];
int cl;
string ys = "yes";
string dn;
string dp;
string de;
char mp[20];
string mpx;
string adx;
string dex;
string ntwx;
char mp1[20];
string rc;
string adr;
char lit[20];
char nf[20];
string fn;
string fnk;
string fnx;
char co[20];
string tf;
do
{
cout<<endl;
cout<<"========"<<endl;
cout<<"Contacts"<<endl;
cout<<"========"<<endl;
cout<<"--------------------------------------"<<endl;
cout<<"| Add Contact (1) | View Contact (2) | "<<endl;
cout<<"--------------------------------------"<<endl;
cin>>me;
if(me == 1)
{
cout<<"Enter any number (Reference number)"<<endl;
cin>>lit;
cout<<"Enter Name:";
getline(cin, dn);
getline(cin, dn);
cout<<endl;
cout<<"+ Add Phone Number? type 'yes' or 'no'"<<endl;
cin>>mp;
if(mp == ys)
{
cout<<"Phone Number:";
getline(cin, dp);
getline(cin, dp);
mpx += ("|Phone Number: " + dp);
}
else
{
dp = "";
}
cout<<endl;
cout<<"+ Add Address? type 'yes' or 'no'"<<endl;
cin>>ma;
if(ma == ys)
{
cout<<"Address:";
getline(cin, adr);
getline(cin, adr);
adx += ("|Address: " + adr);
}
else
{
adr = "";
}
cout<<endl;
cout<<"+ Add Email? type 'yes' or 'no'"<<endl;
cin>>mp1;
if(mp1 == ys)
{
cout<<"Email Address:";
getline(cin, de);
getline(cin, de);
dex += ("|Email: " + de);
}
else
{
de = "";
}
cout<<endl;
cout<<"+ Add Notes? type 'yes' or 'no'"<<endl;
cin>>nt;
if(nt == ys)
{
cout<<"Notes:";
getline(cin, ntw);
getline(cin, ntw);
ntwx += ("|Notes: " + ntw);
}
cout<<endl;
cout<<"+ Add Custom Field? type 'yes' or 'no'"<<endl;
cin>>nf;
if(nf == ys)
{
cout<<"Field Name:";
getline(cin, fn);
getline(cin, fn);
cout<<fn<<":";
getline(cin, fnk);
fnx += ("|" + fn + ": " + fnk);
}
// add ntw
rc += ("-" + dn + "-" + "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" + "|----------------------" + "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" + mpx + "" + "\t\t\t\t\t\t\t\t\t\t\t" + adx + "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" + dex + "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" + ntwx + "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" + fnx);
ofstream fileo (lit);
fileo<<rc;
}
if(me == 2)
{
cout<<endl;
cout<<"Enter reference number:";
cin>>co;
ifstream fileop(co);
if(! fileop.eof())
{
cout<<endl;
getline(fileop, tf);
cout<<endl;
cout<<"====================="<<endl;
cout<<tf<<endl;
cout<<"====================="<<endl;
cin.get();
cin.get();
}
}
cout<<endl;
cout<<"Back to menu - 1"<<endl;
cout<<"Exit - 2"<<endl;
cin>>cl;
}while(cl == 1);
}
int dbase::todo()
{
string yxa = "(Done)";
string svi;
int tpx;
int tkm;
int alt;
char it[20];
string done;
string jn;
int nj;
int tmm;
int th;
int tmh;
do
{
cout<<endl;
cout<<"==========="<<endl;
cout<<"Task Center"<<endl;
cout<<"==========="<<endl;
cout<<"----------------------"<<endl;
cout<<"| New (1) | View (2) | "<<endl;
cout<<"----------------------"<<endl;
cin>>tkm;
alt = tkm;
if(tkm == 1)
{
cout<<"Enter any number (task number)"<<endl;
cin>>it;
int imp;
string prt;
string ji;
string di;
string ni;
string all;
cout<<endl;
cout<<"Task Title:";
getline(cin, ji);
getline(cin, ji);
cout<<endl;
cout<<"Due:";
getline(cin, di);
cout<<endl;
cout<<"Notes:";
getline(cin, ni);
cout<<endl;
cout<<"Set Priority | 1 | 2 | 3 |"<<endl;
cin>>imp;
if(imp == 1)
{
prt = "Low";
}
if(imp == 2)
{
prt = "Medium";
}
if(imp == 3)
{
prt = "High";
}
all += ("-" + ji + "-" + "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" + "|----------------------" + "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" + "|Notes: " + ni + "" + "\t\t\t\t\t\t\t\t\t\t\t" + "|Due: " + di + "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" + "|Priority: " + prt + "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t");
ofstream file(it);
file<<all;
}
if(alt == 1)
{
string cht;
ifstream filest(it);
if(! filest.eof())
{
getline(filest, cht);
cout<<endl;
cout<<"==========================="<<endl;
cout<<cht<<endl;
cout<<"==========================="<<endl;
cin.get();
cin.get();
}
}
if(tkm == 2)
{
string chs;
char dm[20];
cout<<"Task number:";
cin>>dm;
ifstream files(dm);
if(! files.eof())
{
getline(files, chs);
cout<<"==========================="<<endl;
cout<<chs<<endl;
cout<<"==========================="<<endl;
cin.get();
cin.get();
if(chs == yxa)
{
cout<<"";
}
cout<<"- Mark as Done (1) - Set Task Time (2) -"<<endl;
cin>>nj;
if(nj == 1)
{
done = "(Done)";
jn = (done + chs);
ofstream dfile (dm);
dfile<<jn;
}
if(nj == 2)
{
// set time code
cout<<"Set how much time this task might take"<<endl;
cout<<"Minutes: "<<endl;
cin>>tmm;
cout<<"Hours: "<<endl;
cin>>th;
tmm += ("Minutes: " + tmm);
th += ("Hours: " + th);
tmh = (tmm + th);
}
cout<<endl;
cout<<"Back to menu - 1"<<endl;
cout<<"Exit - 2"<<endl;
cin>>tpx;
}while(tpx == 1);
}
class Time
{
public:
void Timer();
};
// COUNTDOWN TIMER
void Time::Timer()
{
unsigned int zxi;
do
{
unsigned int zt;
unsigned int xt;
unsigned int yt;
cout<<endl;
cout<<"==============="<<endl;
cout<<"Countdown Timer"<<endl;
cout<<"==============="<<endl;
cout<<endl;
cout<<"Time in minutes - 1"<<endl;
cout<<"Time in seconds - 2"<<endl;
cin>>yt;
if(yt == 1)
{
cout<<endl;
cout<<"Enter how many minutes to count down from:";
cin>>xt;
cout<<"-"<<xt<<"-";
cout<<flush;
for(xt >= 0; xt --;)
{
cout<<"-"<<xt<<"-";
sleep(60);
cout<<flush;
}
}
if(yt == 2)
{
cout<<endl;
cout<<"Enter how many seconds to count down from:";
cin>>zt;
cout<<"-"<<zt<<"-";
cout<<flush;
for(zt >= 0; zt--;)
{
cout<<"-"<<zt<<"-";
sleep(1);
cout<<flush;
}
}
cout<<endl;
cout<<"---"<<endl;
cout<<"End"<<endl;
cout<<"---"<<endl;
cout<<"(press enter)"<<endl;
cin.get();
cin.get();
cout<<"Start another countdown - 1"<<endl;
cout<<"Exit - 2"<<endl;
cin>>zxi;
}
while(zxi == 1);
}
class Sdt
{
public:
void Speed();
void Distance();
void Time();
};
void Sdt::Time()
{
float one;
float hr;
float hr1;
float mnt;
float scd;
float hr2;
float hr12;
float mnt2;
float scd2;
do
{
unsigned int ch;
cout<<endl;
cout<<"==============="<<endl;
cout<<"Time Calculator"<<endl;
cout<<"==============="<<endl;
cout<<endl;
cout<<"Hours - 1"<<endl;
cout<<"Hours(MPH) - 2"<<endl;
cout<<"Minutes - 3"<<endl;
cout<<"Seconds - 4"<<endl;
cin>>ch;
if(ch == 4)
{
cout<<"Enter the meters:";
cin>>scd;
cout<<"Enter speed meters/second:";
cin>>scd2;
cout<<endl;
cout<<(scd / scd2)<<" Seconds"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(ch == 3)
{
cout<<"Enter the meters:";
cin>>mnt;
cout<<"Enter speed meters/minute:";
cin>>mnt2;
cout<<endl;
cout<<(mnt / mnt2)<<" Minutes"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(ch == 2)
{
cout<<"Enter the meters:";
cin>>hr1;
cout<<"Enter speed MPH:";
cin>>hr12;
cout<<endl;
cout<<(hr1 / hr12)<<" Hours"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(ch == 1)
{
cout<<"Enter the kilometers:";
cin>>hr;
cout<<"Enter speed KM/H:";
cin>>hr2;
cout<<endl;
cout<<(hr / hr2)<<" Hours"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
cout<<endl;
cout<<"Do another convertion - 1"<<endl;
cout<<"Exit - 2"<<endl;
cin>>ch;
}while(one == 1);
}
// DISTANCE CALCULATOR
void Sdt::Distance()
{
int vp;
int xpi;
float ks;
float kt;
do
{
cout<<endl;
cout<<"==================="<<endl;
cout<<"Distance Calculator"<<endl;
cout<<"==================="<<endl;
cout<<endl;
cout<<"KM - 1"<<endl;
cout<<"Miles - 2"<<endl;
cout<<"Meters - 3"<<endl;
cin>>xpi;
if(xpi == 1)
{
cout<<endl;
cout<<"Enter the speed (KM/H):";
cin>>ks;
cout<<endl;
cout<<"Enter the minutes:";
cin>>kt;
kt = (kt / 60);
cout<<endl;
cout<<(ks * kt)<<" KM"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(xpi == 2)
{
cout<<endl;
cout<<"Enter the speed (MPH):";
cin>>ks;
cout<<endl;
cout<<"Enter the minutes:";
cin>>kt;
kt = (kt / 60);
cout<<endl;
cout<<(ks * kt)<<" Miles"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(xpi == 3)
{
cout<<endl;
cout<<"Enter the speed (Meters/Second):";
cin>>ks;
cout<<endl;
cout<<"Enter the minutes:";
cin>>kt;
kt = (kt * 60);
cout<<endl;
cout<<(ks * kt)<<" Meters"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
cout<<endl;
cout<<"Do another convertion - 1"<<endl;
cout<<"Exit - 2"<<endl;
cin>>vp;
}while(vp == 1);
}
// SPEED CALCULATOR
void Sdt::Speed()
{
float dx;
float tx;
int xp;
int lp;
do
{
cout<<endl;
cout<<"================"<<endl;
cout<<"Speed Calculator"<<endl;
cout<<"================"<<endl;
cout<<endl;
cout<<"M/S - 1"<<endl;
cout<<"KM/H - 2"<<endl;
cout<<"MPH - 3"<<endl;
cin>>xp;
if(xp == 1)
{
cout<<endl;
cout<<"Type in the meters:";
cin>>dx;
cout<<endl;
cout<<"Type in the seconds:";
cin>>tx;
cout<<endl;
cout<<(dx / tx)<<" M/S"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(xp == 2)
{
cout<<endl;
cout<<"Type in the kilometers:";
cin>>dx;
cout<<endl;
cout<<"Type in the mintues:";
cin>>tx;
tx = (tx / 60);
cout<<endl;
cout<<(dx / tx)<<" KM/H"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(xp == 3)
{
cout<<endl;
cout<<"Type in the miles:";
cin>>dx;
cout<<endl;
cout<<"Type in the mintues:";
cin>>tx;
tx = (tx / 60);
cout<<endl;
cout<<(dx / tx)<<" MPH"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
cout<<endl;
cout<<"Do another conversion - 1"<<endl;
cout<<"Exit - 2"<<endl;
cin>>lp;
}while(lp == 1);
}
class Unit
{
public:
void Con();
};
void Unit::Con()
{
int hh;
do
{
int zx;
cout<<endl;
cout<<"=============="<<endl;
cout<<"Unit Converter"<<endl;
cout<<"=============="<<endl;
cout<<endl;
cout<<"Temperature - 1"<<endl;
cout<<"Length - 2"<<endl;
cout<<"Time - 3"<<endl;
cin>>zx;
if(zx == 1)
{
int v;
float vv;
cout<<endl;
cout<<"==================================================="<<endl;
cout<<"Celsius to Fahrenheit - 1"<<endl;
cout<<"Fahrenheit to Celsius - 2"<<endl;
cout<<endl;
cout<<"Celsius to Kelvin - 3"<<endl;
cout<<"Fahrenheit to Kelvin - 4"<<endl;
cout<<endl;
cout<<"Kelvin to Fahenheit - 5"<<endl;
cout<<"Kelvin to Celsius - 6"<<endl;
cout<<endl;
cin>>v;
if(v == 1)
{
cout<<"Type in your Celsius Value:";
cin>>vv;
cout<<endl;
cout<<(vv * 9/5 + 32)<<" Degrees Fahrenheit"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(v == 2)
{
cout<<"Type in your Fahrenheit Value:";
cin>>vv;
cout<<endl;
cout<<(vv - 32) * 5/9<<"Degrees Celsius"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(v == 3)
{
cout<<"Type in your Celsius Value:";
cin>>vv;
cout<<endl;
cout<<(vv + 273.15)<<" Kelvin"<<endl;
cin.get();
cin.get();
}
if(v == 4)
{
cout<<"Type in your Fahrenheit Value:";
cin>>vv;
cout<<endl;
cout<<((vv - 32) * 5/9 + 273.15)<<" Kelvin"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(v == 5)
{
cout<<"Type in your Kelvin Value:";
cin>>vv;
cout<<endl;
cout<<((vv - 273.15) * 9/5 + 32)<<" Degrees Fahrenheit"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
if(v == 6)
{
cout<<"Type in your Kelvin Value:";
cin>>vv;
cout<<endl;
cout<<(vv - 273.15)<<" Degrees Celsius"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
}
if(zx == 2)
{
string aa = "mm-m";
string ab = "mm-km";
string ac = "mm-ft";
string ad = "mm-inch";
string bb = "m-km";
string cc = "ft-inch";
string dd = "inch-ft";
string dda = "inch-m";
string ddb = "inch-mm";
string ee = "m-mm";
string ff = "km-m";
string gg = "ft-m";
string ga = "ft-km";
string hh = "m-ft";
string hha = "km-mm";
string ii = "inch-mm";
string ib = "m-ft";
string ic = "m-inch";
string mm = "km-mile";
string mma = "mile-km";
string mb = "m-mile";
string mba = "mile-m";
string mc = "ft-mile";
string mca = "mile-ft";
string xy;
float yy;
cout<<endl;
cout<<"==================================================="<<endl;
cout<<"Type in your length to convert from and to:"<<endl;
cout<<"(i.e. mm-m, ft-inch, km-mile)"<<endl;
cout<<endl;
cin>>xy;
// MM-M
if(xy == aa)
{
cout<<endl;
cout<<"Type in your millimetre value:";
cin>>yy;
cout<<(yy / 1000)<<" Meters"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// MM-KM
if(xy == ab)
{
cout<<endl;
cout<<"Type in your millimetre value:";
cin>>yy;
cout<<(yy / 1000 / 1000)<<" Kilometers"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// MM-FT
if(xy == ac)
{
cout<<endl;
cout<<"Type in your millimetre value:";
cin>>yy;
cout<<(yy * 0.03937) / 12<<" Feet"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// MM-INCH
if(xy == ad)
{
cout<<endl;
cout<<"Type in your millimetre value:";
cin>>yy;
cout<<(yy * 0.03937)<<" Inches"<<endl;
cout<<"---------------------------------"<<endl;
cin.get();
cin.get();
}
// M-KM
if(xy == bb)
{
cout<<endl;
cout<<"Type in your metre value:";
cin>>yy;
cout<<(yy / 1000)<<" Kilometers"<<endl;
cout<<"--------------------------
Edited by Schol-R-LEA
Nick Evan commented: I've gotta give you credtis for trying to wade through this.. +14
phorce commented: Was there any need to re-post the whole code again? Even if you did fix it! Sorry but, from the previous posts and the fact the o/p hasn't replied to any comments, I think you just might have wasted your time. +6
phorce 131 Posting Whiz in Training Featured Poster
So i'm confused.. Is this a troll post?
Schol-R-LEA 1,446 Commie Mutant Traitor Featured Poster
(duplicate post removed)
Edited by Schol-R-LEA
BEArbiter 0 Newbie Poster
here a super new avg system
void avg(){
int numVal;
cout<<"how many values are you averaging?"<<endl;
cin>>numVal;
float avg = 0;
for(int i = 0; i < numVal;i++){
float tmp;
cout << "enter the value number "<< i << ": ";
cin >> tmp;
avg += tmp;
}
avg /= numVal;
cout << "Average :" << avg << endl;
}
Listen, in order to make big programs like this, you should first learn the basics. It's the first time I see someone who didn't use a vector to store multiple data and also code everything without loop ><.
Also, don't make one huge file of four thousand lines, make several smaller file, and think about the reusability of the code. the AVG function will obviously be usefull later. why not make a file that containt usefull math fuctions?
Edited by BEArbiter
ndeniche 402 Posting Virtuoso Featured Poster
My favorite part is the
x
xx
xxx
xxxx
xxxxx
xxxxxx
xxxxxxx
xxxxxxxx
xxxxxxxxx
xxxxxxxxxx
Thank you OP
frank.dekievit.50 0 Newbie Poster
Assuming you actually want an answer: On line 279 you set tx to be an int.
On line 417 you try to add a string to an int. That's not possible.
The debugger already said so, listen to him! :)
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.