A comprehensive flashcard set of the 15 courses on the exit exam.
What is programming and what are its primary objectives?
Programming is the process of creating software, applications, and computer programs. Its primary objectives are to solve problems, automate tasks, and develop new technologies.
What is a data type and why is it important in programming?
A data type is a category of data that determines the type of operations that can be performed on it. It is important in programming because it helps to ensure that data is used and manipulated correctly.
What are the different types of data types in programming?
The different types of data types in programming include primitive types, composite types, and abstract data types.
What is a variable and how is it used in programming?
A variable is a named memory location that can hold a value. It is used in programming to store and manipulate data.
What are the rules for naming variables in programming?
The rules for naming variables in programming are: they must start with a letter or underscore, they can contain letters, numbers, or underscores, they cannot contain spaces, and they cannot be a reserved keyword.
How do you declare a variable in programming?
You declare a variable in programming by specifying the data type, followed by the variable name and an optional initial value.
What is an expression and how is it evaluated in programming?
An expression is a combination of values, variables, and operators that can be evaluated to produce a result. It is evaluated in programming by applying the operator precedence and associativity rules.
What are the different types of expressions in programming?
The different types of expressions in programming include arithmetic expressions, relational expressions, logical expressions, and conditional expressions.
How do you perform arithmetic operations in programming?
You perform arithmetic operations in programming using arithmetic operators such as +, -, *, /, and %.
What are the common comparison operators used in programming?
What is a conditional statement and how is it used in programming?
A conditional statement is a statement that performs a specific action depending on whether a condition is true or false. It is used in programming to control the flow of execution based on different conditions.
What are the different types of loops used in programming?
The different types of loops used in programming include for loops, while loops, do-while loops, and foreach loops.
What is the syntax for a while loop in programming?
The syntax for a while loop in programming is: while (condition) { code to execute while condition is true }
What is the syntax for a for loop in programming?
The syntax for a for loop in programming is: for (initialization; condition; increment/decrement) { code to execute while condition is true }
How do you use a loop to iterate over an array in programming?
You use a loop to iterate over an array in programming by using the index of the array as the loop counter variable.
What is the difference between a while loop and a do-while loop in programming?
The difference between a while loop and a do-while loop in programming is that a while loop tests the condition at the beginning of the loop, while a do-while loop tests the condition at the end of the loop.
What is a nested loop and how is it used in programming?
A nested loop is a loop that is placed inside another loop. It is used in programming to iterate over multidimensional arrays and to perform complex calculations.
How do you break out of a loop in programming?
You break out of a loop in programming using the break statement.
What is the purpose of a continue statement in programming?
The purpose of the continue statement in programming is to skip the current iteration of a loop and move on to the next iteration.
How do you create a function in programming?
In programming, a function can be created by using the function keyword followed by the function name and the code block that defines the function.
What are the different types of parameters that can be passed to a function in programming?
The different types of parameters that can be passed to a function in programming are: ▪ Required parameters ▪ Default parameters ▪ Variable-length parameters ▪ Keyword parameters
How do you call a function in programming?
In programming, a function can be called by using its name followed by the argument list inside parentheses.
What is a return statement in programming and how is it used?
In programming, a return statement is used to return a value from a function. It can be used to exit a function and return a value to the caller.
How do you debug a program in programming?
In programming, a program can be debugged by using a debugger tool, printing out values at various points in the code, and systematically isolating the error by testing smaller portions of the code.
What are some common errors encountered in programming and how can they be resolved?
Some common errors encountered in programming include syntax errors, logical errors, and runtime errors. Syntax errors can be resolved by checking the syntax of the code. Logical errors can be resolved by analyzing the code and checking for errors in the logic. Runtime errors can be resolved by using error handling techniques and debugging tools to find and fix the error.
What is the output of the following code? makefile x = 5 y = 3 print(x + y)
8
What is the purpose of a comment in programming?
A comment is used to add notes to the code to explain what it does or to make it more readable to others.
What is the difference between a float and an integer data type?
A float is a data type that represents a number with a decimal point while an integer represents a whole number without a decimal point.
What is the difference between a while loop and a for loop?
A while loop executes as long as the specified condition is true, while a for loop executes a fixed number of times.
What is recursion in programming?
Recursion is a programming technique where a function calls itself to solve a problem.
What is the difference between a function and a method?
A function is a standalone piece of code that performs a specific task, while a method is a function that belongs to an object or a class.
What is the difference between pass by value and pass by reference in programming?
Pass by value involves passing a copy of a variable's value to a function, while pass by reference involves passing a reference to the memory location of the variable.
How does the scope of a variable affect its accessibility in a program?
The scope of a variable determines where it can be accessed in a program. Variables with global scope can be accessed from anywhere in the program, while variables with local scope can only be accessed within the function or block in which they are defined.
What is object-oriented programming and how does it differ from procedural programming?
Object-oriented programming (OOP) is a programming paradigm that uses objects to represent data and methods to represent actions that can be performed on that data. OOP differs from procedural programming, which focuses on writing procedures or functions that manipulate data.
How can you optimize the performance of a program that uses loops to process large datasets?
There are several ways to optimize the performance of a program that uses loops to process large datasets, such as minimizing the number of iterations in the loop, using efficient data structures, and parallelizing the loop to take advantage of multiple cores.
What is a data structure and why is it important in programming?
A data structure is a way of organizing and storing data in a computer so that it can be accessed and manipulated efficiently. Data structures are important in programming because they enable efficient data access, retrieval, and modification, which is essential for many algorithms and appl
What is a database?
An organized collection of data.
What is the importance of a database?
To provide efficient storage and retrieval of data.
What are the different types of databases?
Relational, NoSQL, object-oriented, etc.
What are the components of a database?
Data, schema, DBMS, users, and hardware.
What are some advantages of using a database?
Data consistency, security, and scalability.
What are some disadvantages of using a database?
Complexity, cost, and maintenance.
What is ER modeling?
A graphical representation of entities and relationships used to design and understand the structure of a database.
What is the purpose of ER modeling?
To design and understand the structure of a database.
What are entities in ER modeling?
Objects with distinct properties.
What are attributes in ER modeling?
Characteristics of entities.
What are relationships in ER modeling?
Connections between entities.
What is cardinality in ER modeling?
The number of entities involved in a relationship.
What are ER diagrams?
A visual representation of entities and relationships.
What is relational algebra?
A mathematical operation used for manipulating and retrieving data from relational databases.
What is the purpose of relational algebra?
To manipulate and retrieve data from databases.
What are the basic operations in relational algebra?
Selection, projection, union, intersection, difference, and Cartesian product.
What is selection in relational algebra?
Filtering data based on a condition.
What is projection in relational algebra?
Selecting specific attributes from a relation.
What is union in relational algebra?
Combining data from two relations, keeping only distinct tuples.
What is intersection in relational algebra?
Combining data from two relations, keeping only common tuples.
What is difference in relational algebra?
Finding tuples that are in one relation but not the other.
What is Cartesian product in relational algebra?
Combining data from two relations, creating all possible pairs.
What are join operations in relational algebra?
Inner join, outer join, and natural join.
What is inner join in relational algebra?
Combining data from two relations, keeping only the common tuples.
What is outer join in relational algebra?
Combining data from two relations, keeping all tuples from one relation and matching tuples from the other relation.
What is natural join in relational algebra?
Combining data from two relations, keeping only the common tuples and eliminating the duplicate columns.
What is division operation in relational algebra?
Retrieving data that matches a set of conditions.
What is a primary key in a database?
A unique identifier for a row in a table.
What is a foreign key in a database?
A key in one table that refers to the primary key of another table.
What is normalization in a database?
The process of organizing data in a database to minimize redundancy and dependency.
What is denormalization in a database?
The process of adding redundant data to a database to improve performance.
What is a transaction in a database?
A unit of work performed by a user that involves one or more database operations.
What is a rollback in a database?
Undoing the changes made in a transaction.
What is a commit in a database?
Saving the changes made in a transaction.
What is the purpose of ER modeling?
The purpose of ER modeling is to design and understand database structure.
What are the components of an ER diagram?
The components of an ER diagram are entities, attributes, and relationships.
What is the difference between a left outer join and a right outer join?
A left outer join returns all the rows from the left table and matching rows from the right table, while a right outer join returns all the rows from the right table and matching rows from the left table.
What is the purpose of the selection operation in relational algebra?
The purpose of the selection operation is to filter data based on a condition.
What is the difference between a NoSQL database and a relational database?
A NoSQL database is a non-relational database that does not use a fixed schema, while a relational database is a structured database that uses tables with predefined relationships between them.
What is a Cartesian product in relational algebra?
A Cartesian product is a binary operation that returns a table containing all possible combinations of rows from two input tables.
What is Object-Oriented Programming (OOP)?
OOP is a programming paradigm that focuses on objects and their interactions.
What are the four main concepts of OOP?
Encapsulation, abstraction, inheritance, and polymorphism.
What is a class?
A class is a blueprint for creating objects.
What is an object?
An object is an instance of a class.
What are the properties of a class?
The properties of a class are the variables that define the object's state.
What are the methods of a class?
The methods of a class are the functions that define the object's behavior.
What is encapsulation?
Encapsulation is the practice of hiding the internal details of an object from the outside world.
How is encapsulation achieved?
Encapsulation is achieved through access modifiers such as public, private, and protected.
What is abstraction?
Abstraction is the practice of simplifying complex systems by breaking them down into smaller, more manageable parts.
How is abstraction achieved?
Abstraction is achieved through abstract classes and interfaces.
What is inheritance?
Inheritance is the process by which one class inherits the properties and methods of another class.
What is a base class?
A base class is the class that is being inherited from.
What is a derived class?
A derived class is the class that is inheriting.
What are the types of inheritance?
Single inheritance, multiple inheritance, and hierarchical inheritance.
What is polymorphism?
Polymorphism is the ability of an object to take on many forms.
How is polymorphism achieved?
Polymorphism is achieved through method overriding and method overloading.
What is method overriding?
Method overriding is the process of replacing a method in the base class with a new implementation in the derived class.
What is method overloading?
Method overloading is the process of creating multiple methods with the same name but different parameters.
What are virtual functions?
Virtual functions are functions that are declared in a base class and can be overridden in a derived class.
What are abstract classes?
Abstract classes are classes that cannot be instantiated and contain one or more abstract methods.
What are interfaces?
Interfaces are similar to abstract classes but they only contain abstract methods and no implementation.
What is a constructor?
A constructor is a special method that is called when an object is created.
What is the purpose of a constructor?
The purpose of a constructor is to initialize the object's state.
What is a destructor?
A destructor is a special method that is called when an object is destroyed.