Kana, Zvimwe
Not revised yet
#
Kana/Zvimwe chii?Pane dzimwe nguva dzekuti iwewe unogona kuda kuudza computer
kuti itarise uye ishandise chidimbu che code
mushure mekunge kana
chimwe chinhu chiri chokwadi, ndopanoshanda kana
. Kana chinhu ichocho chisiri chokwadi
, unenge uchiudza kuudza computer
kuti ishandise imwe
code
isiri muma brackets a kana
. Code
iyoyo inozoshandiswa inoiswa muma brackets a zvimwe
Kuti ugonzwisisa zvatiri kutaura pano, tichashandisa zvinhu izvi:
zvatichashandisa na Kana/Zvimwe
- ma
variable
enzaniso
nyora()
Kana usina kunzwisisa kuti ma variables
ne enzaniso
chii, unokurudzirwa kuverenga ma topic iwayo zvekare, uyezve unogona kubvunza mu group re whatsapp kuti ubatsirike
#
Mashandisirwo a Kana na Zvimwe#
Unoshanda kuzvitupaWapihwa basa kuzvitupa (National IDs)
Ngatimboti iwewe unoshanda kuzvitupa mu Zimbabwe. Mu Zimbabwe, munhu anobvumidzwa kutora chitupa kana achinge asvitsa makore 16. Ngatomboti iwewe basa rako nderekubvunza makore emunhu auya kuzotora chitupa. Kana
munhu akati ane makore 16 zvichienda mberi, uchamuudza kuti aende ku office kunotora chitupa, zvimwe
uchamuudza kuti anozodzoka kana aane makore 16.
Iwewe semunhu aakugona kushandisa ShonaScript
, ukuda kuita kuti munhu auya kuzotora chitupa audzwe zvekuita ne computer
. Saka uchanyora code
inoita izvi uchiteedzera masteps ari pazasi apa.
Ronga
variables
#
Step 1 : Kugadzira ma Tiri kuda kuzoenzanisa zvinhu 2 izvi:
- makore anobvumidzwa kuti munhu atore chitupa mu Zimbabwe
- makore emunhu auya kuzotora chitupa
Saka zvawaona kuti tichada kuzoshandisa enzaniso
, zvaakureva kuti tikufana kugadzira ma variables
2 aya:
makoreAnobvumidzwa
- Ndiyo
variable
yemakore anobvumidzwa kuti munhu atore chitupa (16 years)
makoreEMunhu
- Ndiyo
variable
yemakore e munhu auya kuzotora chitupa. Pakutanga apa ngatimboti makore emunhu auya kuzotora chitupa nhasi ane makore 15
Zvatapedza kuronga pa step 1, chinyora code
yacho seizvi:
Ita
- Pa
line 1
, nyora kuti
makoreAnobvumidzwa = 16
- Pa
line 2
, nyora kuti
makoreEMunhu = 15
se izvi:
Ma nhamba
ariku left ayo ndiwo ma nhamba emaline aunoona mu VS Code
Usanyore se izvi
Usagadzire variable yako uchiti:
makoreAnobvumidzwa = 16 years
Izvi hazviite nekuti ukadzokora kunoverenga nezve ma variables
, uchaona kuti computer
ichatarisa ku right side kwe equal sign (=) yobva yaona kuina 16 years
. Zvichaitika ndeizvi:
16 years
haasi muma quotes, saka haasimashoko
.16 years
haisinhamba
nekuti pane16
nayears
16 years
achaonekwa kungevariable
, computer ichakuudza kuti manyorero awaitavariable
iyoyo haasiriwo
Iwewe wanga ukuda kuenzanisa makore, saka makore i nhamba
, zvichireva kuti paunogadzira ma variable
ako, unofana kuisa nhamba ku right side kwe equal sign.
enzaniso
na kana
na zvimwe
#
Step 2: Kushandisa Zvekuita
- Pa
line 4
, nyora kuti:
kana makoreEMunhu iridiki pane makoreAnobvumidzwa {
- pa
line 5
, nyora kuti:
nyora("Uchiri mudiki, unozodzoka waane makore 16")
- pa
line 6
, nyora kuti:
} zvimwe {
- pa
line 7
, nyora kuti:
nyora("Enda ku Office kunotora chitupa")
- pa
line 8
, nyora kuti:
}
se izvi:
Tsananguro
Kana enzaniso iyo iri chokwadi
, tikuda kuti computer ishandise code
iri muma curly brackets {}
ekutanga. Asi kana
enzaniso
isiri chokwadi
tikuda kuti computer
ishandise code
iri muma curly bracket echipiri anoteera zvimwe
.
Tatyora Shona here?
Computer
inonzwisisa kuti makoreEmunhu
na makoreAnobvumidzwa
ma variables
. Saka computer
ichaverenga ichiti
kana variable
inonzi makoreEMunhu iridiki pane
variable
inonzi makoreAnobvumidzwa
Kana wapedza kunyora code yako, chiona kuti mu terminal
munonyorwa kuti chii.
Zvekare kuti unoita izvi kana uchida kuti code
yako isande
Zvekuita
Mu Application ye ShonaScript
- nyora code iri mupicture iri pamusoro apa
- baya bhatani re round riri pazasi pe screen
Kana kuti
Mu VS Code
- mu
index.shona
, nyoracode
iri mu picture - mu
terminal
nyora kutinode shona.js
, wobayaenter
- mu
terminal
zvekare, nyora kutinode index.js
, wobayaenter
Ukaita izvi zvakanaka, unofana kuona mu terminal
makanyorwa kuti:
Uchiri mudiki unozodzoka waane makore 16
Zvechokwadiwo makoreEMunhu
anga ari 15 zvichireva kuti haasi aakukwanisa kutora chitupa.
Zvekuita
Mu Application ye ShonaScript
- chinja
makoreEMunhu
kuti aite 18 se izvi:
makoreEMunhu = 18
- baya bhatani re round riri pazasi pe screen
Kana kuti
Mu VS Code
Chiisa makore akawanda kudarika 16
- mu
index.shona
, uchinje makoreEMunhu kuti aite 18 se izvi:
makoreEMunhu = 18
- mu
terminal
nyora kutinode shona.js
, wobayaenter
- mu
terminal
zvekare, nyora kutinode index.js
, wobayaenter
Ikozvino unofana kuona mu application kana kuti mu terminal
makanzi:
Enda ku Office kunotora chitupa