1. Introduction

- Slides: Introduction
- Slides: Hello
- Slides: Conditionals
- Pretest example

Done in class:

2. Loops

Homework:

- Algorithm in UML: Convert the given algorithm into valid UML format: [link]

- Algorithm in UML and C program code: employee wage calculation
- User is asked for the start and end times of work and number of days worked during a month
- User is asked for the hourly wage
- Calculate how much would the employee make in a day and for the whole month
- E.g.
- Start 9, end 16, hourly wage 11, days in a month 21.
- Results: Daily income 77, monthly income 1617.

- Advanced: Also read in minutes, results must include 2 places after comma.

- Assistance: Introduction to algorithms and UML

In class:

- Possibility to do the pretest
- Slides: Conditionals v2
- Slides: Loops

3. Arrays

### 3. Arrays

Homework (For detailed description, look into the loops slides)

- sum.c algorithms (2 pcs) in UML using modeling tools
- Create a calendar application

In class:

- Math.h library introduction
- Slides: Arrays

4. Arrays continued

### 4. Arrays

Homework (For detailed description, look into the loops slides)

- ATM algorithms (2 pcs)
- Client wishes to withdraw money
- Validate the input
- Output the least possible number of bank notes
- 2 solutions – one with loops, other without loops
**Use this pseudocode to help you**

- Create a program in C
- Client wishes to withdraw money
- Validate the input
- Output the maximum number of unique bank notes

In class:

- UML: Algorithm (3)
- UML: Algorithm (7)
- Create a program in class based on the Algorithm (7)
- Advanced 1: Find numbers that have additive inverses (e.g. 5 and -5). Display the pairs.
- Advanced 2: Find numbers that occur multiple times,
- Advanced 3: Remove duplicates so that only the unique numbers are kept in the array. You’re allowed to store the result in a new array.

5. Sorting

### 5. Sorting

Home task:

- Algorithm in UML (Using CAD tools):

Find and output cargo weigth ratios to their extremums alongside product codes. Details available on the slides [algortm(8)]

In class:

- Slides: numerical systems
- Algorithm: Differentiating binary and hexadecimal [algorithm (4)]
- Slides: bubble sort

Additional material for advanced task: initializing variables

6. Matrices

### 6. Matrices

Home task:

- Code the warehouses Algorithm (3)
- Notes and tips can be found in bubble sort slides

- Model the basic version of the bubble sort task in UML

In class:

- Slides: matrices
- Algorithm (6)

7. Linux CLI

### 7. Linux

Home task:

- Reminder: Homework 1 deadline!

In class:

- Test I information
- Slides: Linux
- Date verification: Algorithm (1) UML + code
- Wiki: Streams redirections
- Lab task #1 [input file] [expected result]
- Lab task #2 [guide and helping materials]

8. Test 1, pseudo-random numbrers and revision

### 8. Test + pseudo-random and revision tasks

Home task: Prepare for test 1

In class:

- Test 1
- Revision tasks

9. Functions

### 9. Functions

Home: complete unfinished tasks

In class:

- Slides: functions
- Basecode: warehouse_simple.c

10. Functions continued

### 10. Functions continued

Home: complete unfinished tasks

In class:

- Homework 2 introduction
- Slides: functions_continued
- Basecode
- Sample program: Linux
- Sample program: Windows

11. Strings

### 11. Strings

Home: complete unfinished tasks

In class:

- Slides: Strings
- Basecode for task 2
- Sample: Some simpler character assignments

12. Command line arguments

### 12. Command line arguments

Home: complete unfinished tasks

In class:

- Slides: argc, argv
- Sample calculator program [windows] [linux]
- Code sample: Accepting arguments at runtime

13 Test 2

### 13. Test 2

Home: complete unfinished tasks

In class:

- Test 2
- There is no topic this week. The time after the test is considered to be consultation to finish old tasks.

14. Microcontrollers

### 14. Microcontrollers

Home: complete unfinished tasks

- Materials for the lab (slides, basecode etc.)
**http://ati.ttu.ee/~hartz/basys-mx3/?dir=ENG/ProgI** - Supplemental slides on
**binary numbers** - Supplemental slides on
**binary operations**

15. Black box

### 15. Black box

Home: complete unfinished tasks

In class:

16. Retaking of test 1 and test 2 possible during the lesson. No regular class on this week. |