R
Robert Blackwell
I'm trying to follow along in class typing exactly whats put on the board.
using System;
namespace SchoolStuff
{
public class UseCalcPay
{
public static void Main()
{
double myHours = 37.5;
double myRate = 12.75;
double grossPay;
grosspPay = CalcPay(myHours, myRate);
Console.WriteLine("My gross pay is{0}", grossPay.ToString("C"));
}
public static double CalcPay(double hours, double rate)
{
double gross;
gross = hours * rate;
return gross;
}
}
}
And when I try to compile, it saysit can't find the name grossPay
Then, on this
using System;
namespace SchoolStuff
{
public class UseSevenPercentSalesTax
{
public static void Main()
{
double myPurchase = 10.99;
ComputeSevenPercentSalesTax(myPurchase);
ComputeSevenPercentSalesTax(35.67);
{
double tax;
tax = SaleAmount * 0.07;
Console.WriteLine("The tax on {0} is {1}", SaleAmount, tax.ToString("f"));
}
}
}
it's expecting a brace but I dn't know where
Lastly on this example
using System;
namespace SchoolStuff
{
public class UseSalesTax
{
public static void Main()
{
double myPurchase = 239.11;
double myRate = 0.10;
ComputeSalesTax(myPurchase, myRate);
ComputeSalesTax(16.55, 0.02);
}
public static ComputeSalesTax(double saleAmount, double taxRate)
{
double tax;
tax = saleAmount * taxRate;
Console.WriteLine("The tax on {0} is {1}", saleAmount, tax.ToString("F"));
}
}
}
it says it has to return a type.
I asked the teacher but he's like..oh yeah..fjkslf mumble mumble mumble
seriously, he can't answer...I'm not even sure he knows very much about C#
because he didn't know what a name space is and it seems as if he's just
reading the book one chapter ahead or something.
Please help if you can.
using System;
namespace SchoolStuff
{
public class UseCalcPay
{
public static void Main()
{
double myHours = 37.5;
double myRate = 12.75;
double grossPay;
grosspPay = CalcPay(myHours, myRate);
Console.WriteLine("My gross pay is{0}", grossPay.ToString("C"));
}
public static double CalcPay(double hours, double rate)
{
double gross;
gross = hours * rate;
return gross;
}
}
}
And when I try to compile, it saysit can't find the name grossPay
Then, on this
using System;
namespace SchoolStuff
{
public class UseSevenPercentSalesTax
{
public static void Main()
{
double myPurchase = 10.99;
ComputeSevenPercentSalesTax(myPurchase);
ComputeSevenPercentSalesTax(35.67);
{
double tax;
tax = SaleAmount * 0.07;
Console.WriteLine("The tax on {0} is {1}", SaleAmount, tax.ToString("f"));
}
}
}
it's expecting a brace but I dn't know where
Lastly on this example
using System;
namespace SchoolStuff
{
public class UseSalesTax
{
public static void Main()
{
double myPurchase = 239.11;
double myRate = 0.10;
ComputeSalesTax(myPurchase, myRate);
ComputeSalesTax(16.55, 0.02);
}
public static ComputeSalesTax(double saleAmount, double taxRate)
{
double tax;
tax = saleAmount * taxRate;
Console.WriteLine("The tax on {0} is {1}", saleAmount, tax.ToString("F"));
}
}
}
it says it has to return a type.
I asked the teacher but he's like..oh yeah..fjkslf mumble mumble mumble
seriously, he can't answer...I'm not even sure he knows very much about C#
because he didn't know what a name space is and it seems as if he's just
reading the book one chapter ahead or something.
Please help if you can.