Arvutiteaduse instituut
  1. Kursused
  2. 2020/21 sügis
  3. Programmeerimise alused II (MTAT.03.256)
EN
Logi sisse

Programmeerimise alused II 2020/21 sügis

  • Home
  • Grading
  • Links

Homework 4

The deadline is Sunday, the 6th of December, 23:59 (Estonian time).

Exercise 1. Traffic sign

Choose a traffic sign (examples: https://en.wikipedia.org/wiki/Traffic_sign). Write a program that uses tkinter and its widget canvas to draw the traffic sign in the window with a white background. The title of the window has to be "Traffic Sign".

Exercise 2. Username from url

At the University of Tartu, every user of the Study Information System (a student or a member of staff) has his/her home directory. The user can create a webpage on the university server. The url for his/her webpage would be http://www.ut.ee/~username/ (e.g. http://www.ut.ee/~vilo/).

Write a program that prompts the user for a file name. The program has to read the file line by line, look for the user names (using regular expressions) and print the names out.

If the file urls.txt contains the following lines:

 http://www.ut.ee/~koit/KT/index_eng.html
 Lecture lasts ~90 minutes
 http://www.ut.ee/~vilo/
 http://www.ut.ee/~kiho/
 "x ~ y" means that x and y are of the same order of magnitude

then the output of the program has to be

 Please enter a file name: urls.txt
 The user names are:
 koit
 vilo
 kiho

Go to Moodle and upload your solution into Homework 4.

  • Arvutiteaduse instituut
  • Loodus- ja täppisteaduste valdkond
  • Tartu Ülikool
Tehniliste probleemide või küsimuste korral kirjuta:

Kursuse sisu ja korralduslike küsimustega pöörduge kursuse korraldajate poole.
Õppematerjalide varalised autoriõigused kuuluvad Tartu Ülikoolile. Õppematerjalide kasutamine on lubatud autoriõiguse seaduses ettenähtud teose vaba kasutamise eesmärkidel ja tingimustel. Õppematerjalide kasutamisel on kasutaja kohustatud viitama õppematerjalide autorile.
Õppematerjalide kasutamine muudel eesmärkidel on lubatud ainult Tartu Ülikooli eelneval kirjalikul nõusolekul.
Courses’i keskkonna kasutustingimused