Hi, I was need some help understanding something.
I have a book about C++ and anyways, I'm not really understanding how to do it.
What there wanting is you to create six legal variable names, three good and a three bad and explain why each falls into the category.
Anyone needs more information what I've learn so far I'd be happy to do so. Thank you.
Well, the book so far only used IOstream, and the biggest thing I'm not understanding is the variables, when they did the variables they used numbers I've used
namespace::std
cin >>
cout <<
const
number variables such as int and double ect
and little on string and booleans but they haven't covered them really yet. They just explained what they did.
No they didn't say what it may or may not contain. if the book name would help I'd be more than happy to tell you if that would help
I really don't know I'm new to doing this. This is what it says exactly.
Create a list of six legal variable names-- three good and three bad choices. Explain why each name falls into the good or bad category.
That seems pretty simple to me. The good/bad categories are just asking for an interpretation (as in, why is the name 'a' worse than 'x_position' for example).
Oh so if I wanted to something like could I do this?
const Good;
cout << "These are all good things";
a = Toys;
b = Angels;
c = Friends;
cout << a << " are good because little children like them" << endl;
cout << b << "are good because they help people" << endl;
cout << c << "are good because they look out for you" << endl;
then make a new const?
and if I wanted to make it where they pick a choice would I have to use the if statement?