# Gross Wage Assignment

1. Apr 21, 2016

### Veronica_Oles

1. The problem statement, all variables and given/known data
Have to write a program that outputs the users gross wage. If the hours are over 40 then the hourly rate gets multiplied by 1.5.

We also have to output the salary people would get from different countries:

China 0.48 cents
Dominican Republic 1.60 dollars
Haiti 0.55 cents

This is all on c#.

2. Relevant equations

3. The attempt at a solution
Code (C):
static void Main(string[] args)
{

double dblHrsWorked = 0;
double dblHrlyRate = 0;
double grossWageBan = 0;
double grossWageChi = 0;

Console.Write("Please enter the hours worked: ");

Console.WriteLine("Please enter the hourly rate(\$): ");

Console.WriteLine("You make a total of " + (GrossWage(dblHrsWorked, dblHrlyRate)) + " dollars.");

Console.WriteLine("People in the following countries make this amount of money: Bangladesh: " + (GrossWageBangladesh(grossWageBan)) + " dollars, China: " + (GrossWageChina(grossWageChi)) +" dollars.");

}

static double GrossWage (double hours, double rate)
{

double dblGrossWage = 0;

if (hours > 40)
{
dblGrossWage = 40 * rate;

dblGrossWage = dblGrossWage + ((hours - 40) * (rate * 1.5));

}

else
{

dblGrossWage = hours * rate;
}

return dblGrossWage;

}

{

double dblBanGrossWage = 0;

dblBanGrossWage = hours * 0.15;

return dblBanGrossWage;

}

static double GrossWageChina(double hours)
{

double dblChinaGrossWage = 0;

dblChinaGrossWage = hours * 0.48;

return dblChinaGrossWage;

}

}
}
I can't seem to figure out why the countries are not working can someone please Help me figure it out!

2. Apr 21, 2016

### Staff: Mentor

When you call your GrossWageBan() and GrossWageChi() methods, you are passing a value of 0 for hours to each method. You should be passing the number of hours in the calls to these methods, not grossWageBan and grossWageChi. These two variables are initialized to zero.