page92
来源:互联网 发布:百雀羚保湿精华霜 知乎 编辑:程序博客网 时间:2024/05/16 03:53
// 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;
}
- page92
- 数据结构与程序设计Page92-E7
- Head First C# 中文版 图文皆译 第三章 page92
- 第十五周实验报告(任务一)【窗口程序设计之三角形类】
- Linux下使用BenchmarkSQL测试PostgreSQL
- 第十五周任务(一)
- 第十五周实验报告2
- 第十五周上机任务1
- page92
- SAE本地环境与真实环境的差别
- 矩阵A(L*M)与矩阵B(M*N)的乘积
- ARM 电源管理 4种模式
- 第十五周C++任务【三】格式输出
- LED显示屏知识序列一
- 互联网从业者推荐书目
- 第15周实验报告1
- 在installshield中如何创建service and 启动 停止 service