Define a class named coffeeorder

Assignment Help Basic Computer Science
Reference no: EM131396133

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.

Reference no: EM131396133

Questions Cloud

Develop an understanding of what money is : Week 3 will help students develop an understanding of what money is, what forms money takes, how the banking system helps create money, and how the Federal Reserve controls the quantity of money. Students will learn how the quantity of money affec..
What does human imagination have to do with computer graphic : What does human imagination have to do with computer graphics? How do the words of Jesus and the apostle Paul relate? (how do those words help a computer graphicist do a good job?)
Write a summary of professional research : Prior to beginning work on this discussion, be sure to review the Graduate Research Guide for Psychology, Psychology Subject Guide, Academic Voice for Graduate Writing, and Professional Voice and Writing resources provided by the Ashford Universit..
Analyze the data and write a conclusion : Here are some data that I analyzed for an attorney. Of the 4200 white applicants at a large manufacturing facility, 390 were hired. Of the 850 black applicants, 18 were hired. Analyze the data and write a conclusion.
Define a class named coffeeorder : 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 ..
Analyze the data with x2 and write a conclusion : To find the expected frequencies, think about the chance of being correct or incorrect when there are three possible outcomes. Analyze the data with x2 and write a conclusion.
Topic-economic management : Topic: economic management Requirement: Reading 3 cases below, summary based on answer 6 questions below for 3 cases. Write a paragraph for each case (average 100 words for each case)
Describe detail one of procedures that need to be executed : SEC405- From the e-Activity, describe in thorough detail one of the procedures that need to be executed at the initiation of computer crime-scene investigation. Cite all your sources.
Situation to make riskless profits : Is there an arbitrage opportunity here? If so, explain exactly how you would take advantage of this situation to make riskless profits.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Create a test class that has comment as its reference class

Create a test class that has Comment as its reference class. Create a test that checks whether the author and rating details are stored correctly after creation. Record separate tests that check whether the upvote and downvote methods work as expe..

  Describe a situation that could cause a lost update

Describe a situation that could cause a lost update.

  Accounting for the different colleges

Write a 4-6 page concise opinion paper that discusses the purpose, characteristics, funding, and accounting for the different colleges and universities business models along with a summary of the pros and cons of each and an opinion of which model..

  Discuss the many ways in which access can be abused

Web authorization is central to the security of all Web applications. What is the best way to safeguard all Web applications and at the same time make Web access reliable and fast?

  Explain the manner in which users would benefit

Then, select one template and explain the manner in which users would benefit from using the template in question in creating either a business or personal document.

  Economy from a supply and demand standpoin

Discuss the sharing economy from a supply and demand standpoint. How do companies like Uber and Airbnb affect supply and demand in the markets for shared rides (taxis, limos, etc.) and rented rooms, respectively?

  Create the directory structure

The project team is ready to create the directory structure for the Web site. You are tasked with creating the directories and implementing the security mechanism. For this assignment, you need to create the following directory structure and p..

  More of the databases for computer networks

Using one or more of the databases for Computer Networks and Cyber Security, search for peer-reviewed journal articles about the communication theory or by the name of the person you selected to see if communication research on that theory has be..

  Dos attacks and password cracking

Identify three (3) DoS attacks and analyze the way in which each attack takes advantage of the interworking of the transport protocols (e.g.,TCP, IP, and UDP) and exploits the protocol's  vulnerabilities. Describe the protocols used for each attac..

  Experts suggest regarding search for information on internet

Which of the following do experts recommend regarding the search for information on the Internet? Avoid Boolean operators since new technology has made them obsolete.

  Do environmental chemicals cause congenital abnormalities

Perform the mechanics of the test. What is the P-value?

  Find some examples of tools that use snmp

How widely used is SNMP now? Find some examples of tools that use SNMP.

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