Return to site

Code a Healthy Meal App

Educators & parents: You can do this Hour of Code Activity as a class or students can work on it independently. If you have any questions or need help, email info@codespeaklabs.com.

What should I eat for breakfast?

Sometimes it's difficult to make healthy choices when you're hungry and quickly want to find something to eat. There is a huge variety of health-related apps, which help nudge people to make better choices- things like keeping track of calories, ensuring certain types of nutritious foods are eaten, or helping to monitor exercise.

For today's coding project, we will be coding a Healthy Meal App using simplified JavaScript to help us make healthy decisions at the push of a button.

One of the most challenging parts of eating healthy is planning what we should eat ahead of time. That's where arrays come in handy. An array is a way to store a list of information in our app - in this case, we want our array to hold a list of healthy food items. That way we'll have it ready ahead of time and make it quicker and easier to make wise food choices in the future.

Can you think of a list (or an array) of foods that can be a part of a healthy meal?

Follow along in this video with Ms. Hayley to create a Healthy Meal App that can help anyone make the best decisions for breakfast, lunch, and dinner. You'll learn how to use arrays, as well as a few other essential skills for web programming like using coordinates, conditionals, and more!

To code along with her, you'll need to go to https://bitsbox.com/code.

broken image

Now you have your very own Healthy Meal App to help you plan any meal of the day!

Bonus challenge: Do you know someone who is vegetarian? Vegan? Allergic to peanuts? Customize the meal suggestions for their dietary needs and share your app with them so they know you were thinking of them!

#CSforGood

Want to go beyond Hour of Code and make another food app using simplified JavaScript? Check out this tutorial on how to program a virtual cookie! (All the yum without the any of the calories.) Or, if you're really ready to level up, check out this beginner Python tutorial.

If you had fun, check out our YouTube channel for more free coding projects like these! Go to youtube.com/codespeaklabs