Sales with Bonus

Hello, I'm supposed to create a program with a getSales and calcBonus function with the bonus set to %10 but I keep getting an error that says Id returned 1 exit status.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
  #include <iostream>
#include <iomanip>
using namespace std;

double getSales();
void calcBonus(double sales, double bRate);

int main()
{
	double sales;
	double bonus;
	double bRate=.1;
	
	cout<<fixed<<setprecision(2);
	
	sales=getSales();
	calcBonus(sales, bRate);
	
	
	return 0;
}

double getSales()
{
	double sales;
	cout<<"Please enter the sales amount and I will calculate the bonus: ";
	cin>>sales;
	return sales;
}

void calcBonus(double sales,double bRate, double bonus)
{
	bonus=sales*bRate;
	cout<<"The bonus of the sales is: "<<bonus<<endl;
}
Last edited on
You want to look at your calcBonus function header. At top you declare it with two parameters than you define it with three below main. Start there.
Last edited on
Topic archived. No new replies allowed.