Quote (KrzaQ2 @ Dec 19 2013 08:35am)
You're really struggling, aren't you?
It's
Code
else if
, not
Code
if else
If you want a bigger or equal b, you don't write
Code
a ==> b
, but
Code
a >= b
Your assignments are full of fail too. The variable you assign to needs to be on the left hand side.
Wrong
Code
sales * 1.03 = total;
you're trying assign to a value. You might as well try to say 1=2 and from now on 1*1 equals 4
Correct(er):
Code
total = sales*1.03;
But it won't work, because sales and total are decimals and 1.03 is a double. You can't mix those without a cast and ideally you should simply use a decimal literal instead:
Code
total = sales*1.03m;
Yes i am really struggling, hence the asking for help part. But i do appreciate the fixes you gave me, although im curious what the "m" does to fix the solution. I did it, and theres no longer a squiggly line under it, but i dont know why.
infact everything works except theres a squiggly under the underlined portion now:
-----------
{
decimal sales, total, profit;
Console.WriteLine("Enter Sales Amount: ");
sales = decimal.Parse(Console.ReadLine());
{
if (sales >= 1000) total = sales*1.03m;
if (sales >= 1000.1 ||
<= 5000) total = sales*1.035m;
if (sales >= 5000.1 ||
<= 10000) total = sales*1.04m;
if(sales >= 10000.1) total = sales*1.045m;
}
profit = remainder - sales;
Console.WriteLine("The Companies Total Profits were: $" );
Console.ReadKey();
}
--------------
cant figure out what im doing wrong on the other side of the statement. Also i removed the "else" entirely because no matter what side it was on, it was red squigglied.
p.s. Thank you for your help sir, i do appreciate it.
This post was edited by Hockeygod9911 on Dec 19 2013 03:22pm