Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
en:modul:m291:learningunits:lu05:loesungen:10 [2025/03/04 12:06] vdemiren:modul:m291:learningunits:lu05:loesungen:10 [2025/03/28 10:50] (aktuell) vdemir
Zeile 1: Zeile 1:
-====== LU05.S09 - v-else-if and v-else ======+====== LU05.S10 - v-if and functions ======
  
-===== Sourcecode of the solution =====+===== Hints ==== 
 +  * Download the file and copy the content into the code area of the W3School on the left hand side of the coding window. 
 +  * You can execute the code by pressing the //run// button 
 +  * The result will be presented in the right hand side of the window.
  
-{{:en:modul:m291:learningunits:lu05:loesungen:m291_lu05_s09.zip | Sourcecode of the solution}}+===== Assignment 1 ====== 
 +As we are now capable to use //v-if// with logical values (true/false), and furthermore check actual values e.g. numbers, this assignment is about hoch to check //string-values// (words). For this we are going to use the function //text.includes()// within the //v-if//.
  
-===== Assignment ====== +  Execute the script. As you can see the content of the variable text is displayed on the screen as //text// contains the search-string //Pizza// with a kapital //P//. 
-The first assignment checked by using v-if whether a certain variable was checked or not (true/false9Bei der ersten Aufgabe hat v-if binären Werte (true/false) geprüft. Now, we want to go one step further and check not only whether it is true or false, but moreover which value it contains. By this, we would be able to tell the customer of how many typewriters we have in stock, which may be of some benefit for the customer as well as for us.+  - Now delete the word //Pizza// from the variable //text// in the script-area. Execute your script again.  
 +  - Note your realisations as a comment. 
 +  - Save your script acordingly, whether in your W3School workspace or locally in your Webstorm code-editor
  
-  - Change the value of the variable //typewriter// to 0 und execute the script.  +===== Assignment 2 ===== 
-  - Note your realisations as html-comment. +In the if paragraph there is a image of a pizza displayed as well 
-  - Change the content of the variable //typeWriter// to -1.  + 
-  - What happens, if the value //typeWiter// has no value at all respectively is empty? +  - Add section //v-else// with a according //img-tag// which shows a different image than a pizza. 
-  - Note your realisations as a html-comment. +  - Note your realisations as a code-comment. 
-  - Save your script acoordingly, whether in your W3School workspace or on you local computer in your code-editor Webstorm.+  - Save your script acordingly, whether in your W3School workspace or locally in your Webstorm code-editor 
 + 
 +===== Solution ===== 
 +{{:en:modul:m291:learningunits:lu05:loesungen:lu05.s10.zip | Source-code of the solution}} 
 + 
 +{{:en:modul:m291:learningunits:lu05:loesungen:lu05.s10.png| }}
  
-{{:en:modul:m291:learningunits:lu05:loesungen:lu05.s10.png?1000|Codesolution}} 
  
  
-===== Vocabulary ===== 
-^ English ^ German ^  
-| ... | ... | 
  
  
 ---- ----
 [[https://creativecommons.org/licenses/by-nc-sa/4.0/|{{https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png}}]] Volkan Demir [[https://creativecommons.org/licenses/by-nc-sa/4.0/|{{https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png}}]] Volkan Demir
 +  
  • en/modul/m291/learningunits/lu05/loesungen/10.1741086398.txt.gz
  • Zuletzt geändert: 2025/03/04 12:06
  • von vdemir