What are the different levels of abstraction in programming?
Click to see answer
Level | Description |
---|---|
Machine Code | Hexadecimal or binary values representing the lowest-level instructions executed by hardware. |
Assembly Code | Low-level mnemonic instructions that map closely to machine code but are slightly more readable. |
High-Level View | Source code written in high-level languages with variables, functions, and control structures that are portable and more human-readable. |
Click to see question
What are the different levels of abstraction in programming?
Level | Description |
---|---|
Machine Code | Hexadecimal or binary values representing the lowest-level instructions executed by hardware. |
Assembly Code | Low-level mnemonic instructions that map closely to machine code but are slightly more readable. |
High-Level View | Source code written in high-level languages with variables, functions, and control structures that are portable and more human-readable. |
What are the key characteristics of variables?
What rules must an identifier follow in C/C++ and Python?
What are the key differences in identifier naming and variable typing between C/C++ and Python?
Feature | C/C++ | Python |
---|---|---|
Identifier Naming | Must start with letter or underscore, followed by letters, digits, underscores. | Same, but Python's dynamic nature makes naming overall more flexible in use. |
Variable Typing | Static typing: types are declared and fixed (e.g., int, float). | Dynamic typing: variables take the type of their current value and can change. |
Integer Types | Fixed-size signed/unsigned integers (char, int, long, etc.). | Arbitrary precision integers (no fixed-size limit). |
Boolean Type | bool type with values true/false. | bool class with values True/False. |
Floating Point | float, double, long double with differing precision. | float is double-precision (equivalent to C/C++ double). |