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 5

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

Exercise 1. Fractal

The following image contains examples of a fractal (orders 1, 2, 3, 4 and 5). Write a recursive function which takes the order number and the length of the tree (a tree is the fractal of order 1) as the arguments, and draws the fractal of the corresponding order. Demonstrate the work of your function drawing the fractal of order 5.

Exercise 2. Sum of the first n numbers

Write a recursive function that returns the sum of the first n integers. For example, the sum of the first 6 numbers is 6+5+4+3+2+1=21.

Go to Moodle and upload your solution into Homework 5.

  • 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