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
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:
- Open UNIX accounts
- Activate the account on student.agh.edu.pl
SSH access
ssh your_login@student.agh.edu.pl
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.
Formatting and Technical Requirements
- All code must be edited using
nano. - Code formatting must be done using
indentwith 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.
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 – UNIX Tools and Development Environment
- Laboratory 2 – Variables, Input, Output and Basic Control Flow
- Laboratory 3 – Loops, ASCII Tables and Repeated Calculations
- Laboratory 4 – Patterns, Algorithms and Simple Functions
- Laboratory 5 – Structures, Header Files and Multi-file Programs
- Laboratory 6 – Date Structures and Calendar Calculations
- Laboratory 7 – Arrays, Pointers and Dynamic Memory
- Laboratory 8 – Sorting Arrays of Long Integers
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.
typedef,
header files, include guards, and multi-file programs.
DAY structure and implement a function computing the number
of days between two dates, including leap years and the Julian–Gregorian calendar transition.
malloc, calloc,
and free. Students also build a reusable array module with
array.h and libarray.a.
long values, test them on static and dynamic arrays,
and integrate bsort_l and isort_l into libarray.a.