Section 2-21 "Explain these Statements" Challange

Hey there, sorry in advance if this is the wrong place to post here, I couldn’t find this exact thread anywhere else, but then again I only started using the forum today so maybe I am just looking in the wrong place.

Anyway! Attempting to explain these statements!

To be honest I don’t know exactly what the correct answers are, but I thought I would just attempt it anyway to the best of my understanding.

Preprocessor Directive: Basically it is a way of importing lines of code from an external file. From my understanding it is kinda similar, at least in theory, to importing a CSS style sheet into a HTML file.

Main Function: My interpretation is that it is basically the body of the whole code and without it the computer will not even acknowledge the existence of the whole file.

Expression Statements: I think it is a statement must end in “;” that appears in the terminal.

Declaration Statements: A statement that must end in a “;” and does not appear in the terminal, it takes on a more behind the scenes type role.

Return Statement: How you finish up the code. How you tell the file “ok ,this is the end of it all, wrap it up now”.

Please correct me, I must be incorrect.

Hi I’ll post here as well since I didn’t find a more suitable topic in the forum.

Here it goes:

  • Preprocessor Directive - What the #include iostream is doing is allowing us to tap into code that other programmers have created in order for us to do certain things, im thinking it lets us input values and output them?

  • Main Function - It is allowing the compiler to recognize the code that we are writing inside of it.

  • Expression statements - the expression statements allow us to output certain information to the player.

  • Declaration statements - These let us declare values that will affect the gameplay.

  • Return Statement - This statement lets us finish the code.

Cheers!
:beers:

Privacy & Terms