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

Types of programming tasks

  • Avaleht
  • Tea ja mõista

Tuvasta
Kontrolli
Selgita

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

Kontrolli

Kirjeldus: Kontrolli programmi tulemit käsitsi.
Lahenduskeskkond: Lahendatakse arvutit jt abivahendeid kasutamata.

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

  • Mis kuvatakse programmi tulemusel käsureale?
  • Mis kuvatakse programmi tulemusel käsureale?
    for i in range(6, 25, 3):
        if i % 2 == 0:
            a = i
    print(a)
  • Mida tagastab programm antud sisendi(te) korral?4
  • Mis kuvatakse programmi tulemusel käsureale, kui sisestatakse 6 ja 2?
    a = int(input("Sisesta a väärtus: "))
    algus = int(input("Sisesta loenduri algväärtus: "))
    
    for i in range(algus, 5):
        if i<3 and a<=6:
            a += 3
        elif i>3 and a>6:
            a -= 2
    print(a)
  • Mitu korda täidetakse tsüklit?4
  • Mitu korda täidetakse tsüklit?
    arv = 24
    while int(arv) != 1:
        if arv % 2 == 0:
            print(arv)
            arv = arv // 2
        else:
            arv = arv % 2

Selle ülesande võiks kokku panna Selgita ülesandega, kus on vaja selgitada programmi tööd. Õpilane võib küll olla koodist õigesti aru saanud, kuid kusagil on tulnud sisse väike näpuviga ning kahe tüübi ühildamisel ei karista me teda väikese vea eest.

  • 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