ughhhhhhhhh totally erased this because my question was dumb and i actually did figure out what i did wrong.
Printable View
ughhhhhhhhh totally erased this because my question was dumb and i actually did figure out what i did wrong.
lolz nvm i figured it out -_-
This is how you define vars of the same type in one line:
When you define a variable, you put a semicolon at the end - ;Code:int father, mother, daughter, son;
string one, two, three, four;
Also, you know, you can have a runtime error if your file will not open.
Code:outputFile.open("SalesTaxData.txt");
if (outputFile.good()) {
// now you can work with the file,
} else {
// here you can provide the user with error message
}
ugh i don't know why i had commas. anyway i thought i fixed it but it still cuts off (it just ends) after it displays "please enter the year for this report:".
Well, month doesn't really contain anything, does it? It's empty. Same for year.
And that would be because you need to actually ask the user for the data, not only write a comment about it in source code. ;)
look you don't need to be excessively sarcastic if you think my question is silly, i already know it is.
i am asking the user for data.
and no, neither month or year contain data because i'm supposed to input them when i'm running the program.
In any case, there is nothing wrong with the code (save for what was already pointed out; and the missing newline).
helloalyssa, was that really *overly* sarcastic? ;) Well, maybe you could paste your code again, with the fixes, for us to see why it still doesn't work. Because at the snippet above there is no code that would actually ask the user for data. You know, std::cin or something like std::getline().