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:lu07:aufgaben:09 [2025/05/19 15:26] vdemiren:modul:m291:learningunits:lu07:aufgaben:09 [2025/05/20 12:58] (aktuell) – [Assignment G: Implementation of the calculation - 10'] vdemir
Zeile 8: Zeile 8:
  
 ===== Source ===== ===== Source =====
-{{ :en:modul:m291:learningunits:lu07:aufgaben:lu06.s08.zip | Extend the solution of LU06.S08}}+{{ :en:modul:m291:learningunits:lu07:aufgaben:lu06.s08.zip | Take the solution of LU06.S08source-code and extend it}}
  
 ===== Assignment ===== ===== Assignment =====
-In LU06.S08 we were programming a basic calulator by manipulation the values directly when clicking the buttons. This is convenient, but limits the possibilities of the calculator significantly. +In LU06.S08 we were programming a basic calulator by manipulation the values directly when clicking the buttons. This is convenient, but limits the possibilities of the calculator significantly. For example handling the divided-by-zero operation can hardly be handled with events only
  
-Therefore we need to do it, but this time by using a couple of methods +Thus, it is basically a similar assignment, but this time by using methods:
   * to set values of diggit1, diggit2 and the operator   * to set values of diggit1, diggit2 and the operator
   * to calulate the result   * to calulate the result
Zeile 19: Zeile 19:
  
 ==== Assignment A - 3' ===== ==== Assignment A - 3' =====
-  * A01: Copy the solution of LU06.s07 and name it **LU07.s09.html**+  * A01: Copy the solution of LU06.s08 and name it **LU07.s09.html**
   * A02: Make sure to have    * A02: Make sure to have 
     * the assignmen number in <h1> and      * the assignmen number in <h1> and 
Zeile 33: Zeile 33:
  
 ==== Assignment C - Variables - 1' ==== ==== Assignment C - Variables - 1' ====
-  * C01: A basic calculation **3 + 3  = 6** compraises several variables and their initial values:  +  * C01: A basic calculation, e.g. **3 + 3  = 6**compraises several variables and their initial values:  
-    * diggit1: 0  +  * C02: Set in the data-area: * diggit1: 0  
-    * operator: '' +  C03: operator: '+(default operation is an addition) 
-    * diggit2: 0 +  C04: diggit2: 0 
-    * result: 0+  C05: result: 0
  
 ==== Assignment D - Button for diggit 1 - 10' ==== ==== Assignment D - Button for diggit 1 - 10' ====
-  * D01: When clicking on one of them the content will be saved in the variable **diggit1**+  * D01: When clicking on the diggit keys of block one the content will be saved in the variable **diggit1**
   * D02: But unlike in the previous task, this time the click triggers a method **setDiggit1(dig1)**   * D02: But unlike in the previous task, this time the click triggers a method **setDiggit1(dig1)**
   * D03: Continue with the other three buttons in the same fashion.   * D03: Continue with the other three buttons in the same fashion.
Zeile 48: Zeile 48:
   * E01: When clicking the **+**-button the content will be saved in the variable **operator**   * E01: When clicking the **+**-button the content will be saved in the variable **operator**
   * E02: Check the result by displaying the content of the variable **operator** on the screen.   * E02: Check the result by displaying the content of the variable **operator** on the screen.
 +  * **Hint:** The other three basic operations (subtraktion, multiplication, division) are conducted in the same way.
    
 ==== Assignment F - Button for diggit 2 - 5' ==== ==== Assignment F - Button for diggit 2 - 5' ====
Zeile 56: Zeile 57:
  
 ==== Assignment G: Implementation of the calculation - 10'  ==== ==== Assignment G: Implementation of the calculation - 10'  ====
-  * G01: To execute our addition-operation we finally need a button **ENTER**. This triggers the method **caldResult(operator)** +  * G01: To execute our addition-operation we finally need a button **ENTER**. This triggers the method **caldResult()**. 
-  * G02: If the variable operator =+, then the calculation is an addition. In that case the result is **this.result = diggit1 diggit2**. Hint: subtraktion, multiplication and division are similiar to programm+  * G02: All relevant variables (diggit1, operator, diggit2) are set know, we are ready to finalize our calculation. 
-  * G03Display the result of the variable **result** on the screen.+  * G03: In the method **calcResult** we need to execute the calculation bases on the provided **operator**. 
 +    * If the operator is a **+** we calculate our result as **this.result this.diggit1 this.diggit2" 
 +    * And subsequentlyif the calculator is a minus**-** the result is calculated as **this.result = dthis.diggit1 - this.diggit2** 
 +    * The Multiplication and the division a conducted in the same fashion
 +  * G04Finally have the **result** displayed on the screen to check the correctness of your efforts.
  
 ===== Solution ===== ===== Solution =====
Zeile 67: Zeile 72:
 | diggit | Ziffer | | diggit | Ziffer |
 | initial values | Startwerte | | initial values | Startwerte |
-| to suffice ausreichen |+| to conduct umsetzten|
 | respectively | beziehungsweise | | respectively | beziehungsweise |
 | to compraise | umfassen | | to compraise | umfassen |
-| several | einige, etliche |+
  
 ---- ----
 [[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/lu07/aufgaben/09.1747661176.txt.gz
  • Zuletzt geändert: 2025/05/19 15:26
  • von vdemir