This program will calculate commision based on the value of sales made...
im getting three errors so far...
1>h:\cs110\assignment6\assignment6.cpp(22) : warning C4700: uninitialized local variable 'third' used
1>h:\cs110\assignment6\assignment6.cpp(22) : warning C4700: uninitialized local variable 'second' used
1>h:\cs110\assignment6\assignment6.cpp(22) : warning C4700: uninitialized local variable 'first' used.
I was reading some books and some webpages but could find a place to find the "easy" error as they called it :(
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
void salesValue(double dollars);
void commission (double dollars,double first,double second,double third);
void calculate (double dollars,double first,double second,double third);
//function prototypes
int main ()
{
double dollars;
double first;
double second;
double third;
cout<<"What is the sale value?"<<endl;
cin>>dollars;
commission (dollars, first, second, third);
salesValue (dollars);
calculate (dollars, first, second, third);
system("pause");
return 0;
}
void salesValue (double dollars)
{
cout<<"The sale value was"<<dollars<<endl;
}
void commission (double dollars,double first,double second,double third)
{
first=(dollars*0.02);
second=(dollars*0.03);
third=(dollars*0.05);
}
void calculate (double dollars,double first,double second,double third)
{
if (dollars < 1000)
cout<<first<<"Comission was 2% "<<endl;
else if (dollars > 1000 && dollars <=10000)
cout<<second<<"commission was 3%"<<endl;
else if (dollars >=10001)
cout<<third<<"commission was 5%"<<endl;
else if (dollars >= 50000)
cout<<"This store does not allow sells over 50000"<<endl;
else
cout<<"Wrong imput"<<endl;
}