Function definition errors?

This program calculates retail cost. I'm learning about function definitions, and my book says this is a way to do it, but once it's in my computer, VS says calculateRetail function was not found. Not sure what to do from here, it's from the book, are there just some wording errors?

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
#include "pch.h"
#include <iostream>
#include <iomanip>
using namespace std;

double calculateRetail(double cost, double percent);

double calculateRetail(double cost, double perc);
{
	double retailPr;

	retailPr = cost + ((cost*perc) / 100);
	return retailPr;
}

int main()
{
	double wholeCost, retailPr, markPerce;

	cout << "What is the wholesale cost?: ";
	cin >> wholeCost;

	cout << "What is the markup percentage?: ";
	cin >> markPerce;

	retailPr = calculateRetail(wholeCost, markPerce);

	cout << "The retail price is $" << retailPr << endl;

	system("pause");
	return 0;
}
Last edited on
Hi,

remove line 1.
remove the semicolon on line 8.

normally lines 8 to 14 would be put after main

Good Luck !!
Topic archived. No new replies allowed.