Let’s Eat Well and Healthy

Activity 2. Creating a model to determine the healthiness of food in Scratch

You will create a model for determining food healthiness by working with nutritional data from which you can conclude. You will use the Scratch platform to complete the task.

  1. Using the familiar Scratch block programming tool, create a food categorisation project. Log in to your profiles. Click the “Create” button to start your new project.
  2. Follow the instructions and steps detailed in Worksheet 2. Creating a model to determine the healthiness of food in Scratch.
  3. Share your project with the class.

 

Your project should allow for:

1. Interactivity and prediction:

  • Allow the user to add a new food and its nutritional values through interactive questions and answers.
  • Uses blocks for user input of text and answers.

 

2. Gives recommendations:

  • After the new food data is entered, the program should recommend whether the food is healthy or not.
  • Add messages and sounds to make the project more interactive and fun.

 

Sample Scratch project:

  1. Create conditional logic: Use if-then blocks to determine if the food is healthy.
  2. Data Entry: Use “ask [question] and wait” blocks for user data entry.
  3. Giving a response: Use “Say [message] in [seconds]” blocks to give a response and recommendation.

Use the Healthy, Moderately Healthy, and Unhealthy Foods table from Worksheet 1. List of foods and their data to reference the calorie amounts against which the program should return a response.

 

Sample code in Scratch:

 

Sample Scratch project with increased difficulty:

  1. Create a short questionnaire to determine whether a food (based on calories, fat, carbohydrates, and protein) is healthy, moderately healthy or unhealthy.
  2. Use question blocks, variables, and branching algorithms (“if-then-else”).
  3. Create your sprite or choose a ready-made sprite from the Scratch character library.

 

Sample code in Scratch:

 

 

To download: Worksheet 2. Creating a model to determine the healthiness of food in Scratch