0
그래, 나는 잘못된 결과를 얻는 코드를 컴파일 할 때 taxRate의 사용자 입력에 문제가 있습니다.사용자 입력이 잘못된 결과를 내고 있습니다.
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
long propertyValue;
long taxRate;
long exemption = 5000;
cout << "What is the actual value of your property?\n";
cin >> propertyValue;
cout << "What is the current tax rate?\n";
cin >> taxRate;
cout << "You will pay an annual property tax of ";
cout << (propertyValue - exemption) * taxRate/100.00;
cout << " on your property\n";
cout << "and your quarterly tax bill will be; ";
cout << (propertyValue - exemption) * taxRate/100.00/4 << endl;
system("pause");
return 0;
}
먼저 입력 내용은 무엇이며, 무엇을 기대합니까? "잘못된 결과"는 무엇입니까? 둘째,'taxRate','propertyValue' 및'exemption'을 모두'long's로 설정 하시겠습니까? – MooseBoys
예 : propertyValue 입력에 대해 –
의 입력, 예상 출력 및 출력을 제공하십시오. 94,800이고 taxValue는 2.64 일 수 있으며, 재산세에 대한 예상 출력은 2,370이고 분기 별 세금 계산서는 592.68 – user3291461