Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Nutrition Tracker Program Description Create an application for tracking a person's nutritional intake for the day. The program should prompt the user to choose a

Nutrition Tracker Program Description Create an application for tracking a person's nutritional intake for the day. The program should prompt the user to choose a food item from a list of options. The program should continue looping until the user enters the option to stop. At that time the total nutritional value of all of the food items selected should be combined and displayed. You may present the list of options as enumerated items with a description. For example, 1: Apple 2: French Fries 3: Burger 4: Instant Ramen 5: Protein Bar .... 11: Finished Once the user has finished selecting items, the program should display the total nutritional value of all the selected items and display some statistics to the user. Technical Requirements You should create a class to contain a "Food Item". This food item class should track the name of the food, calories, total fat, total sugars, protein, and sodium. The class' member variables should only be accessible via public accessors or mutators, if necessary. It should contain no public member variables. Override the addition operator to allow food items to be added together. The result of the addition should populate a class containing the combined nutritional value of the two items. Use this operator to sum up the nutritional value of all the food items selected by the user. The program should loop and continuously add new items into a total value represented by an instance of the "Food Item" class representing the day's total nutritional intake. The program should display at least 10 pre-populated items for the user to choose from. The program should also offer an option for the user to enter when they have completed selecting the foods consumed for the day. After all food entries have been entered into the console and the total nutritional value has been computed, display to the user if they have exceeded any of the recommended intakes for an average adult: Energy: Approximately 2,000 cal. Total fat: less than 70g. Total sugars: less than 30g. Protein: Approximately 50g. Sodium: less than 2,300 mg. Add an option for the user to enter a custom item in the list of food options. The user should be prompted to enter values for each of the item's nutrients and provide a name. This option should then show up in the list as a selectable option on the next cycle of the loop. Be sure to separate your class into a separate .h and .cpp files. How to Submit Upload your source files (.cpp, .h) here when completed.

in C++ please

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Visual Basic 2005 For Windows Mobile Web Office And Database Applications Comprehensive

Authors: Gary B. Shelly, Thomas J. Cashman, Corinne Hoisington

1st Edition

0619254823, 978-0619254827

More Books

Students also viewed these Databases questions