Docsity

Comprehensive Guide to Coding, Programming Languages, and Data Types Exam questions and, Exams of Algorithms and Programming

Toggle sidebar
bg1
Comprehensive Guide to Coding, Programming
Languages, and Data Types Exam questions and
answers Graded A+
What is coding?
The process of writing instructions for computers to follow.
What do computers understand directly?
Machine language, which consists of binary bits (ones and zeros).
Who created the first computer program?
Ada Lovelace in 1843 while working with Charles Babbage.
What is machine language?
The binary code that computers recognize as commands.
Why is coding necessary?
It translates human instructions into a format that computers can execute.
What are programming languages?
Systems of notation that allow programmers to write code for computers.
What is syntax in programming?
The set of rules that defines the structure of a programming language.
What is the significance of syntax?
It ensures that code is written correctly so that computers can understand it.
What is a common first program written in many programming languages?
A program that prints 'Hello, World' to the screen.
What are the two categories of programming languages?
Interpreted and compiled languages.
What does 'printing' mean in programming?
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c

Partial preview of the text

Download Comprehensive Guide to Coding, Programming Languages, and Data Types Exam questions and and more Exams Algorithms and Programming in PDF only on Docsity!

Comprehensive Guide to Coding, Programming

Languages, and Data Types Exam questions and

answers Graded A+

What is coding? The process of writing instructions for computers to follow. What do computers understand directly? Machine language, which consists of binary bits (ones and zeros). Who created the first computer program? Ada Lovelace in 1843 while working with Charles Babbage. What is machine language? The binary code that computers recognize as commands. Why is coding necessary? It translates human instructions into a format that computers can execute. What are programming languages? Systems of notation that allow programmers to write code for computers. What is syntax in programming? The set of rules that defines the structure of a programming language. What is the significance of syntax? It ensures that code is written correctly so that computers can understand it. What is a common first program written in many programming languages? A program that prints 'Hello, World' to the screen. What are the two categories of programming languages? Interpreted and compiled languages. What does 'printing' mean in programming?

Displaying text on the screen when a program runs. How is JavaScript syntax different from English? JavaScript has its own grammar rules that must be followed for correct execution. What is the role of a programmer? To write code that allows computers to perform specific tasks. What is the purpose of a program? To give step-by-step instructions to a computer. What is the difference between uppercase and lowercase in programming? Some languages treat them differently, making 'MyShoes' and 'myshoes' distinct variables. What is the first step in coding? Mapping out a program using plain language before actual coding begins. What is the importance of attention to detail in programming? It helps prevent errors in code that can lead to incorrect program behavior. What are common skills needed for good programmers? Problem-solving, attention to detail, and logical thinking. What is the output of the following Python code: print('Hello World')? 'Hello World' displayed on the screen. What is the output of the following C++ code: std::cout << 'Hello World';? 'Hello World' displayed on the screen. What is HTML? A markup language used for creating web pages, not considered a programming language. What is an interpreted language? A programming language that is executed line by line at runtime.

Executable files are platform-specific and need to be rewritten and recompiled for different systems. Name three examples of interpreted languages. Python, JavaScript, and Ruby. What is the main advantage of interpreted languages? They are platform-independent, allowing the same code to run on different operating systems. What is a runtime engine? A special interpreter that translates bytecode into machine language at runtime. What is bytecode? A low-level language generated by a compiler that is platform-independent. How do languages like C# and Java combine compiling and interpreting? They compile code into bytecode, which is then interpreted by a runtime engine. What is the downside of interpreted languages compared to compiled languages? Interpreted languages are generally slower and have limited access to system resources. What is the process called when a compiled program is adapted to work on different platforms? Porting. What is the primary function of a programming language? To make computer instructions easier for humans to read and write. What type of programs are typically written in compiled languages? Resource-intensive programs, such as high-end video games. What happens when you run a program written in an interpreted language? An interpreter executes the instructions in the source code. What is the significance of the binary executable file?

It allows the program to run directly on the processor without additional steps. Why is machine language difficult for humans to understand? It consists of complex binary code that requires extensive knowledge to interpret. What is the relationship between assembly language and machine language? Assembly language is a more understandable representation of machine language. What is the main role of a compiler in programming? To convert source code into machine language for execution. What is the impact of using a runtime engine on performance? It improves performance compared to interpreted languages but is still slower than fully compiled executables. What is portability in programming? The ability to run a program on different systems without changing the source code. What is a significant drawback of compiled programming languages? They require separate versions for different platforms, making development slower and error-prone. How does the execution of compiled programs differ from interpreted programs? Compiled programs run directly as machine language, while interpreted programs are executed line-by-line by an interpreter. What is the main difference between interpreted and compiled languages? Interpreted languages translate code into machine language as it runs, while compiled languages translate code before execution. Why are interpreted languages often slower than compiled languages? They translate code into machine language during execution, which adds overhead.

