Exercise

Before starting the exercises, make sure that you have Yarn installed and pull the latest tests from the parent repository

$ git pull parent master
$ yarn
$ cd week07
$ yarn

Should there be an issue with the first line, change it to

$ git pull https://gitlab.informatik.uni-halle.de/amsvu-teaching/client-seitige-web-anwendungen-uebungen.git

and then follow the instructions above. This should update the repository to the current state.

Tasks

Remember to run the tests to see if there are any issues with your code.

Task 1

In the Ember application add the necessary code to

  • Show a first-level heading with the text “Calculator”

Task 2

In the Ember application add the necessary code to

  • Show two number inputs named “a” and “b”
  • Show a select dropdown with the five calculator operations +, -, *, /, %

Task 3

In the Ember application add the necessary code to

  • Show a button
  • When the user clicks on the button, an element with the id “result” must be added to show the result.
  • The “result” element must only be shown when the user has run a calculation

Task 4

In the Ember application add the necessary code to

  • Add together the two values a and b when the user selects the “+” operator and clicks on the button
  • Show the full calculation in the element with the id “result”

Task 5

In the Ember application add the necessary code to

  • Subtract the value b from the value a when the user selects the “-” operator and clicks on the button
  • Show the full calculation in the element with the id “result”

Task 6

In the Ember application add the necessary code to

  • Multiply the two values a and b when the user selects the “*” operator and clicks on the button
  • Show the full calculation in the element with the id “result”

Task 7

In the Ember application add the necessary code to

  • Divide the value a by the value b when the user selects the “/” operator and clicks on the button
  • Show the full calculation in the element with the id “result”

Task 8

In the Ember application add the necessary code to

  • Calculate the modulo of dividing a by b when the user selects the “%” operator and clicks on the button
  • Show the full calculation in the element with the id “result”

Task 9

In the Ember application add the necessary code to

  • Show a history of past calculations in an element with the id “history”
  • The “history” element must not be visible before the user has started a calculation
  • Each entry in the history must be a link element <a> and the text content must be the same format as used in the “result” element

Task 10

In the Ember application add the necessary code to

  • Re-run a calculation from the history when the user clicks on an entry in the “history” element

Submitting

To submit follow these steps:

  1. Push all your changes into your repository by running

    $ git add week07
    $ git commit -m "PUT YOUR OWN MESSAGE HERE"
    $ git push
    
  2. Create a new text file called repository.txt and into that add the clone URL of your repository.

  3. Submit this file via the student submission platform (“Ember I”).