我不知道我应该如何标题我的问题。我正试图编写一个程序,要求提供一个物业的价值。然后它将该值乘以60%来给出评估值。例如,如果一英亩土地的价值为10,000美元,则其评估价值为6,000美元。每100美元的评估价值,房产税为64美分。评估的6000英亩土地税为38.40美元。我必须设计一个模块化程序,要求获得一块物业的实际价值,并显示评估价值和物业税。这是我到目前为止。C#模块数字输入
{
static void Main(string[] args)
{
double propertyValue = 0.0;
double assessTax = 0.0;
double propertyTax = 0.0;
getValue(ref propertyValue);
Tax(ref propertyValue, propertyTax, assessTax);
showOutput(ref propertyTax, assessTax, propertyValue);
}///End Main
static void showOutput(ref double propertyValue, double assessTax, double propertyTax)
{
Console.WriteLine("Your Entered Property Value was {0, 10:C}", propertyValue);
Console.WriteLine("Your Assessment Value is {0, 10:C}", assessTax);
Console.WriteLine("Your Property Tax is {0, 10:C}", propertyTax);
}///End showOutput
static void getValue(ref double propertyValue)
{
Console.WriteLine("Please Enter Property Value");
while (!double.TryParse(Console.ReadLine(), out propertyValue))
Console.WriteLine("Error, Please enter a valid number");
}///End getValue
static void Tax(ref double propertyValue, double assessTax, double propertyTax)
{
assessTax = propertyValue * 0.60;
propertyTax = (assessTax/100) * 0.64;
}///End Tax
这是我在写作中的DreamSpark任何东西,所以我很抱歉,如果答案是显而易见的(我有点丢失)的第一次尝试。我在想也许我的财产价值输入没有被保存。当我尝试运行它时,我得到的房产价值是0.00美元,评估价值是0.00美元,房产税是10,000美元。任何直接的答案或指南的链接,以便我可以自己修复它将不胜感激。
在调用函数时,您以错误的顺序发送参数。 – 2015-02-10 17:13:16
当我调用函数时,什么命令是正确的?我的命令对我有意义。获得价值应该用例如10000代替0.0。然后税应该采用属性值的新值10000,并且计算出这两种税。然后showOutput应该把所有的值放在屏幕上。感谢您的帮助。 – redcell98 2015-02-10 17:54:04