






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A comprehensive set of questions and answers related to scripting and programming foundations. It covers essential concepts such as variables, data types, operators, control structures (branches and loops), functions, search algorithms, and the software development life cycle (sdlc). Additionally, it delves into uml diagrams, compiled vs. Interpreted languages, statically vs. Dynamically typed languages, and object-oriented programming, offering a valuable resource for students preparing for exams or seeking a solid understanding of programming fundamentals. The document also touches on programming libraries and their usage, making it a well-rounded study aid.
Typology: Exams
1 / 12
This page cannot be seen from the preview
Don't miss anything!







What is the purpose of a variable? To store Data values that can be changed and used later in a program How do you save a value to a variable? By using a assignment statement Ex: X= What is a programming expression? A combination of variables, literals, and operators that produce a value What is an identifier? The name used to identify variables functions or other entities in code What constitutes a valid identifier? starts with a letter or underscore followed by letters,digits or underscores and no spaces or special characters What is a literal? A fixed value written directly in code ex: 42, Hello, 3.
What is an operator? A symbol or keyword that performs operations on variables and values ex +,-,/,* What precedence rules does programming use? Rules that determine the order in which operations are performed, Ex Parenethesis, Multiplication, addition/subtraction P E M D A S How does an integer differ from a float An integer is a whole number without a decimal point, while a float is a number with decimal places What happens if you divide two integers/ an integer and a float? Dividing two integers often results in integer division (discarding remainder) or float division depending on language. Dividing an integer by a float results in a float
What is the purpose of each different data type? To define the kind of data stored and the operations allowed, e.g., integers for whole numbers, floats for decimals, strings for text. How does a branch differ from a loop? A branch executes code conditionally once, a loop repeats code multiple times. How does an if-else branch work? Executes a block of code if a condition is true, otherwise executes an alternative block. What does the equality operator do? Does it work for all data types? Tests if two values are equal. It generally works for all primitive types and may be defined for objects. What are the four relational operators? ==, !=, <, > (also often <= and >=). What are the three logical operators? AND (&& or and), OR (|| or or), NOT (! or not). Explain the precedence rules.
Logical NOT has highest precedence, then AND, then OR. How is an infinite loop created? By having a loop with a condition that never becomes false. What is a sentinel value? A special value used to terminate a loop or signal the end of data. What are the three parts of a loop? Initialization, condition, and iteration (update). What is difference in a while loop and do/while loop? while checks condition before executing the loop body. do/while executes the body at least once before checking condition. Which control structure is guaranteed to run only one time? A simple if statement or a do/while loop runs at least once. Which loop is used when you are unsure how many times you may need to iterate?A while loop.
Ends a function and optionally passes a value back to the caller. What is a binary search? An efficient search method on sorted data by repeatedly dividing the search interval in half. What is a linear search? A search method that checks each element one by one until the target is found. What is SDLC? Software Development Life Cycle - a process for planning, creating, testing, and deploying software. What are the four phases of SDLC? Requirements, Design, Implementation (Coding), Testing & Maintenance. What activities take place in each phase? Requirements: gather user needs. Design: plan software architecture. Implementation: write code. Testing & Maintenance: find/fix bugs and update software.
In which phase do you write code? Implementation phase. How does a waterfall approach differ from an agile approach? Waterfall is linear and sequential; agile is iterative and incremental with continuous feedback. What is UML? A standardized modeling language for visualizing software design. Which UML diagrams are structural? Class diagrams, Object diagrams, Component diagrams. Which UML diagrams are behavioral? Use case diagrams, Sequence diagrams, Activity diagrams, State machine diagrams. Which UML diagrams are activity? Activity diagrams model workflows and processes. Which UML diagrams are used in the analysis phase?
What is the difference in a compiled language and an interpreted language? Compiled languages are converted into machine code before running; interpreted languages are executed line-by-line by an interpreter. Which languages are compiled? C, C++, Java (compiled to bytecode), Go, Rust. Which languages are interpreted? Python, JavaScript, Ruby, PHP. What is the difference in statically typed and dynamically typed languages? Static typing checks types at compile time; dynamic typing checks types at runtime. Which languages are statically typed? C, C++, Java, C#, Go, Rust. Which languages are dynamically typed? Python, JavaScript, Ruby, PHP.
What is the difference in an object-oriented language and a non object-oriented language? Object-oriented languages use classes and objects; non-OOP languages do not focus on objects. Which languages are object oriented? Java, C++, Python, Ruby, C# Which languages are not object oriented? C, Fortran, Assembly (primarily procedural). How does a markup language differ from a programming or scripting language? Markup languages (like HTML) define document structure; programming languages define logic and behavior. What is a programming library? A collection of prewritten code to perform common tasks. Why are programming libraries used? To save time and avoid reinventing the wheel. Are libraries compiled or precompiled?