I'm having trouble passing values from the first function to the second without program terminating at calculating, this my my code so far.
#include<iostream>
#include<iomanip>
#include<functional>
using namespace std;
int main()
{
double calcCom();
double salesmanID,baseSalary,baseSales;
double personalcomp,printers,access,maint;
cout<<"Please enter a salesman ID Number"<<endl;
cin>>salesmanID;
cout<<"Please enter a base salary"<<endl;
cin>>baseSalary;
cout<<"Please enter a sales amount for each catergory"<<endl;
#include<iostream>
#include<iomanip>
#include<functional>
/* Don't use using namespace keywords, all you are doing is
putting everything in the std scope. Qualify your variables correctly:
std::cout, std::cin, std::endl, std::string, etc */
usingnamespace std;
int main()
{ // I also suggest you use identation, it is easier to read your code that way
double calcCom(); /* I guess you are declaring a function's prototype here
maybe? Prototypes go outside the main function, right
where you placed the using namespace keywords */
// All this is OK so far
double salesmanID,baseSalary,baseSales;
double personalcomp,printers,access,maint;
cout<<"Please enter a salesman ID Number"<<endl;
cin>>salesmanID;
cout<<"Please enter a base salary"<<endl;
cin>>baseSalary;
cout<<"Please enter a sales amount for each catergory"<<endl;
cout<<"Personal Computers:"<<endl;
cin>>personalcomp;
cout<<"Printers:"<<endl;
cin>>printers;
cout<<"Accessories:"<<endl;
cin>>access;
cout<<"Maintenace:"<<endl;
cin>>maint;
cout<<"Calculating..."<<endl;
// Here you would place your calcCom() function
// main function would end here
/* From here on, you have WAY too many errors to point each one of them.
Follow bluecoder's suggestion and check the links I posted.
Another suggestion: be cleaner with your code! It will make it easier for
us and for yourself to find errors and understand the logic of your
program*/