Having trouble with business plan

I'm getting a C4244 and C4700 problems with Lines 30 and 31.
I'm new at this and pulling my hair out.
I could really use some help please.

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
//Linda's new cosmetic and clothing business plan.

//The plan is to make a net profit of approximately 10%
//after paying all expenses, which include merchandise cost,
//store rent, employees' salary, and electricity cost for the store.

//Needs a markup but would like to put the item on sale for 15% off.

//Need to enter the the total cost of the merchandise, the salary of the employees,
//the yearly rent, and the estimated electricity costs.

//The program has to out put how much the merchandise should be marked up
//so that Linda gets the 10% profit.

#include <iostream>
#include <cmath>

using namespace std;

int main()
{
	double totalCost;
	double salary;
	double electric;
	double rent;

	int netprofit;
	int itemdiscount;

	netprofit = 0.010 * (totalCost + salary + electric + rent);
	itemdiscount = 0.015 * totalCost;

	cout << "Enter the total cost of the merchandise: " << endl;
	cin >> totalCost;

	cout << "Enter the salary of all employees: " << endl;
	cin >> salary;

	cout << "Enter the estimated electricity cost: " << endl;
	cin >> electric;

	cout << "Enter the yearly rent: " << endl;
	cin >> rent;

	cout << "The business net profit is " << (totalCost + salary + electric + rent) << endl;

	cout << "The item discount should be " << itemdiscount << endl;

	cout << "The merchandise should be marked up " << netprofit << endl;


	system("Pause");
	return 0;

}
Hi,

2 Problems :

You are using the variables uninitialized, and before you get input for them.

The last 2 need to be of type double.

had you searched these errors and read them, you could have discovered this yourself :+)
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
#include <iostream>

int main()
{
    // Need to enter the the total cost of the merchandise, the salary of the employees,
    // the yearly rent, and the estimated electricity costs.

    double total_cost_of_merchandise ;
    cout << "Enter the total cost of the merchandise: " ;
    cin >> total_cost_of_merchandise ;

    double salary;
    std::cout << "Enter the salary of all employees: " ;
    std::cin >> salary;

    double yearly_rent;
    std::cout << "Enter the yearly rent: " ;
    std::cin >> yearly_rent;

    double electricity_cost ;
    std::cout << "Enter the estimated electricity cost: " ;
    std::cin >> electricity_cost ;

    // we assume that valid non-negative values have been entered by the user

    // all expenses, which include merchandise cost,
    // store rent, employees' salary, and electricity cost for the store.
    const double total_expenses = total_cost_of_merchandise + yearly_rent + salary + electricity_cost ;

    // The plan is to make a nett profit of approximately 10%
    const double nett_profit = total_expenses * 0.10 ;
    const double sale_price_before_markup = total_expenses + nett_profit ;

    // Needs a markup but would like to put the item on sale for 15% off.
    const double marked_up_price = sale_price_before_markup * 100.0 / 85.0 ;

    // TO DO: print out the results
}
Topic archived. No new replies allowed.