<commit_before># Java Fundamentals, HW 14 - Java & Android

You are given a work-in-progress binary calculator app. All of the UI has been done but it's missing code!

The calculator can only work with **binary numbers** and only has one operation: **add**.

Apart from that the calculator works as you would expect - there's a standard text display on the top
showing current input, a `CLR` button that resets the state completely, inputs are immediately reflected
on the top display, there is a `=` button that shows the result and the user can chain multiple additions
by pressing the `+` button instead of `=`. Refer to the _requirements_ below.

Hint: No UI changes are necessary, all of the work should be done in `CalculatorActivity`.

Here's a screenshot of the app:

![](calculator.png)

## Requirements

* Additions with up to 16-digit binary numbers must be supported

* Pressing `0` or `1` must be immediately reflected in the text display

![](req1input.gif)

* After pressing `+` the user must be able to input a new number from scratch

![](req2plusclears.gif)

* Inputting a number, pressing `+`, inputting another number and then pressing `=` should display the sum

![](req3addition.gif)

* The user must be able to keep _chaining_ values with `+`, i.e. the following must work:
  * Input `100`
  * Press `+`
  * Input `10`
  * Press `+` <-- calculator displays 110
  * Input 1
  * Press `+` <-- calculator displays 111
  * Input 1
  * Press `=` <-- calculator displays 1000

![](req4chain.gif)

* `CLR` completely resets the calculator to the initial state
<commit_msg>Move the initial screenshot higher in the initial image<commit_after># Java Fundamentals, HW 14 - Java & Android

You are given a work-in-progress binary calculator app. All of the UI has been done but it's missing code!

Here's a screenshot of the app:

![](calculator.png)

The calculator can only work with **binary numbers** and only has one operation: **add**.

Apart from that the calculator works as you would expect - there's a standard text display on the top
showing current input, a `CLR` button that resets the state completely, inputs are immediately reflected
on the top display, there is a `=` button that shows the result and the user can chain multiple additions
by pressing the `+` button instead of `=`. Refer to the _requirements_ below.

Hint: No UI changes are necessary, all of the work should be done in `CalculatorActivity`.

## Requirements

* Additions with up to 16-digit binary numbers must be supported

* Pressing `0` or `1` must be immediately reflected in the text display

![](req1input.gif)

* After pressing `+` the user must be able to input a new number from scratch

![](req2plusclears.gif)

* Inputting a number, pressing `+`, inputting another number and then pressing `=` should display the sum

![](req3addition.gif)

* The user must be able to keep _chaining_ values with `+`, i.e. the following must work:
  * Input `100`
  * Press `+`
  * Input `10`
  * Press `+` <-- calculator displays 110
  * Input 1
  * Press `+` <-- calculator displays 111
  * Input 1
  * Press `=` <-- calculator displays 1000

![](req4chain.gif)

* `CLR` completely resets the calculator to the initial state

{'fraction_non_alphanumeric': 0.08887507768800497, 'fraction_numerical': 0.01678060907395898, 'mean_word_length': 4.069291338582677, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1128964', 'n_tokens_mistral': 982, 'n_tokens_neox': 880, 'n_words': 458}