Marks button

Today I made Marks button work. After clicking on this button a new activity opens and a user can see the screen like in the picture below.

To get an average mark a user has to type their marks in the space above in the float format, between every two numbers there has to be a gap.

After clicking on the Calculate an average button, a user gets an average of marks they typed in. See the picture below.

The difficulty I faced was reading all marks and interpreting them like float numbers, because before that I did this only with strings. I solved this problem using two lines of code:

String inputString = editText.getText().toString();
String[] input = inputString.split(" ");

Next steps to be made:

  1. To sharpen the design of my app.
  2. To make push-notifications.
  3. To think about database for marks.

Оставьте комментарий