Exit Exam Part 1

studied byStudied by 0 people
0.0(0)
Get a hint
Hint

What is programming and what are its primary objectives?

1 / 1076

flashcard set

Earn XP

Description and Tags

A comprehensive flashcard set of the 15 courses on the exit exam.

1077 Terms

1

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.

New cards
2

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.

New cards
3

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.

New cards
4

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.

New cards
5

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.

New cards
6

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.

New cards
7

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.

New cards
8

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.

New cards
9

How do you perform arithmetic operations in programming?

You perform arithmetic operations in programming using arithmetic operators such as +, -, *, /, and %.

New cards
10

What are the common comparison operators used in programming?

The common comparison operators used in programming include \==, !\=, \>, <, \>\=, and <\=.
New cards
11

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.

New cards
12

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.

New cards
13

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 }

New cards
14

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 }

New cards
15

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.

New cards
16

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.

New cards
17

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.

New cards
18

How do you break out of a loop in programming?

You break out of a loop in programming using the break statement.

New cards
19

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.

New cards
20

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.

New cards
21

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

New cards
22

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.

New cards
23

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.

New cards
24

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.

New cards
25

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.

New cards
26

What is the output of the following code? makefile x = 5 y = 3 print(x + y)

8

New cards
27

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.

New cards
28

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.

New cards
29

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.

New cards
30

What is recursion in programming?

Recursion is a programming technique where a function calls itself to solve a problem.

New cards
31

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.

New cards
32

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.

New cards
33

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.

New cards
34

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.

New cards
35

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.

New cards
36

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

New cards
37

What is a database?

An organized collection of data.

New cards
38

What is the importance of a database?

To provide efficient storage and retrieval of data.

New cards
39

What are the different types of databases?

Relational, NoSQL, object-oriented, etc.

New cards
40

What are the components of a database?

Data, schema, DBMS, users, and hardware.

New cards
41

What are some advantages of using a database?

Data consistency, security, and scalability.

New cards
42

What are some disadvantages of using a database?

Complexity, cost, and maintenance.

New cards
43

What is ER modeling?

A graphical representation of entities and relationships used to design and understand the structure of a database.

New cards
44

What is the purpose of ER modeling?

To design and understand the structure of a database.

New cards
45

What are entities in ER modeling?

Objects with distinct properties.

New cards
46

What are attributes in ER modeling?

Characteristics of entities.

New cards
47

What are relationships in ER modeling?

Connections between entities.

New cards
48

What is cardinality in ER modeling?

The number of entities involved in a relationship.

New cards
49

What are ER diagrams?

A visual representation of entities and relationships.

New cards
50

What is relational algebra?

A mathematical operation used for manipulating and retrieving data from relational databases.

New cards
51

What is the purpose of relational algebra?

To manipulate and retrieve data from databases.

New cards
52

What are the basic operations in relational algebra?

Selection, projection, union, intersection, difference, and Cartesian product.

New cards
53

What is selection in relational algebra?

Filtering data based on a condition.

New cards
54

What is projection in relational algebra?

Selecting specific attributes from a relation.

New cards
55

What is union in relational algebra?

Combining data from two relations, keeping only distinct tuples.

New cards
56

What is intersection in relational algebra?

Combining data from two relations, keeping only common tuples.

New cards
57

What is difference in relational algebra?

Finding tuples that are in one relation but not the other.

New cards
58

What is Cartesian product in relational algebra?

Combining data from two relations, creating all possible pairs.

New cards
59

What are join operations in relational algebra?

Inner join, outer join, and natural join.

New cards
60

What is inner join in relational algebra?

Combining data from two relations, keeping only the common tuples.

New cards
61

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.

New cards
62

What is natural join in relational algebra?

Combining data from two relations, keeping only the common tuples and eliminating the duplicate columns.

New cards
63

What is division operation in relational algebra?

Retrieving data that matches a set of conditions.

New cards
64

What is a primary key in a database?

A unique identifier for a row in a table.

New cards
65

What is a foreign key in a database?

A key in one table that refers to the primary key of another table.

New cards
66

What is normalization in a database?

The process of organizing data in a database to minimize redundancy and dependency.

New cards
67

What is denormalization in a database?

