Institute of Computer Science
  1. Main page
  2. Types of programming tasks
ET
Log in

Types of programming tasks

  • Avaleht
  • Tea ja mõista
  • Rakenda ja analüüsi

Seosta
Teosta
Kohanda
Transleeri

  • Sünteesi ja hinda
  • Soovitused kontrolltööks
  • Kasutatud materjalid
  • Autorid

Kohanda

Kirjeldus: Muuda lahendus teise struktuuri (sisaldab teadmist mida ja kuidas muuta ning loomist).
Lahenduskeskkond: Olenevalt ülesande keerukusest lahendatakse kasutades arenduskeskkonda või arvutit jt abivahendeid kasutamata.

Ülesanded:
Näiteülesande nägemiseks/peitmiseks klikka tüübile.

  • Muuda etteantud kood uutele tingimustele vastavaks.1,3
  • Etteantavaid tingimusi võib olla mitmeid erisuguseid. Järgnevalt vaid mõned näited.
  • Muuda konstruktsiooni.2
  • Kirjuta etteantud programm, kasutades while-tsükli asemel for-tsüklit.
    aeg = int(input("Sisestage minutite arv: "))
    laike = 0
    loendur = 0
    
    while loendur < aeg:
        loendur += 1
        if loendur % 2 == 1:
            laike += loendur
    
    print("Laikide koguarv on " + str(laike) + ".")
  • Muuda kasutatavat andmestruktuuri.2
  • Kasuta järjendite asemel sõnastikku.
    nimed = ['Maie', 'Alma', 'Allan', 'Laine', 'Ülo', 'Ints']
    tulemused = [14, 10.6, 16.5, 9.2, 15, 13.1]
  • Institute of Computer Science
  • Faculty of Science and Technology
  • University of Tartu
In case of technical problems or questions write to:

Contact the course organizers with the organizational and course content questions.
The proprietary copyrights of educational materials belong to the University of Tartu. The use of educational materials is permitted for the purposes and under the conditions provided for in the copyright law for the free use of a work. When using educational materials, the user is obligated to give credit to the author of the educational materials.
The use of educational materials for other purposes is allowed only with the prior written consent of the University of Tartu.
Terms of use for the Courses environment