计算税收,将钱作为c#中的输入 [英] calculate tax, taking money as input in c#

查看:134
本文介绍了计算税收,将钱作为c#中的输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编写税务计算程序。接受来自用户的资金并使用以下模式计算税额。



Write a program of tax calculation. Accept money as input from the user and calculate the tax using following pattern.

Money                 Percentage      Total Tax
Less than 10,000          5%              ?
10,000 to 100,000         8%              ?
More than 100,000        8.5%             ?

推荐答案

这是你的功课,因此你应该这样做。试试你自己,如果你需要特定的帮助,请在这里询问。
This is your homework, hence you are expected to do it. Try yourself and if you need specific help then ask here.


尝试这个答案,这可能会做你的工作

try this answer, this might do your work
using System;

class Program
{
    static void Main()
    {
       Console.Write("Input money : ");
       double money = double.Parse(Console.ReadLine());
       double tax;
       if (money < 10000)
       {
           tax = .05 * money;
       }
       else if (money <= 100000)
       {
           tax = .08 * money;
       }
       else
       {
           tax = .085 * money;
       }

       Console.WriteLine("Tax is {0:C}", tax);
       Console.ReadKey();
    }
}





[Agent_Spock]

- 添加了Code Brackets



[Agent_Spock]
- Added Code Brackets


这篇关于计算税收,将钱作为c#中的输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