Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

a. Define a class named CoffeeOrder. Declare a private static field that holds the price of a cup of coffee as $1.25. Include private integer fields that you set to a flag value of 1 or 0 to indicate whether the order should have any of the following: cream, milk, sugar, or artificial sweetener. Include a public function that takes a user's order from the keyboard and sets the values of the four fields in response to four prompts. If the user indicates both milk and cream, turn off the milk flag to allow only cream. If the user indicates both sugar and artificial sweetener, turn off the artificial sweetener flag, allowing only sugar. Include another function that displays the user's completed order. Write a main()function that declares a CoffeeOrder object and calls the data entry and display methods. Save the file as Coffee.cpp.

b. Using the CoffeeOrder class, write a main()function that continues to ask a user for an order in a loop until the user indicates the order is complete or 10 orders have been placed, whichever comes first. After the user indicates that ordering is complete, display a recap of all the coffee orders, including the cream, milk, sugar, and sweetener status of each, as well as a count of the number of coffees ordered and the total price. Save the file as Coffee2.cpp.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92205948

Have any Question?


Related Questions in Computer Engineering

Systems analysis projectpersonal trainer inc owns and

Systems analysis project Personal Trainer, Inc. owns and operates fitness centers in a dozen Midwestern cities. The centers have done well, and the company is planning an international expansion by opening a new "superce ...

Subnetting1 as system administrator you need to create 10

Subnetting 1) As system administrator, you need to create 10 subnets for the Network Address: 192.168.1.0 with a minimum of 10 hosts per subnet. Room for future expansion to more subnets is desirable. Create a table with ...

Mark harris just received a cash gift from his grandfather

Mark Harris just received a cash gift from his grandfather. He plans to invest in a five-year bond issued by Cullumber Corp. that pays an annual coupon rate of 4.5 percent. If the current market rate is 7.50 percent, wha ...

The sales figures for a business are as follows for the

The sales figures for a business are as follows for the first six months of the year: R40 000, R44 000, R52 000, R64 000, R80 000, R84 000. The owner believes that the sales curve can be approximated by a quadratic funct ...

Under the trade model with external economies of scale is

Under the trade model with external economies of scale, is it possible for a country to be worse off with trade than it would have been without trade? Justify your answer.

A researcher working at a particular company wants to know

A researcher working at a particular company wants to know if workers' health would improve if they were given extra days 'off. In this company, all workers undergo a standard physical exam twice a year and after each ex ...

Refer to the reading e-business strategy how to benefit

Refer to the reading, "E-Business Strategy: How to Benefit From a Hype" and review its alignment between such models as SWOT and Five Forces and the e-business that it uses as a model. In your posting, address the follow ...

Question unless otherwise stated answer in complete

Question: Unless otherwise stated, answer in complete sentences, and be sure to use correct English spelling and grammar. Sources must be cited in APA format. Your response should be four (4) pages in length; refer to th ...

Discuss why a financial services organization would benefit

Discuss why a financial services organization would benefit from using one framework over another (COSO, COBIT,) -- choose a framework or frameworks that in your opinion would be most ideally suited for such an organizat ...

Question suppose you need to manually sort a hand of cards

Question : Suppose you need to manually sort a hand of cards. What techniques, other than a bubble sort, would you implement? Describe one or more algorithms at a high level.

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As