Course Page

Introduction to Programming Languages

Course information, working environment, assessment rules, laboratory organization, and links to all laboratory materials.

C programming UNIX / Linux student.agh.edu.pl Laboratories + Exam

Course Overview

General information about the course.

This course introduces students to procedural programming in C and selected basic elements of C++. The laboratories are designed to develop practical programming skills in a UNIX/Linux environment and to build good habits related to code formatting, compilation, debugging, and problem solving.

  • Main language: C
  • Additional topics: selected basic elements of C++
  • Working environment: student.agh.edu.pl
  • Programming tools: gcc, nano, indent, man
Important: Lectures are not mandatory according to the study regulations.

Course Structure

Lectures, laboratories, and the general learning path.

  • Lectures: 28 hours
  • Laboratories: 28 hours

The course begins with the UNIX/Linux environment, development tools, and the compilation pipeline. The second laboratory introduces formatted output, input with scanf, characters and ASCII codes, and the first examples of if-else and switch. Later laboratories introduce progressively more advanced topics such as:

  • structure of C programs, variables and basic types,
  • formatted input and output,
  • control statements and loops,
  • functions and multi-file programs,
  • arrays and strings,
  • pointers and dynamic memory,
  • structures and typedef,
  • files, linked lists, and selected elements of C++.

Working Environment

Recommended technical setup for laboratory work.

During the course we will use the AGH UNIX server:

student.agh.edu.pl

To use the server, activate your UNIX account in the AGH network services panel:

https://panel.agh.edu.pl

After logging in to the panel:

  1. Open UNIX accounts
  2. Activate the account on student.agh.edu.pl

SSH access

ssh your_login@student.agh.edu.pl
Access from outside the AGH network may require the AGH VPN (OpenVPN).
The first laboratory includes configuration of the English locale, nano, and indent, so no advanced setup is required before the class.

Assessment and Grading Rules

Rules for partial tests, laboratories, and the final exam.

Partial Tests During Lectures

Two partial tests are organized during the lecture time slots.

To be exempt from the final exam, a student must:

  • obtain at least 50% from each partial test, and
  • obtain at least 70% from both tests combined.
Combined percentage from partial tests Grade
70% – <80%4.0
80% – <90%4.5
≥90%5.0

Laboratory Grade

Laboratory work is based on programming tasks checked during subsequent classes.

Percentage Grade
50% – <60%3.0
60% – <70%3.5
70% – <80%4.0
80% – <90%4.5
≥90%5.0

Laboratory Tasks – Evaluation Rules

Starting from Laboratory 2, each task (for example ex1.c, ex2.c, etc.) is evaluated during the next laboratory session.

  • Each task is graded with a maximum of 2 points.
  • The program must:
    • work correctly,
    • follow the task requirements (file name, structure, output format, etc.),
    • be understood by the student — you may be asked to explain the code,
    • be properly formatted using indent.
  • Programs that do not compile receive 0 points.
A task is checked during the next laboratory session. The program must work correctly, follow the instructions, and be clearly written.

Formatting and Technical Requirements

  • All code must be edited using nano.
  • Code formatting must be done using indent with the configuration introduced in Laboratory 1.
  • The structure of the program may be checked directly in nano.
  • Improper formatting or missing indentation may result in point reduction.

Resubmission Rules

  • If a task is incomplete or incorrect, it may be corrected during the next laboratory session for a maximum of 1 point.
  • After that, the task receives 0 points.
Tasks are expected to be completed before the next laboratory session.
Regular work is essential. Laboratory tasks are not intended to be completed at the end of the semester.

Task Checklist

  • The file name is correct (for example ex1.c).
  • The program compiles without errors.
  • The program works correctly and produces the required output.
  • The code is formatted with indent.
  • The source code is readable in nano.
  • The student can explain the program and the used instructions.

Final Course Grade

The final course grade is calculated as the arithmetic mean of:

  • the percentage result from laboratories, and
  • the percentage result from the final exam, or from the partial tests if the student is exempt from the exam.

The final result is then rounded up to the nearest integer and converted into the final grade.

Laboratory Pages

Laboratories build a continuous path from basic C syntax to reusable modules and algorithms. Each laboratory has its own dedicated page with tasks and step-by-step instructions.

Laboratory 1 introduces the UNIX/Linux environment, development tools, code formatting, the compilation pipeline, and the difference between header files and libraries.
Laboratory 2 introduces formatted text output, right-aligned numeric output, input with scanf, ASCII codes, simple comparisons with if-else, a basic calculator using switch, and temperature conversion with an introduction to integer and floating-point division.
Laboratory 3 develops loops, repeated execution, user-defined functions, and extension of previous programs.
Laboratory 4 focuses on pattern generation, algorithmic thinking, and structured problem solving.
Laboratory 5 introduces structures, typedef, header files, include guards, and multi-file programs.
Laboratory 6 moves from geometric structures to real-world data. Students define a DAY structure and implement a function computing the number of days between two dates, including leap years and the Julian–Gregorian calendar transition.
Laboratory 7 introduces arrays as function parameters, pointer semantics, variable length arrays, and dynamic allocation with malloc, calloc, and free. Students also build a reusable array module with array.h and libarray.a.
Laboratory 8 continues Laboratory 7. Students extend the array module with sorting algorithms for long values, test them on static and dynamic arrays, and integrate bsort_l and isort_l into libarray.a.
Quiz: A practice quiz is available here: Quiz 1 – Review before the test.