General information:
Code:
UBPJO-039
Name:
Introduction to programming languages
Profile of education:
Academic (A)
Lecture language:
English
Semester:
Spring, Fall
Responsible teacher:
dr inż. Orzechowski Tomasz Marcin (tomeko@agh.edu.pl)
Academic teachers:
dr inż. Orzechowski Tomasz Marcin (tomeko@agh.edu.pl)
Module summary

Student will learn how to code algorithms in procedural programming language (including C language).

Description of learning outcomes for module
MLO code Student after module completion has the knowledge/ knows how to/is able to Connections with FLO Method of learning outcomes verification (form of completion)
Social competence
M_K001 Understands necessity of self-learning (progress) Project
Skills
M_U001 Student can code algorithms in C language. Activity during classes,
Test,
Execution of laboratory classes
M_U002 Student can use simple and structured data types in C language. Activity during classes,
Test,
Execution of laboratory classes
M_U003 Is able to search for information for self-education and problem solving Presentation,
Test results
M_U004 Can solve simple algorithmic tasks Project
M_U005 Can code algorithms in procedural programming language Project
Knowledge
M_W001 Student knows and understands fundamental definitions and concepts of computer science, knows architecture and operation of a simple computer, knows basic tasks of the operating system Completion of laboratory classes
M_W002 Knows and understands procedure-based programming language Examination
M_W003 Knows and understands classical algorithms Examination,
Activity during classes
M_W004 Student knows the basic structures of C language. Examination,
Activity during classes
M_W005 Knows and understands fundamental rules of algorithm development Examination
FLO matrix in relation to forms of classes
MLO code Student after module completion has the knowledge/ knows how to/is able to Form of classes
Lecture
Audit. classes
Lab. classes
Project classes
Conv. seminar
Seminar classes
Pract. classes
Zaj. terenowe
Zaj. warsztatowe
Others
E-learning
Social competence
M_K001 Understands necessity of self-learning (progress) - - + - - - - - - - -
Skills
M_U001 Student can code algorithms in C language. - - + - - - - - - - -
M_U002 Student can use simple and structured data types in C language. - - + - - - - - - - -
M_U003 Is able to search for information for self-education and problem solving - - + - - - - - - - -
M_U004 Can solve simple algorithmic tasks - - + - - - - - - - -
M_U005 Can code algorithms in procedural programming language - - + - - - - - - - -
Knowledge
M_W001 Student knows and understands fundamental definitions and concepts of computer science, knows architecture and operation of a simple computer, knows basic tasks of the operating system + - - - - - - - - - -
M_W002 Knows and understands procedure-based programming language + - + - - - - - - - -
M_W003 Knows and understands classical algorithms + - - - - - - - - - -
M_W004 Student knows the basic structures of C language. + - + - - - - - - - -
M_W005 Knows and understands fundamental rules of algorithm development + - - - - - - - - - -
Module content
Lectures:
  1. Introduction to statemens and loops (3h)

    • conditional statements;
    • the switch statement;
    • loops (while, for and do-while).

  2. Functions (3h)

    • the structure of functions;
    • values ​​returned by functions;
    • calling functions with parameters;
    • recursion.

  3. Arrays and pointers (4h)

    • pointers;
    • arrays;
    • static and dynamic memory allocation;
    • multidimensional arrays;
    • the main function arguments.

  4. Input-Output operations (2h)

    printf and scanf functions, code conversion, modifying, formatting, printing, reading data from the keyboard, reading from a test of data.

  5. Structures and unions (2h)

    complex data types;
    the use of structures and unions.

  6. Processing files (2h)

    opening files;
    reading and writing operations.

  7. introduction to C++ (4h)

    • A comparison of C and C ++;
    • Classes, fields, and methods;
    • Constructors and destructors in C++;

  8. Advanced elements of C++ (5h)

    • Inheritance in C++;
    • Passing variables by value (including the value of the pointer) and reference.
    • Operators overloading;
    • Templates.

  9. Introducing C (3h)

    • the structure of a C program;
    • constants and variables;
    • operators;
    • the main function;
    • the use of printf and scanf functions.

  10. Examination (2h)
