Step 1: Brainstorm App Ideas
___ Idea 1: Daily Workout Suggestion App This app will help users choose a workout based on their fitness goals and available time. ___ Idea 2: Vacation Destination Picker The app will guide users to a vacation spot based on their preferences (beach, city, adventure). ✔️ Idea 3: Meal Planner The app will suggest meals based on dietary restrictions, preferences, and available ingredients.
Step 2: Element ID’s
- inputDietaryRestrictions
- inputMealPreference
- inputIngredients
- btnSuggestMeal
- outputMealSuggestion
- msgError
Step 3: Variables
| Name | Information Stored | Variable Type | |------------------------|-------------------------------------------------|----------------| | dietaryRestrictions | User's dietary restrictions | string | | mealPreference | User's meal preference | string | | ingredients | Ingredients user has available | string | | suggestionCount | Total number of meal suggestions generated | number |
Step 4: Flowchart for Conditional Statements
- Start
- Get user input for dietary restrictions, meal preference, and ingredients.
- Check if dietaryRestrictions is empty OR mealPreference is empty:
- If TRUE: Display error message.
- If FALSE: Go to next step.
- Check if available ingredients include necessary components for the meal:
- If TRUE: Suggest a meal based on preference.
- If FALSE: Suggest alternative meals based on dietary restrictions.
- End.
Step 5: Design User Interface
- Title: "Meal Planner App"
- Text Inputs:
- Dietary Restrictions (Element ID: inputDietaryRestrictions)
- Meal Preference (Element ID: inputMealPreference)
- Ingredients Available (Element ID: inputIngredients)
- Button:
- Suggest Meal (Element ID: btnSuggestMeal)
- Output Box:
- Meal Suggestion (Element ID: outputMealSuggestion)
- Error Message Box:
- Message (Element ID: msgError)
(Sketch not included; please visualize a simple layout with labels and inputs organized vertically)
Step 6: Description of App Functionality
- The user opens the app and is presented with three text input boxes and a button.
- The user enters their dietary restrictions (e.g., "vegetarian"), preferred meal type (e.g., "dinner"), and available ingredients (e.g., "tomato, pasta").
- The user clicks the "Suggest Meal" button, triggering a function to process the inputs.
- The function checks if any inputs are missing. If so, it displays an error message.
- If all information is present, the app checks the ingredients against a predefined list of meals.
- The app suggests a meal based on the user's input, and updates the output box.
- The user can repeat the process as desired.
Step 7: Code Your App
Below is a rough representation of what the code might look like:
// Function to update the meal suggestion based on user inputs
function updateMealSuggestion() {
// Getting user inputs
var dietaryRestrictions = getText("inputDietaryRestrictions");
var mealPreference = getText("inputMealPreference");
var ingredients = getText("inputIngredients");
// Clear the error message
setText("msgError", "");
// Check if any input is empty
if (dietaryRestrictions === "" || mealPreference === "") {
setText("msgError", "Please provide all inputs.");
return;
}
// Logic to determine meal suggestion
if (ingredients.includes("pasta") && mealPreference === "dinner" && dietaryRestrictions === "vegetarian") {
setText("outputMealSuggestion", "You can make a Vegetarian Pasta!");
} else if (mealPreference === "lunch") {
setText("outputMealSuggestion", "How about a salad?");
} else {
setText("outputMealSuggestion", "Sorry, no options available for your selections.");
}
}
// Event Listener for button click
onEvent("btnSuggestMeal", "click", function() {
updateMealSuggestion();
});
Step 8: Debugging
Remember to utilize the debug console and variable watcher to ensure variables are being updated correctly.
Steps 9-11: Submission
- Create a video demonstrating the app running, showcasing input, functionality, and output.
- Take a screenshot of the code in text format with your name visible.
- Submit both video and screenshot to Schoology, and submit the project in App Lab.
This checklist and outline should guide you through your project development efficiently! Good luck!