C:\Users\admin\Desktop\C++\collect2.exe [Error] ld returned 1 exit status

Good evening! the error named"Id return exit status" keeps on showing. I don't know why

SOURCE CODE:

#include <iostream>
using namespace std;

const double LOW_MARKUP=0.05;
const double HIGH_MARKUP=0.10;
const int THRESHOLD=7;

void introduction();
void get_input(double& cost, int& turnover);
double price(double cost, int turnover);
void give_output(double cost, int turnover, double price);

int main()
{
double wholesale_cost, retail_price;
int shelf_time;

introduction();
get_input(wholesale_cost, shelf_time);
retail_price=price(wholesale_cost, shelf_time);
give_output(wholesale_cost, shelf_time, retail_price);
return 0;
}
void introduction()
{
using namespace std;
cout<<"This programdetrmines retail price for \n"
<<" an item at a Quick-Shop supermarket store. \n ";
}

void get_input(double& cost, int turnover)
{
using namespace std;
cout<<"Enter wholesale cost of an item: $";
cin>>cost;
cout<<"Enter the expected number of days until sold: ";
}
void get_output(double cost, int turnover, double price)
{
using namespace std;
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
cout<<"Wholesale cost= $"<<cost<<endl
<<"Expected time until sold= "
<<turnover<<"days"<<endl
<<"Retail price=$"<<price<<endl;
}
double price(double cost, int turnover)
{
if(turnover<=THRESHOLD)
return(cost+(LOW_MARKUP * cost));
else
return(cost+(HIGH_MARKUP * cost));
}
The rest of the ld error message would go a long way to helping you.

Here's a hint - make sure your types match.
void get_input(double& cost, int& turnover);
void get_input(double& cost, int turnover)



As would using code tags when you post code.
http://www.cplusplus.com/articles/jEywvCM9/
This compiles:

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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include <iostream>
using namespace std;

const double LOW_MARKUP = 0.05;
const double HIGH_MARKUP = 0.10;
const int THRESHOLD = 7;

void introduction();
void get_input(double& cost, int& turnover);
double price(double cost, int turnover);
void get_output(double cost, int turnover, double price);

int main()
{
	double wholesale_cost {}, retail_price {};
	int shelf_time {};

	introduction();
	get_input(wholesale_cost, shelf_time);
	retail_price = price(wholesale_cost, shelf_time);
	get_output(wholesale_cost, shelf_time, retail_price);
	return 0;
}

void introduction()
{
	cout << "This programdetrmines retail price for \n"
		<< " an item at a Quick-Shop supermarket store. \n ";
}

void get_input(double& cost, int& turnover)
{
	cout << "Enter wholesale cost of an item: $";
	cin >> cost;
	cout << "Enter the expected number of days until sold: ";
	cin >> turnover;
}

void get_output(double cost, int turnover, double price)
{
	cout.setf(ios::fixed);
	cout.setf(ios::showpoint);
	cout.precision(2);
	cout << "Wholesale cost= $" << cost << endl
		<< "Expected time until sold= "
		<< turnover << "days" << endl
		<< "Retail price=$" << price << endl;
}

double price(double cost, int turnover)
{
	if (turnover <= THRESHOLD)
		return(cost + (LOW_MARKUP * cost));
	else
		return(cost + (HIGH_MARKUP * cost));
}


thank you so much for helping me. I will remember to double-check so that my codes match!
Topic archived. No new replies allowed.