The process of adding redundant data to a database to improve performance.

New cards
68

What is a transaction in a database?

A unit of work performed by a user that involves one or more database operations.

New cards
69

What is a rollback in a database?

Undoing the changes made in a transaction.

New cards
70

What is a commit in a database?

Saving the changes made in a transaction.

New cards
71

What is the purpose of ER modeling?

The purpose of ER modeling is to design and understand database structure.

New cards
72

What are the components of an ER diagram?

The components of an ER diagram are entities, attributes, and relationships.

New cards
73

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.

New cards
74

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.

New cards
75

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.

New cards
76

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.

New cards
77

What is Object-Oriented Programming (OOP)?

OOP is a programming paradigm that focuses on objects and their interactions.

New cards
78

What are the four main concepts of OOP?

Encapsulation, abstraction, inheritance, and polymorphism.

New cards
79

What is a class?

A class is a blueprint for creating objects.

New cards
80

What is an object?

An object is an instance of a class.

New cards
81

What are the properties of a class?

The properties of a class are the variables that define the object's state.

New cards
82

What are the methods of a class?

The methods of a class are the functions that define the object's behavior.

New cards
83

What is encapsulation?

Encapsulation is the practice of hiding the internal details of an object from the outside world.

New cards
84

How is encapsulation achieved?

Encapsulation is achieved through access modifiers such as public, private, and protected.

New cards
85

What is abstraction?

Abstraction is the practice of simplifying complex systems by breaking them down into smaller, more manageable parts.

New cards
86

How is abstraction achieved?

Abstraction is achieved through abstract classes and interfaces.

New cards
87

What is inheritance?

Inheritance is the process by which one class inherits the properties and methods of another class.

New cards
88

What is a base class?

A base class is the class that is being inherited from.

New cards
89

What is a derived class?

A derived class is the class that is inheriting.

New cards
90

What are the types of inheritance?

Single inheritance, multiple inheritance, and hierarchical inheritance.

New cards
91

What is polymorphism?

Polymorphism is the ability of an object to take on many forms.

New cards
92

How is polymorphism achieved?

Polymorphism is achieved through method overriding and method overloading.

New cards
93

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.

New cards
94

What is method overloading?

Method overloading is the process of creating multiple methods with the same name but different parameters.

New cards
95

What are virtual functions?

Virtual functions are functions that are declared in a base class and can be overridden in a derived class.

New cards
96

What are abstract classes?

Abstract classes are classes that cannot be instantiated and contain one or more abstract methods.

New cards
97

What are interfaces?

Interfaces are similar to abstract classes but they only contain abstract methods and no implementation.

New cards
98

What is a constructor?

A constructor is a special method that is called when an object is created.

New cards
99

What is the purpose of a constructor?

The purpose of a constructor is to initialize the object's state.

New cards
100

What is a destructor?

A destructor is a special method that is called when an object is destroyed.

New cards

Explore top notes

note Note
studied byStudied by 49 people
... ago
5.0(2)
note Note
studied byStudied by 179 people
... ago
5.0(2)
note Note
studied byStudied by 7 people
... ago
5.0(1)
note Note
studied byStudied by 3112 people
... ago
4.9(9)
note Note
studied byStudied by 60 people
... ago
5.0(1)
note Note
studied byStudied by 31 people
... ago
5.0(1)
note Note
studied byStudied by 77 people
... ago
5.0(1)
note Note
studied byStudied by 692 people
... ago
4.8(9)

Explore top flashcards

flashcards Flashcard (26)
studied byStudied by 18 people
... ago
5.0(1)
flashcards Flashcard (39)
studied byStudied by 1 person
... ago
5.0(1)
flashcards Flashcard (100)
studied byStudied by 82 people
... ago
5.0(4)
flashcards Flashcard (22)
studied byStudied by 20 people
... ago
5.0(1)
flashcards Flashcard (35)
studied byStudied by 32 people
... ago
5.0(4)
flashcards Flashcard (134)
studied byStudied by 6 people
... ago
5.0(1)
flashcards Flashcard (73)
studied byStudied by 11 people
... ago
5.0(1)
flashcards Flashcard (30)
studied byStudied by 1 person
... ago
5.0(1)
robot