Вы находитесь на странице: 1из 2

2a) Hydrotake was created using appinventor, a block-based coding language.

The purpose of
Hydrotake, is to calculate and allow users to track how much water they should be drinking
based on their age, weight, and activity level. Hydrotake also allows users to log into a personal
account, which can track the total number of days they have been logging water and the total
number of days they met their goal. My video displays the sign up, calculate, and track progress
functions.
2b) When beginning hydrotake, I was planning on it being a simple water calculating and track
program. However, I saw opportunities to make the program better by developing the ability for
users to create their own username/password. In order to do this, I used firebase to allow for
people to create a login, so that their data would be saved and so that they could see their
progress overtime. This was a collaborative development of the program.
While writing the code to calculate how much water was needed per day, I ran into
problems with exact calculations. In order to resolve these problems, I first tried using the
modulo block to get an exact number, however this caused the results to be inaccurate. I then
tried to change my numbers and sequencing of the calculations. I retraced each step until I was
able to find that using the round block, allowed for exact calculation of the total water intake.
This was an independent development of the program.

Figure 1

2c) The above algorithm, figure 1, is vital to the program because it allows users to log how
much water they are drinking. The first if/then statement is checking the global target amount to
ensure an amount has been calculated, and it also checks to see if anything has been inputted in
the textbox. If something has been, it calls the next if/then statement to see if the amount entered
is above 20. If the entered amount is >20, it asks the user to confirm it. If it is <20, then it calls
the logadrink procedure, which stores the amount that had just been logged.

Figure 2

2d) This abstraction (figure 2), is used to calculate the amount of water that is needed for an
individual. It used mathematical operations to calculate the needed amount, while also checking
to see which level of activity was selected to that the correct amount of water could be
calculated. This abstraction contains a lot of repetition, and makes it easier to edit and read the
code. This manages the complexity of the program, because it allows the main code to be more
clear and easier to debug.

Вам также может понравиться