Information for the Written Exam
Date, Time, and Place ("Normal Season", a.k.a. "Época Normal")
- Date: June 20th (friday)
- Time: 14:00
- Duration: 2h
- Rooms: FC2 009
Valuation:
As discussed on the evaluation page and Sigarra, this exam is worth 50% of the grade on this course (the other 50% come from the practical tests and exercises during practical classes).
Model Exam:
Goals for the Exam
C Fundamentals
- Understand the structure of a C program, what is an
#include
directive and what is the main
function
- Understand the concept of a variable as a container for storing data and how to declare and assign them values
- Understand basic C types (
int
, long
, float
, double
, char
)
- Understand the concept of type conversions (casting)
- Know how to print values using the
printf
instruction
- Know how to read values using the
scanf
instruction
- Know the concept of undefined behavior
- Be able to write simple programs that combine multiple programming concepts (e.g., input, processing, output)
Expressions
- Understand the concept of C expressions
- Know how to use arithmetic operators (
+
, -
, *
, /
, %
)
- Know how to use increment operators (
++
, --
)
- Know how to use relational operators (
<
, >
, ≤
, ≥
, ==
, !=
)
- Know how to use logical operators (
&&
, ||
, !
)
Conditional Execution
- Know how to use the
if
statement to execute code based on a condition
- Know how to use the
else
statement to provide an alternative when the condition is not met
- Know how to write chained conditionals (i.e., multiple
if / else if / else
statements) to evaluate multiple conditions in sequence
- Understand how to write nested conditionals, where an
if
statement appears inside another if
block
Iteration and Loops
- Understand the concept of iteration and how it is used to repeat code based on conditions
- Know how to write a
while
loop using a condition to stop the loop
- Know how to write a
for
loop to provide variable initialization, variable update and a condition to stop the loop
- Understand the behavior of the
break
statement to exit a loop early
- Understand the behavior of the
continue
statement to skip the current iteration and move to the next
Functions
- Understand the concept of a function as a reusable block of code that performs a specific task
- Know how to define a function, how it can receive arguments and how to call it in a program
- Understand how functions that return values can pass data back to the calling code using the
return
statement
- Understand the concept of flow of execution in a program, including how the program jumps to a function and returns after execution
Arrays
- Understand the concept of an array as a fixed size collection of data items
- Know how to declare and initialize an array
- Know how to read and change array values using indices
- Understand how loops and functions can be used to process arrays
- Understand the concept of multidimensional arrays
Strings
- Understand the concept of a C string as a character array
- Understand the
char
type and how we can use it with arithmetic operators
- Know how to read and print strings and how to pass them as arguments of functions
- Know the essential functions of the
string.h
library: strlen
to find string length and strcmp
to compare strings
Algorithms
- Learn how to understand a problem by carefully reading and analyzing it, ensuring that you fully comprehend what is being asked
- Know how to organize your solutions logically before jumping into writing the code and the concept of
- Understand modular programming (dividing the code into smaller, more manageable pieces or functions) and incremental development (testing each block of code before moving on to the next)
- Understand the importance and best practices in algorithm correctness and efficiency
- Understand the concept of searching and the differences in efficiency between sequential and binary search
Recursion
- Understand the concept of recursion as a problem-solving approach where a function calls itself
- Understand the base case and recursive case as fundamental components of any recursive function
- Be able to identify simple problems that can be effectively solved using recursion