Labs

1. Introduction
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:

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:

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:

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:

7. Linux CLI

7. Linux

Home task:

  • Reminder: Homework 1 deadline!

In class:

8. Test 1, pseudo-random numbrers and revision

8. Test + pseudo-random and revision tasks

Home task: Prepare for test 1

In class:

9. Functions

9. Functions

Home: complete unfinished tasks

In class:

10. Functions continued

10. Functions continued

Home: complete unfinished tasks

In class:

11. Strings

11. Strings

Home: complete unfinished tasks

In class:

12. Command line arguments

12. Command line arguments

Home: complete unfinished tasks

In class:

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

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.