新手,求解答此问题,同事望给点学习c++的建议,感觉自己尽力了但是学不好
#include<iostream>using namespace std;
double tax(int net_income);
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>15000)&&(net_income<=25000))
tax_bill=(0.05*(net_income-15000));
else
{
five_percent_tax=0.05*10000;
ten_percent_tax=0.10*(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;
return 0;
}
这个程序里面cout<<"net income =$"<<net_income<<endl
<<"tax bill=$"<<tax_bill<<endl;中<<"tax bill=$"为什不能写成<<"tax_bill=$"