Warning
This page is located in archive. Go to the latest version of this course pages. Go the latest version of this page.

Computer Lab 02, variables, conditionals

admin

please check your official faculty email, see http://www.fel.cvut.cz/en/user-info/ for more details. Making the official e-mail address working and reading it regularly is vital. This is the information channel for important messages from the Faculty and also from the course teachers.

puzzle

  • a new weekly puzzle to train the brain
  • discussion about the Lena problem

practical work

We will practice exercises from Wentworth2012.

  • 2.14.5
  • 2.14.7
  • 2.14.8

input function helps in reading user input. Certain values are naturally positive (greater than zero). You program should check this and return something like Error: waiting hours must be grater than zero in case the user inserts a negative number.

  • Create a script that reads a number of hours from standard input (and checks whether a number was given), and prints to standard output the corresponding number of days and hours. E.g., when the script gets 51 as the number of hours, it shall print something like 51 hours is 2 days and 3 hours. If you have issues with creating such a string, just print 2 and 3.

homework

  • Read chapters 4 and 5 from the book Wentworth2012. We will not use Turtles, though.
courses/be5b33prg/labs/week_02.txt · Last modified: 2018/10/12 11:13 by iscenahm