Describe the overloaded insertion operator function

Assignment Help Basic Computer Science
Reference no: EM131681376

Question: a. Design a Meal class with two fields-one that holds the name of the entrée, the other that holds a calorie count integer. Include a constructor that sets a Meal's fields with parameters, or uses default values when no parameters are provided.

b. Include an overloaded insertion operator function that displays a Meal's values.

c. Include an overloaded extraction operator that prompts a user for an entrée name and calorie count for a meal.

d. Include an overloaded operator+()function that allows you to add two or more Meal objects. Adding two Meal objects means adding their calorie values and creating a summary Meal object in which you store "Daily Total" in the entrée field.

e. Write a main()function that declares four Meal objects named breakfast, lunch, dinner, and total. Provide values for the breakfast, lunch, and dinner objects. Include the statement total = breakfast + lunch + dinner; in your program, then display values for the four Meal objects. Save the file as Meal.cpp.

f. Write a main()function that declares an array of 21 Meal objects. Allow a user to enter values for 21 Meals for the week. Total these meals and display the calorie total for the end of the week. (Hint: You might find it useful to create a constructor for the Meal class.) Save the file as Meal2.cpp.

Reference no: EM131681376

Questions Cloud

Angry because their new neighbors in the apartment complex : Linda and Larry are angry because their new neighbors in the apartment complex, Dale and Donna, seem to hold late-night parties every Thursday.
Identify the current health care delivery system : Choose a developed country (other than the United States) and identify the current health care delivery system.
Identify potential risk management issues : Identify potential risk management issues with using an open air football stadium for a concert venue and how would address them?
What are root cause of disproportionate minority confinement : What are the root causes of disproportionate minority confinement? What additional factors affect disproportionate minority confinement and minority youth?
Describe the overloaded insertion operator function : Design a Meal class with two fields-one that holds the name of the entrée, the other that holds a calorie count integer.
Analyze how and why this has made things more convenient : Discuss at least two ways in which HTML5 has improved the way web designers and developers work with images.
Determine the deficit or area of need : Data set - this is the set of data that you are using to determine the deficit or area of need. It can be class data, school data, district data or state data.
Determine the special populations in health care : Discuss these methods and give one example of how each would be used when conducting research using homeless individuals as subjects.
Describe laws passed to help ameliorate environmental issues : Describe the laws passed to help ameliorate the environmental issues in the U.S. or around the world related to these three impacts.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd