page92

// page92.cpp : 定义控制台应用程序的入口点。
//C++ 面向对象程序设计


//该程序用于计算州的收入税

#include "stdafx.h"
#include <iostream>
using namespace std ;

// 这个程序返回州收入金额,计算方式如下:
//$15,000一下的部分免税:$15,001--$25,000之间税率5%:超过$25,000税率为10&

int main ()
{
 int net_income;
 double tax_bill;
 double five_percent_tax , ten_percent_tax;

 cout << " Enter net income (rounded to whole dollars ) $";
 cin >> net_income;

 if (net_income <=15000)
 {
  tax_bill = 0;
 }
 else if ( (net_income >1500) && (net_income <= 25000) )
 { //为超过15000的部分返回5%的税金
  tax_bill = ( 0.05 * ( net_income -15000 ) );
 }
 else // net_income >25000
 {
  // five_percent_tax = $ 15000 -- 25000 之间的净收入的5%
  five_percent_tax = 0.05 * 10000 ;
  //ten_percent_tax = 25000以上净收入的10%
  ten_percent_tax = 0.1 * (net_income - 25000);
  tax_bill =(five_percent_tax + ten_percent_tax);
 }

 cout.setf(ios::fixed);
 cout.setf( ios::showpoint);
 cout.precision(2);
 cout << " Net income =$ " << net_income << endl
  << " Tax bill = $ " << tax_bill << endl;

 cin >> net_income;
 return 0;
}

 


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值