Labs

Note: Future labs can change

1. Introduction
2. Conditionals

Conditionals

Extended lab description

Homework:

In class:

3. Loops

Loops

Extended lab description

Homework:

  • Expand and improve the food scale program
    • Menu has to have 2 levels
      • First level chooses the product category (e.g. vegetables, fruits, …). Have at least 3 categories!
      • Second level chooses the product from that category. Each category has to have at least 3 products!
    • Show error messages for invalid input! Must support the following:
      • No product on scale / negative weight
      • Unknown category / category does not exist
      • Unknown product / product does not exist

In class:

4. Functions

Functions

Extended lab description

Homework: Create a UML diagram that matches your week 3 lab task 2 behavior (cash register with loops).

  • Emphasis on correct modelling of loops
  • Code and UML must be logically identical, including order of operations
  • Turn extra attention to modelling the loop logic correctly – initialization, condition, loop body etc.
  • Reminder: You need to state your intent rather than copy-paste the expressions from the code!

In class:

5. Arrays

Arrays

Extended lab description

Homework: Finish lab tasks that are not yet submitted.

In class:

6. Arrays continued

Arrays continued

Extended lab description

Homework: Write a program based on the task description: Age classifier

In class:

  • Lab tasks are given under the extended lab description!
7. Sorting

Sorting

Extended lab description

Home task:

  • Take the provided code here: post.c
  • The code is based on Algorithm 5: package ratios.
  • Translate the algorithm from the code to UML in its entirety.
  • Each statement must have a worded out explanation what is being done or checked! Copy-pasting statements from code is considered is not sufficient (e.g. having an action just be minInd = i  does not explain what is being done!)
  • Details such as how many places after the comma to display or where to put a newline are not shown in the algorithm!

In class:

8. Standard streams and pseudorandom numbers

Standard streams and pseudorandom numbers

Extended lab description

Homework: No more weekly homework!

In class:

9. Matrices

Matrices

Extended lab description

In class:

10. Menu program

Menu program

Extended lab description

  • Lab task and information is detailed under the lab’s extended description
11. TEST
12. Linux CLI

Linux CLI

Extended lab description

In class:

13. Strings

Strings

Extended lab description

In class:

14. Command line arguments

Command line arguments

Extended lab description

In class:

15. Files

Files

Extended lab description

In class:

16. Examination

No normal lab on this week.

During this class, it’s possible to

  • Write the exam. You need to register to attend for it. Read more: exam.
  • Write a re-test for the test.