Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using C++ in AWS Cloud9: Sample Output: Create an application for tracking a person's nutritional intake for the day. The program should prompt the user

Using C++ in AWS Cloud9:

image text in transcribed

Sample Output:

image text in transcribed

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. Welcome to Nutrition Calculator! Please select your foods from the list below: : Apple 1: McNuggets 2: Instant Ramen 3: Enter custom item 4: Finish entering items 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. Welcome to Nutrition Calculator! Please select your foods from the list below: : Apple 1: McNuggets 2: Instant Ramen 3: Enter custom item 4: Finish entering items

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

Database Processing Fundamentals Design And Implementation

Authors: KROENKE DAVID M.

1st Edition

8120322258, 978-8120322257

More Books

Students also viewed these Databases questions

Question

What role do past costs play in tactical cost analysis?

Answered: 1 week ago

Question

Summarize what you learned from participating in this exercise

Answered: 1 week ago

Question

Discuss the key ambient conditions and their effects on customers.

Answered: 1 week ago

Question

Understand the roles of signs, symbols, and artifacts.

Answered: 1 week ago