Back to notes
Why are programming languages used instead of machine code?
Press to flip
Programming languages are used because they act as middlemen, translating human-readable code into machine code, which is the only language computers understand.
How can print statements, breakpoints, and commenting out code assist in debugging?
Print statements, breakpoints, and commenting out code help identify and fix errors by allowing the programmer to examine the flow and state of the program in different sections.
What are Array Lists and how do they differ from regular arrays?
Array Lists are arrays that can grow in size, unlike regular arrays which have a fixed size.
What are the benefits of using functions in programming?
Functions allow segments of code to be called repeatedly, reducing code clutter and making changes easier. They can have arguments and return values.
Name at least three types of errors that can occur in programming.
Syntax errors, Runtime errors, and Logic errors.
Why is it important to use meaningful variable names and follow naming conventions like CamelCase?
Meaningful variable names and naming conventions like CamelCase improve code readability and maintainability, making it easier to understand and manage code.
What is the definition and primary goal of programming?
Programming is the process of preparing an instructional program for a device. The primary goal is to get a computer to complete a task without mistakes.
How do 'if,' 'elsif,' and 'else' statements control the flow of a program?
'If,' 'elsif,' and 'else' statements control the flow of a program by making decisions based on conditions. They determine which code segments are executed.
Explain the difference between a 'for' loop and a 'while' loop.
A 'for' loop repeats instructions a specified number of times, while a 'while' loop repeats instructions as long as a condition is true.
Describe the concept of dictionaries in programming.
Dictionaries are data structures that store data in key-value pairs, allowing for efficient data retrieval based on keys.
Why is it important to choose the right programming language for a task?
Different programming languages are suited for different tasks. For example, HTML/CSS are ideal for web design, while Java/Python/C++ are better for general-purpose programming.
What is the role of an IDE in programming?
An Integrated Development Environment (IDE) provides an interface for writing, running, and debugging code. It includes tools like error checking, auto-filling, and project hierarchy.
What is recursion and why is a base case important?
Recursion is when a function calls itself. A base case is important to stop the recursive calls and avoid infinite recursion.
Describe the concept of arrays and their indexing.
Arrays are lists used to store multiple related values, with indexing starting at 0. They have a fixed size and type of values.
What is the purpose of pseudocode in programming?
Pseudocode helps in planning code by writing it in plain English or using diagrams, which simplifies the actual coding process.
Previous
Next