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

  Job satisfaction influence job performance

Explain why you agree or disagree with your results. Develop strategies to advance your career using your strengths. How can you use goal-setting to increase motivation and improve job performance? How might your engagement as an employee and job sat..

  Describe three main types of testing

What is Camtasia and why would you use it? What is the Windows Snipping Tool and why would you use it?

  Find some articles or research on project management

Do the same for key points that make project management easier for an Agile project.

  Write regular definitions for the following languages

Write regular definitions for the following languages

  Exploring website coding practices

From the e-Activity, describe what you learned about the Website that you selected by looking at the source code. Analyze the different components of the Website such as the version of HTML that was used, comment tags, and if the head elements wer..

  Analyze and evaluate interface design models

Use Microsoft Visio or an open source alternative, Dia, to create a total of two (2) graphical representations of your proposed interfaces, one (1) for the self-check-in and one (1) for the receptionist. Note: The graphically depicted solution is ..

  Local broadcasts cable-satellite

Personal Video Recorders (PVRs): Personal video recorders (PVRs) are digital video recorders used to record and replay television programs received from cable, satellite, or local broadcasts. However, unlike VCRs, which PVRs replaced, PVRs offer m..

  Name at least three things specified by an isa

Identify one advantage of programming in a higher-level language compared to a lower-level language. Identify one disadvantage.

  Intrusion detection system (ids), and authentication server.

Using the network diagram below, your task is to incorporate the devices on the lower right into the diagram to create a secure corporate network. The devices you need to incorporate into the network diagram include: Web server, ftp server, vulnerabi..

  Band of desired frequencies

What type of filter is used to eliminate a specific frequency from band of desired frequencies?

  What is the marginal distribution of majors

Do you think that college major appears to be independent of birth order? Explain.

  What could the bank do to increase the power

Only if the total points awarded for various aspects of an applicant's financial condition fail to add up to a minimum cutoff score set by the bank will the loan be denied.

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