Prototype 1

For my prototype I wanted to get a good understanding of how I could use php to process data entered by users. My idea was that I would have a number of items that a user could select and after submitting that data, php would process it and convert those values into information which showed the user how much meat would need to be produced if everybody had the same diet.

As I just wanted to get a better understanding of how I would write the code for the project, I used chicken as my example, as it is much easier to calculate how many chicken legs there are in a chicken than it is to find out how many steaks there are in a cow (which is something I will inevitably have to do, and have started to research).

index

The page shown above allows the user to enter in the meat they eat, once they have entered the meat they eat (it’s supposed to be during the week), they hit the “calculate” button.

Screen Shot 2015-12-01 at 13.58.11

After the user has clicked the calculate button, the data is shown in a table. The quantity is added up to how many animals that amounts to (there are 2 chicken legs on a chicken so therefore 6 chicken legs make up 3 chickens.

Screen Shot 2015-12-06 at 17.55.51

After that I created a simple variable which calculated the total multiplied by 7 billion, which would show the user how many chickens it would take to feed everybody if the entire world ate the same amount each week.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s