Laboratory classes:
  1. Introduction to Ansi C (2h)

    • identify file types and their uses in ANSI C;
    • list the steps involved in processing ANSI C source code into an executable format.
    • list the main preprocessor directives used in ANSI C and use the #define and #include directives correctly.
    • correctly format functions and comments in ANSI C.
    • identify the four main datatypes and the main format specifiers used in ANSI C.
    • write a short C program that prints messages and displays user input on screen.

  2. Functions and Variables (3h)

    • declare local and external variables and distinguish between declarations and definitions in ANSI C.
    • identify the four datatypes used in ANSI C and detail their respective storage restrictions.
    • name the datatype qualifiers used in ANSI C and identify the datatypes with which they can be used.
    • list the rules for naming identifiers in ANSI C.
      distinguish between defining and initializing variables in ANSI C.
    • use shorthand suffixes while qualifying variables in ANSI C.
    • define and initialize variables in ANSI C.
    • identify the Boolean value of expressions and functions in ANSI C.
    • write an ANSI C program to accept and validate some simple user input.
    • use simple and compound assignment operators in ANSI C.
    • identify ANSI C’s arithmetic and relational operators and place them in the correct order of precedence.
    • identify the operators that have precise rules about the order of evaluation of their operands in ANSI C.
    • distinguish between library and user-defined functions and identify the basic elements of a function in ANSI C.
    • declare and define functions in ANSI C.
    • use header files in ANSI C.
    • write a function that converts temperature readings from Fahrenheit to Celsius in ANSI C.
    • write a program in ANSI C that raises one number to the power of another.
    • write a program with functions that pass parameters, using call by value in ANSI C.
    • distinguish between recursive and nonrecursive functions and list the advantages of recursion in ANSI C.
    • write an ANSI C program that uses recursion to calculate the factorial of a given number.

  3. Expressions and Flow Control (3h)

    • identify the Boolean value of expressions and functions in ANSI C.
    • write an ANSI C program to accept and validate some simple user input.
    • use simple and compound assignment operators in ANSI C.
    • identify ANSI C’s arithmetic and relational operators and place them in the correct order of precedence.
    • identify and use the logical operators in ANSI C.
    • identify and use bitwise operators in ANSI C.
    • use the comma operator in ANSI C.
    • use the conditional operator in ANSI C.
    • apply the rules of precedence and associativity in ANSI C.
    • identify the operators that have precise rules about the order of evaluation of their operands in ANSI C.
    • identify mixed datatypes in expressions and apply the rules of datatype conversion and type casting in ANSI C.
    • list the flow control mechanisms available and use the correct syntax for if, nested if, and if-else statements in ANSI C.
    • write an if-else statement in ANSI C.
    • differentiate between ANSI C’s three loop statements.
    • use the break and continue statements appropriately in ANSI C.
    • write nested loop statements in ANSI C.
    • identify appropriate scenarios for using the goto statement in ANSI C.
    • use the switch statement in ANSI C and distinguish between it and the if-else statement.
    • write a switch statement in ANSI C.

  4. Pointers and Arrays (3h)

    • define one-dimensional and multidimensional arrays and find the mean of an array in ANSI C.
    • write the code that reads an array in ANSI C.
    • initialize one- and two-dimensional arrays with constant data in ANSI C.
    • pass an array to a function in ANSI C.
    • write a program that stores user input in an array and then passes the array to a function in ANSI C.
    • format strings and string literals in ANSI C and distinguish between strings and character arrays.
    • identify the steps involved in extracting a substring from a string in ANSI C.
    • write the code that extracts a substring from a string using an array in ANSI C.
    • name the most common string-handling library functions in ANSI C and list their uses.
    • use the correct syntax when defining and initializing string pointers and string pointer arrays in ANSI C.
    • write a program that extracts a substring from a string using pointers in ANSI C.

  5. Structures (3h)

    • use the correct syntax when declaring and defining structures in ANSI C.
    • define and declare a structure in ANSI C.
    • declare and define nested structures, distinguish between valid and invalid structures, access structure members, and assign data to a structure in ANSI C.
    • write an ANSI program that will store user input in a structure.
    • define a structure array in ANSI C.
    • define pointers to structures, access structure members, user pointers with nested structures, and define an array of structure pointers in ANSI C.
    • pass structures to functions using both pointers and copies of structures in ANSI C.
    • write an ANSI C program that passes a structure to a function as a formal parameter and returns a structure.
    • use the correct syntax for bit fields in ANSI C and identify the advantages and disadvantages of using them.
    • distinguish between unions and structures and declare and define a union in ANSI C.
    • use pointers to link two structures in ANSI C.
    • use sizeof with variables, arrays, unions and structures, redefine datatype names with typedef in ANSI C.

  6. Advanced use of Pointers (3h)

    • use the correct syntax for defining and initializing pointers in ANSI C.
    • define and initialize pointers to different datatypes in ANSI C.
    • distinguish between access by reference and access by value and use access by reference to pass parameters to functions and structures in ANSI C.
    • list the rules of double indirection and pass pointers to pointers in ANSI C.
    • increment and decrement pointers in ANSI C.
      define and initialize function pointers and arrays of function pointers in ANSI C.
    • define and initialize arrays of pointers in ANSI C.
      match a set of ANSI C pointer declarations with their descriptions.
    • name the ANSI C functions responsible for allocating memory at runtime and identify their particular uses, allocate memory, using the malloc() function, and free memory, using the free() function.
    • list the differences between linked lists and arrays and code a linked list in ANSI C.

  7. Files (3h)

    • use the file pointer, open and close a file, get characters and strings from files, and put characters and strings into files in ANSI C.
    • list the characteristics of buffered I/O and identify the ANSI C functions that it uses.
    • complete the code that will create and write to a file, using buffered I/O functions in ANSI C.
    • list the common string handling functions in ANSI C and use them correctly.
    • list the characteristics of the argc and argv command-line arguments and use them to accept user input in ANSI C.

  8. Introduction to C++ (3h)

    • define the C++ concepts of encapsulation and data hiding.
      outline how classes can be defined and declared.
    • recognize how member functions are defined in a class.
      outline how C++ uses the access control specifiers public, private, and protected.
    • identify the scoping rules used in a C++ class.
    • outline the ways that C++ classes use static members.
    • describe how C++ classes use friend classes and functions to gain access to protected class members and outline how the const keyword is used in C++ classes.
    • outline how to code a program that implements a simple time object in C++ and write a code for a simple object.
    • outline how constructor and destructor functions work in a C++ program.
    • code a constructor and a destructor program.
    • identify the uses of inheritance and derived classes.
    • describe the difference between single inheritance and multiple inheritance and identify the major programming considerations that concern multiple classes.

  9. Manipulating Objects (3h)

    • identify how arguments are passed to called functions in C++.
    • outline how a this pointer is used to reference objects.
      outline how the new and delete keywords can be used to allocate memory dynamically.
    • recognize a program that uses a dynamically created object and outline how to write a program using dynamically allocated memory.
    • give an account of linked lists and fixed arrays and outline how pointers are used in creating and maintaining a linked list.
    • outline how nodes can be added to the head of a linked list.
    • identify methods of traversing and deleting a linked list.
    • outline how to implement a linked list and write code to add or remove nodes of a linked list.
      create a linked list in C++.

  10. Overloading (3h)

    • define polymorphism and give an account of how it is implemented using virtual functions.
    • implement a simple program using polymorphism.
    • state the function of operator overloading and outline its implementation as either member or friend functions.
    • outline the rules for implementing operator overloading.
    • give an account of overloading unary and binary operators.
    • identify the functions of casting operators and conversion constructors and outline how they are implemented.
    • give an account of how function templates are used.
    • outline how to use a function template to sort an array.
    • implement a simple function template in a program.
    • give an account of class templates

  11. Summary and Examination (1h)
Student workload (ECTS credits balance)
Student activity form Student workload
Summary student workload 150 h
Module ECTS credits 6 ECTS
Preparation for classes 54 h
Participation in laboratory classes 28 h
Participation in lectures 28 h
Realization of independently performed tasks 40 h
Additional information
Method of calculating the final grade:

Two partial tests will be conducted during lectures, and the final examination of the content of the whole course at the end of the course.

The final evaluation of the student from the lectures will be calculated on the basis of partial tests and final exam.
Student evaluation of the classes will be calculated as the average of the grades of selected exercises (projected and implemented applications) performed during the course.

Prerequisites and additional requirements:

.

Recommended literature and teaching resources:

.

Scientific publications of module course instructors related to the topic of the module:

.

Additional information:

.