so i made this program with a function call and definition and i keep having problems with the call function and i get error C2059: syntax error : 'return' when i build my program.
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
int math (double cartons, double totalcost, double totalprofit, double milkprofit, double cost);
int main()
{
int math;
char cartons,totalcost,totalprofit,milkprofit,cost;
math= cartons + totalcost + totalprofit + milkprofit + cost;
return (0);
}
int math()
{
char ans = 'y';
bool quad_answer = false;
do
{
double LitersMilkProduce;
double cartons, totalcost, totalprofit, milkprofit, cost;
const double LITERCOST(0.37), CARTONPROFIT(0.27), LITERS_PER_CARTONS= (3.78);
cout << "Enter the total number of liters: ";
cin >> LitersMilkProduce;
cartons = LitersMilkProduce / LITERS_PER_CARTONS;
totalcost = LitersMilkProduce * LITERCOST;
totalprofit = LITERCOST * CARTONPROFIT;
cout << "The total number of liters = " << LitersMilkProduce << endl;
cout << fixed << showpoint<< setprecision(2) <<fixed << "Amount of cartons = " << cartons <<endl;
cout << "cost of milk is = ";
cin >> LitersMilkProduce ;
cost = LitersMilkProduce * LITERCOST;
cout << "profit from milk is =";
cin >> LitersMilkProduce;
milkprofit = LitersMilkProduce * CARTONPROFIT;
if (quad_answer) cout << endl;
cout << "Continue (y/n)? ";
cin >> ans;
while (ans == 'y');
}
return 0;
};