```

Demotilanne:

  • Pisteet päivittyvät pienellä viiveellä.
  • Värit: Punainen - puutteellinen. Vihreä - hyväksytty (vähintään 6p, joista 2p tähtiä)
# aikajana
Tiedot päivittyvät 6 tunnin välein. Viimeksi:

Please to interact with this component.

{}


Osa-alue 0
1
2
3
4
5
6
7
8
9
10
11
12
12
12
Luennot 1&2 3&4 5&6 7&8 9&10 11&12 13&14 15&16 17&18 19&20 21&22 23&24
Deadlinet HT1 (suu-
nnitelma)
Väli-
kysely
Debug-
näyte

HT2
(50%)
Tentti-
ilmo
HT3
(100%)
HT4 (esit-
tely)
Tentti
Ohjaus 1 2 3 4 5
Demo 0 1 2 3 4 5 6 7 8 9 10 11 Summa d%
Pisteet

Please to interact with this component.

{}

Please to interact with this component.

{}

Please to interact with this component.

{}

Please to interact with this component.

{}

Please to interact with this component.

{}

Please to interact with this component.

{}

Please to interact with this component.

{}

Please to interact with this component.

{}

Please to interact with this component.

{}

Please to interact with this component.

{}

Please to interact with this component.

{}

Please to interact with this component.

{}

Please to interact with this component.

{}

Please to interact with this component.

{}

Korjattu

Please to interact with this component.

{}

Please to interact with this component.

{}

Please to interact with this component.

{}

Please to interact with this component.

{}

Please to interact with this component.

{}

Please to interact with this component.

{}

Please to interact with this component.

{}

Please to interact with this component.

{}

Please to interact with this component.

{}

Please to interact with this component.

{}

Please to interact with this component.

{}

Tunnit

Please to interact with this component.

{}

Please to interact with this component.

{}

Please to interact with this component.

{}

Please to interact with this component.

{}

Please to interact with this component.

{}

Please to interact with this component.

{}

Please to interact with this component.

{}

Please to interact with this component.

{}

Please to interact with this component.

{}

Please to interact with this component.

{}

Please to interact with this component.

{}

Please to interact with this component.

{}

Please to interact with this component.

{}

Please to interact with this component.

{}

Please to interact with this component.

{}

# fields

Ohjelmointi 1, syksy 2024 / Demo 1

Tehtävät perustuvat luentoihin: 01 ja 02.

OPPIMISTAVOITTEET

Täytä sitä mukaa, kun koet oppineesi uusia asioita. Työkirja-sivulla näet yhteenvedon kaikkien demojen osalta.

# Oppimistavoitteet

PP6

PP1

Tee funktio joka laskee (ja palauttaa) tuotteen alkuperäisen hinnan kun viedään parametrina ''alennettu hinta'' ja alennusprosentti (nollasta sataan). Tee pääohjelma josta kutsut tekemääsi funktiota ja tulostat sen antaman arvon. Huomaa, että funktio, missä alkuperäinen hinta lasketaan, ei saa tulostaa mitään.

# pp1

PP2

Tee ohjelma joka toimii seuraavasti.

Montako lukua arvotaan ? > 10
Montako arvontaa suoritetaan? > 10000
Arvottiin seuraavasti:
0: 1029 kertaa
1: 1016 kertaa
2: 968 kertaa
3: 992 kertaa
4: 989 kertaa
5: 1067 kertaa
6: 1012 kertaa
7: 984 kertaa
8: 961 kertaa
9: 982 kertaa

Vinkki: Voit arpoa kokonaislukuja väliltä 0-9 kirjoittamalla seuraavasti:

Random r = new Random();
...
r.Next(10);

Huomaa kuitenkin, että Random-oliota ei saa luoda silmukan sisällä. Toisin sanoen, new Random()-kutsu täytyy tehdä ennen silmukkaa.

# pp2

PP3

Jatka edellistä ohjelmaa niin, että se tulostaa lopuksi myös:

Yleisin luku oli : 5 (1067 kpl)

Kopioi edellisen tehtävän vastauksesi alle ja tee tarvittavat muutokset/lisäykset siihen.

# pp3

Lisätehtäviä

Jos sinulla jäi edellisistä PP-tehtävistä jotain tekemättä, voit tehdä niitä. Voit myös tehdä tämän viikon demoja.

These are the current permissions for this document; please modify if needed. You can always modify these permissions from the manage page.