Who is credited with creating the first computer program? Ada Lovelace. What is a programming language? A set of instructions and rules that allow programmers to write code for computers to execute. Why do modern developers avoid using machine language? It is difficult for humans to understand and write, leading to the use of higher- level programming languages. What is the difference between machine language and binary code? Machine language is the lowest-level programming language that computers understand, while binary code is the representation of that language in 0s and 1s. What is the function of the tag in HTML? It contains all the elements that will be displayed on the screen. What does the tag do in HTML? It creates a hyperlink to another webpage or resource. What are batch files in Windows? Collections of commands that run sequentially in the command line. What is the significance of the tag in HTML? It contains metadata, links to stylesheets, and the title of the webpage. What is the main challenge of using assembly language? It is hard to write and use compared to higher-level languages. What is the purpose of debugging in programming? To identify and fix errors in the code to ensure it runs correctly. What does a programming language allow developers to create? Applications, websites, and other digital solutions.

What is the role of an interpreter in programming? To translate high-level code into machine language on-the-fly during execution. What is the benefit of using higher-level programming languages? They are easier for humans to read and write, making programming more accessible. What does the

tag do in HTML? It formats text as a paragraph. What does computer hardware refer to? Computer hardware does not involve the instructions or rules used to write code. Is a programming language solely for designing websites? No, a programming language is a broader concept used for various types of software development. Which of the following is NOT a programming language: Python, C++, HTML, Assembly Language? HTML is a markup language, not a programming language. What is syntax in computer programming? Syntax refers to the rules for how to write the language. What is the main advantage of using bytecode? Bytecode can run on any computer with a runtime engine, making it more portable. What is a binary executable file? A binary executable file is in machine language and can be directly executed by the computer's processor. What is a disadvantage of compiled programs? Compiled programs need to be rewritten and recompiled for different platforms.

Is bytecode easier to write than machine language? No, both bytecode and machine language are difficult for humans to write. What happens to a binary executable file during execution? It is directly executed by the computer's processor without additional steps. What is the difference between machine language and high-level programming languages? Machine language is low-level and specific to a computer's architecture, while high-level languages are more abstract and easier for humans to understand. What is the function of an interpreter? To execute code line by line during runtime. What is the relationship between syntax and program execution speed? Syntax does not relate to the speed of a program; it defines the structure of the code. What is bytecode in Java? Java is typically compiled into bytecode, which is then run on the Java Virtual Machine (JVM). What is the primary use of C#? C# is a compiled language primarily used within the .NET framework. What does a markup language do? Markup languages, such as HTML, add tags to text to define the structure and presentation of content on a webpage. What is another term for interpreted languages? Scripting languages. Why are interpreted languages slower than compiled languages? They translate the code into machine language as it runs, which adds overhead. Why is assembly language more efficient?

It allows direct access to the hardware. In what areas is assembly language still used today? In some specialized areas, such as embedded systems and performance-critical applications. What is the main purpose of query languages? To retrieve and manipulate data stored in databases. What role does a query play in a database search? To search the database and find matching records. What does SQL stand for? Structured Query Language. What is the first step in planning a coding project? Identify the goals of the program and what needs to be solved or accomplished. What tools can help in the planning process of programming? Diagrams, flowcharts, and pseudocode. What is the difference between a script and a program? A script uses a small amount of code to automate a specific task, while a program has more code and performs more complex functions. What is pseudocode? A method for designing algorithms using a simplified, human-readable form of programming logic. What is the significance of flowcharts in programming? Flowcharts help visualize the steps and logic of a program, aiding in the planning process. What is branching in programming? A programming concept that allows for decision-making in code, leading to different execution paths based on conditions.

Processes. What is the function of an arrow in a flowchart? To show the logical flow of the program. Why is pseudocode useful in programming? It clarifies ideas, keeps code neat, and saves time fixing mistakes. What are the six basic programming constructs represented in pseudocode? SEQUENCE, WHILE, REPEAT-UNTIL, FOR, IF-THEN-ELSE, CASE. What does the SEQUENCE construct represent? Tasks that happen in a specific order, one after the other. What is the purpose of the WHILE construct? To create a loop with a condition at its beginning. What is the difference between WHILE and REPEAT-UNTIL constructs? WHILE checks the condition at the beginning; REPEAT-UNTIL checks it at the end. What does the IF-THEN-ELSE construct do? It changes the flow of the program based on a condition. What is the CASE construct in programming? A generalized form of the IF-THEN-ELSE construct. What are relational operators used for in programming? To compare values and return true or false. What does the operator '!=' mean? 'is not equal to.' What does the operator '>' signify? 'greater than.' What is the purpose of adding comments in code?

