Inspiration

LHD: Share, has given me the option to receive large sums of stickers by doing projects, so here I am.

What it does

The program gives you two options:

  1. To input the amount of steps you have ran and see whether you need to run more or not.
  2. See a healthy recipe

How we built it

I used Java to create this project

Challenges we ran into

There was a bug with my scanner.

Accomplishments that we're proud of

Being able to fix the bug.

What we learned

Health is cringe, play video-games all day

What's next for Create a Health Application

I might turn it into an Android app if I feel like learning how.

import java.util.Scanner;
import java.util.HashMap;

public class healthapp {
    private int steps;

    public healthapp(int amountOfSteps) {
        steps = amountOfSteps;
    }
    public static void main(String[] args) {
        System.out.println("Would you like to keep track of your steps or see a healthy recipe? Type in 1 for steps, type 2 for recipe");
        Scanner scanner = new Scanner(System.in);
        String input = scanner.nextLine();
        switch(input) {
            case "1":
                System.out.println("Please type in the amount of steps you have ran today.");
                int inputtedSteps = scanner.nextInt();
                healthapp app = new healthapp(inputtedSteps);
                System.out.println(stepCount(app.steps));
                scanner.close();
                break;
            case "2":
                System.out.println("We have 3 recipes shown below! Type one of them out to get the full recipe:\nSalad\nCheese\nCreatine");
                String recipe = scanner.nextLine();
                System.out.println(healthyRecipes(recipe));
                scanner.close();
                break;
        }
    }

    public static String stepCount(int stepAmount) {
        if(stepAmount < 5000) {
            return "Seems like you need to run some more! Get to it.";
        }
        else {
            return "Good job, you reached your daily goal! How about you treat yourself to pounds of junk food to regain all those calories you burned off, you deserve it!";
        }
    }

    public static String healthyRecipes(String chosenRecipe) {
        HashMap<String,String> healthyRecipes = new HashMap<String,String>();
        String lowerRecipe = chosenRecipe.toLowerCase();
        healthyRecipes.put("salad", "Salad: \n 1. get vegetables \n 2. smash them together \n 3. Done.");
        healthyRecipes.put("cheese", "Cheese.");
        healthyRecipes.put("creatine", "CREAINTE WOOOOOOO MMMM LOVE CREATINE MMMMMM.");

        return healthyRecipes.get(lowerRecipe);
    }
}

Built With

Share this project:

Updates