I am doing the Conditional and Logic lesson. I’m on the review with the planets. I tried to do it by myself first. When I got stuck I looked at the hint and I was doing it all wrong. I was putting each planet in as a variable. In the hint they only put “weight” and “x” as variables. I know I was over-complicating it, but why would I not put each planet as variables? There’s a disconnect there that I’m not getting. Also, I don’t fully understand when to use what ‘type’; I guess. I understand that ‘int’ is whole numbers and ‘double’ is decimals, and so on. With that same lesson, I don’t understand why “weight” would be a double, and “x” would be int and not char? Is it because the user is going to put a number for “x”? If so, why would “weight” be double instead of int? I’m sorry if these questions are confusing. I am not sure how else to ask them. I appreciate your help.

Here is the link:

https://www.codecademy.com/courses/learn-c-plus-plus/lessons/cpp-conditionals-and-logic/exercises/review