Some comments:
Your TodaysDate function is supposed to return an int, but there is no return statement. With
std::cout
it looks as though it should have a return type of void, but then you call the function on line 41. Perhaps you should get it to return a
std::string
?
#include <string>
if you want to use strings. Or you could just call the function first - like this to the same effect:
1 2
|
TodaysDate(); //change the function so it doesn't print an endl. Notice the () in the function call
cout << ',' << "XCode" << ',' << "Activity" << ',' << Day1 << ',' << f <<endl;
|
It is a good idea to declare you functions before main, and define them after main. If there are lots of functions, we don't have to scroll through all of them to see what main() does - main() may not call all of them.
You can declare & initialise all in one go like this:
float f = 20.0;
So lines 18 to 24 & 27 to 39 could be combined together.
With the ABC & buy - did you mean them to be "ABC" & "buy" - string literals as opposed to variables?
The 01 on line 11 doesn't pre-pend a zero to the answer, a leading zero actually means the number is in octal format & 0x means hexadecimal. You could check if the value is less than 10, then use the std::string operator + to pre-pend the zero.
Hope this helps ! Have fun :D