Variable Naming Conventions:
Must start with a letter.
Use camel casing for variable names (e.g., movieTitle).
First word is lowercase; subsequent words start with uppercase letters.
Example of Camel Case:
Movie title: words separated by a capital letter at the start of additional words.
Evaluating Naming:
Correctness assessed based on naming effectiveness and clarity.
Importance of Meaningful Information:
Names should convey what data represents.
Overview of Casing Styles:
Camel case: used for variable names.
Other casing types mentioned: Castile, Hungarian, etc.
Operator Placement Rules:
Operand must not be to the left of the assignment operator; it should represent a memory address.
Standard arithmetic operators: addition (+), subtraction (-), multiplication (*), and division (/).
Operations must start with variables before assignment operators.
Basic Order Rules:
Parentheses evaluated first.
Multiplication and division evaluated next, followed by addition and subtraction (left to right).
Example Breakdown:
For operation handling mathematical expressions, the order determines outcome effectively.
Three key categories to remember:
Arithmetic Operators: Basic mathematical operations.
Relational Operators: Used for making comparisons or program decisions.
Logical Operators: Connect relational expressions.
AND Operator:
Returns true only if both operands are true; otherwise, false.
Example: x > 2 AND x < 5 must satisfy both conditions.
OR Operator:
Returns true if at least one of the conditions is true.
NOT Operator:
Negates the operand; returns true if original operand is false and vice versa.
Variables associated with data types:
Name of vendor company: Data type = String.
Example variable name could be vendorCompanyName.
Always employ camel casing in naming variables.
- Questions for Practice:
Determine data types for various examples, enhancing comprehension of variable naming and associated data structures.
Key takeaways from variable naming and mathematical operation principles:
Use naming that reflects data intent and maintain proper casing for clarity.
Understand operator precedence to formulate clear and effective expressions.