To explain what each part of the code does for better understanding. Which symbol is commonly used to denote a comment in code? Common symbols include #, ', or //. What should be done before starting to code a program? Decide what the program should do and plan its structure. Why is planning important in programming? It helps create a well-thought-out program, reducing errors and improving efficiency. What happens if you skip the planning phase in programming? It can lead to poorly designed programs and increased errors. What does a diamond shape in a flowchart indicate? A decision point that can be answered with Yes or No. What is the first step in the Rock-Paper-Scissors flowchart? Start game of Rock-Paper-Scissors. What does the third step in the Rock-Paper-Scissors flowchart represent? Players click on icon of choice, either Rock, Paper, or Scissors. What happens if both players have not made a choice in the Rock-Paper-Scissors flowchart? The flowchart loops back to wait for their choices. What is the final outcome in the Rock-Paper-Scissors flowchart? The program evaluates the choices and displays the final outcome. What do ovals represent in a flowchart? The start or end of a program. What is the main purpose of a flowchart in programming? To show the flow (sequence) of logic in a program.

What is an array? A collection of variables of the same type accessed using an index. Why is it important to declare variables in programming? It makes the code easier to read and reduces the likelihood of mistakes. What do programmers use to track values that never change? Constants. What is the role of data types in programming? They determine what kind of operations can be performed on the data. What is the significance of the equals sign in variable assignment? It sets the value of the variable. What does a variable named 'Shoes' represent in a shoe store program? The number of shoes available, which can change based on sales and shipments. What is the difference between a variable and a constant? A variable can change its value, while a constant remains fixed. What is the purpose of pseudocode in programming? To plan and explain code in a clear and easy-to-understand way. What does the term 'logical operations' refer to? Operations that involve Boolean variables, typically resulting in True or False. What is the main function of flowcharts in programming? To visualize the logic and sequence of steps in a program. What is a character variable? A variable that stores a single character, which could be a digit, letter, or symbol. What is the significance of the central processing unit (CPU) in data processing? It processes data as ones and zeros, regardless of the data's meaning.

Why are data types important in programming? They determine what kind of operations you can perform on the data. What is an integer? Whole numbers like - 7, 23, or 65536, using 1 to 8 bytes of storage. What is a fixed-point number? Real numbers with a specific number of digits after the decimal point, commonly used in financial calculations. What is a double in programming? A variable that can store larger and more precise floating-point numbers. What is a character in programming? A single letter, symbol, or number, using one byte of storage. What is a string? A collection of characters, with no real limit on storage. How do you denote a string in programming? By using quotes (single, double, or backticks). What is an escape character? A character used to include special characters in a string, usually represented by a backslash (). What is an index in a string? The position of a character in a string, starting at 0. What is a Boolean value? A special type of number that indicates if something is TRUE or FALSE. What does the AND Boolean operator do? Returns TRUE if both conditions are TRUE. What does the OR Boolean operator do?

You cannot perform any math operations with it. What is the significance of indices in strings? They allow access to specific characters based on their position. What is the output of the string "John said 'Hello World' then left."? John said 'Hello World' then left. How do you define the length of a string? Usually when you set up the data type. What does the logical OR operator (||) do? It returns TRUE if either condition is TRUE. What does the logical XOR operator (^) do? It returns TRUE if one condition is TRUE and the other is FALSE; returns FALSE if both are TRUE. What does the logical NOT operator (!) do? It negates the truth value of the statement. What is an array in programming? A special type of variable that holds many values at once. How can arrays be structured? Arrays can be one-dimensional or multidimensional (e.g., arrays of arrays). What is a vector in programming? A group of the same type of variable that can change in size during program execution. What type of value can a Boolean variable store? True or False. What is a constant in a computer program? A value that never changes once it is set.

What does an array store? A collection of variables of the same type. What type of variable is used to store the value True or False? Boolean. Which of the following is an example of a character variable? '7'. Which of the following is an example of a floating-point number? 8.02. What is an integer in programming? A whole number, either positive or negative, without a decimal or fraction. Which of the following is a string? "Hello World". Which number type is similar to a float but can store larger and more precise numbers? Double. Which number type would you use for precise financial calculations? Fixed-point. What is a floating-point number? A number that can have decimal fractions. Which of the following is an example of an integer?

What is an escape character used for in a string? It is used to indicate that the following character has a special meaning. What is the purpose of an escape character in programming? To include special characters in the output.