CodeGym/Java tanfolyam//További leckék a szinthez

További leckék a szinthez

Szint, Lecke
Elérhető

Egy újabb szint áll mögötted! Az előző leckéken tanult az if-else feltételes kijelentésről és a hozzá kapcsolódó árnyalatokról. Megismerkedtünk egy speciális adattípussal: a logikai értékkel. Példákat vizsgáltunk összehasonlító operátorok és logikai változók használatára. Végül többet megtudtunk a hivatkozások és a karakterláncok összehasonlításáról.

Ha úgy érzed, hogy egy kicsit több elmélet és néhány vizuális példa biztosan nem árt, akkor folytasd: itt van néhány hasznos cikk linkje.

Egyenlő és a karakterláncok összehasonlítása

Az objektumok összehasonlítása eltér a primitív adattípusok összehasonlításától. Valószínűleg már sejtette, miért van ez így. Az objektumok esetében utalást adunk át, de a primitíveknél egy értéket... Még sok érdekes árnyalat van, amelyekről ebből a cikkből megtudhat. Szokás szerint élénk példákon keresztül járjuk körül a témát.

Háromtagú operátor

Kezdők számára ez nagyon szokatlan fenevad. Nagyjából teljesen meg lehet csinálni nélküle... de a háromtagú operátor olyan egyszerűen és gyönyörűen lerövidíti a kódot! És pont erre kell törekednie egy kezdő programozónak. Ha még nem volt ideje alaposan megismerkedni az if-else konstrukció helyettesítésével, akkor azt javasoljuk, hogy ismerje meg jobban, és lassan fűzze bele a kódjába.


4
Feladat
Java Syntax,  szintlecke
Zárt
Labels and numbers
Not all labels are equally useful, but sometimes a lack of labels results in chaos. Let's do a task that dishes out labels: use the keyboard to enter an integer, and make the program indicate whether the number is negative or positive (or zero), and even or odd. Why do we need this? Just because, for practice. After all, we're here to learn!
8
Feladat
Java Syntax,  szintlecke
Zárt
Describing numbers
Suppose we need to separate numbers according to some criteria. For example, based on whether they are even or odd, or based on the number of digits. Have you got a picture of that in your mind? And now for the work: we'll write a program that describes the number entered by the user (it must be in the range from 1 to 999). The description will indicate whether the number is even or odd, and how many digits it has.
4
Feladat
Java Syntax,  szintlecke
Zárt
Positive number
At the "Optimist" school, the scale used to assess knowledge has neither an upper nor lower bound. This pleases young gifted people (wouldn't you be happy to receive a score of a bazillion for a presentation?). All scores above zero are considered good. Scores below zero are bad. Students must pass final exams in three subjects. We need to enter three scores from the keyboard, and display the number of positive scores.
4
Feladat
Java Syntax,  szintlecke
Zárt
Positive and negative numbers
Data analysis starts with a simple concept: we need to understand what data matters and should be used, and what data should be discarded. Let's solve a simple data analysis problem. We enter three integers from the keyboard, then we'll analyze them and display the number of positive and negative numbers in the source set.
2
Feladat
Java Syntax,  szintlecke
Zárt
Code entry
Sometimes you don't need to think, you just need to hammer it out! As paradoxical as it may seem, sometimes your fingers will "remember" better than your conscious mind. That's why while training at the secret CodeGym center you will sometimes encounter tasks that require you to enter code. By entering code, you get used to the syntax and earn a little dark matter. What's more, you combat laziness.
Hozzászólások
  • Népszerű
  • Új
  • Régi
Hozzászólás írásához be kell jelentkeznie
Ennek az oldalnak még nincsenek megjegyzései