#include <iostream>
using namespace std;
int main()
{
double propValue, //Property Value
name, //Full Name
assessment, //Assessment
srAssessment, //Sr Assessment
taxRate, //Tax rate
annualPropTax; //Annual Property tax
const double EXEMPT = 5000, //shows the total after exemption
QUARTER = 4, //represents the amount of quarters in year
TAXPERHUNDRED = 0.01, //represents tax rate for every $100
SIXTYPERCENT = 0.6; //Represents the tax based on 60% of original value
//Gets name from user
cout << "Please enter your full name: ";
cin >> name;
//gets property value from user
cout << "Enter the actual value of the property: ";
cin >> propValue;
//Gets tax rate
cout << "Enter the tax rate for each $100 of assessed value: ";
cin >> taxRate;
}
我假設有一些我在這裏做錯了,但我無法弄清楚。我是新來的C++和整體編程。當我運行這段代碼它沒有讓我輸入任何東西的「名」之後的變量,它只是顯示我所有的輸出此代碼在第一次用戶輸入後不起作用
您是否正在爲'name'輸入字符?如果這樣'name'不應該是'double'。 – NathanOliver
夥計們,你爲什麼低估這個?這可能是他加入ACM後的第一個用戶名。調試是通過經驗獲得的技能。不要嚇唬他,不要通過降低投票尋求幫助。 @acm818,嘗試將名稱更改爲字符串。一個double只包含一個十進制值,如-12.454,而一個字符串包含像「Reiss Bachman」這樣的字符。 – joshualan
是的,我是。感謝幫助的人。你指出我正確的方向,我現在正在工作 – acm818