Back to notes
Explain the significance of syntax in programming.
Press to flip
Syntax refers to the rules of grammar in programming languages; it is essential for code to run correctly and varies by language.
Contrast linear search and binary search algorithms.
Linear search checks each element until the value is found (efficient for small or unsorted lists, O(n) worst case). Binary search efficiently finds a value in sorted lists by dividing the list in half each iteration (O(log n)).
What role do functions play in programming and what are the primary types?
Functions encapsulate code to perform specific tasks. They can take arguments and/or return a value.
Differentiate between high-level and low-level programming languages with examples.
High-level languages (e.g., Python, Java) are human-readable and easier to write, while low-level languages (e.g., Assembly, C) are closer to machine code.
What is the main purpose of programming languages?
To serve as a bridge between humans and machine code.
Name and describe the different types of variables commonly used in programming.
Int (integer), Bool (boolean), Float and Double (floating-point numbers), Strings (text), and Character (single character). Used to store information.
How does a dictionary in programming function?
A dictionary stores data as key-value pairs, providing efficient access to data values based on unique keys.
Explain the concept and utility of pseudocode in programming.
Pseudocode outlines functionality without strict syntax, aiding in planning. Techniques include flowcharts, step-by-step write-ups, and feature listing.
List some recommended resources for learning and practicing programming outside of the classroom.
Official language websites, tutorials, practice sites like Coding Bat, Coderbyte, HackerRank, and high school courses in programming and computer science.
Identify and describe the three main types of errors encountered in debugging.
Syntax Errors (mistakes in code syntax detected by IDE), Runtime Errors (issues during program execution), Logic Errors (code runs but produces incorrect results).
What is the function of an Integrated Development Environment (IDE)?
An IDE facilitates coding, debugging, and running code by providing tools like error checking, autocomplete, and a file hierarchy.
Describe the purpose and a use-case example of a Console and Print Statement.
The console is a text interface for output, and a print statement outputs text to the console, useful for debugging and tracking program performance. Example: `print("Hello, World!")` in Python.
What is the difference between arrays and array lists?
Arrays are fixed-size collections of values, while array lists dynamically expand when more elements are added.
What are conditional statements and how do 'if' and 'else if' statements operate?
Conditional statements like 'if' determine code execution paths based on conditions, while 'else if' provides alternate execution paths based on multiple conditions.
What defines a recursive function?
A recursive function calls itself to solve a problem incrementally, characterized by a base case to prevent infinite recursion.
Previous
Next