Keep Getting 0$ as result???

I made a program for this problem= Each employee of a company contributes 6% of his salary towards his retirement account each month. The company will also make a contribution equal to 3 % of the employee’s salary. They need a program to manage the retirement accounts. The user will enter the monthly salary of an employee. The program will calculate and display the following items: amount of money contributed by the employee each month, amount of money contributed by the company each month, total contribution each month (i.e. the sum of employee’s and company’s contributions).)))
my code is = #include <cstdlib>
#include <iostream>
#include <istream>
using namespace std;

int main()
{
// Declare variables
double Salary = 0.0;
double monthlyContEmployee = 0.0;
double monthlyContEmployer = 0.0;
double monthlyContTot = 0.0;
//flotaaatata

monthlyContEmployee = Salary * 0.03;
monthlyContEmployer = Salary * 0.06;
//< endl;
monthlyContTot = (monthlyContEmployee + monthlyContEmployer);

// Request input
cout << "Please Enter employee's monthly salary: ";
cin >> Salary;
cout << "Employee Monthly Contribution is:$" << monthlyContEmployee << endl;
cout << "Employer Monthly Contribution is:$" << monthlyContEmployer << endl;
cout << "Total Montly Contribution is:$" << monthlyContTot << endl;

system("pause");
return 0;
}
i still get 0 for all the values ?
1
2
3
4
5
6
7
8
9
10
11
12
int main()
{
    // Declare variables
    double Salary = 0.0;
    double monthlyContEmployee = 0.0;
    double monthlyContEmployer = 0.0;
    double monthlyContTot = 0.0;

    monthlyContEmployee = Salary * 0.03; 
    monthlyContEmployer = Salary * 0.06;

    monthlyContTot = (monthlyContEmployee + monthlyContEmployer); 


On line 4 you set Salary to 0.

On line 9 you set monthlyContEmployee to 0 * 0.03, which is 0.
On line 10 you set montlyContEmployer to 0 * 0.06, which is 0.

On line 12 you set monthlyContTot to 0 + 0, which is 0.

Then you ask the user what the monthly salary should be. I think you may have got the cart before the horse.
what should i set the salary to? then..?
You should ask the user what you should set the salary to, before you use it for calculations.
im sorry im a total noob, started my first c++ class two weeks ago, i just need to know what should i set double Salary = 0.0; to??
@cire thanks man !! got it now.
Topic archived. No new replies allowed.