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

  Difference between active and a passive state for an object

What strategy would you propose for defining subsystems for a collection of classes?

  Evaluate how supply chain management systems

Analyze how people, information, and information technology help the company remain competitive in their industry. Analyze Porter's Five Forces Model in relation to competition within the industry of that corporation. Evaluate how supply chain manage..

  Where in a max-heap might the smallest element reside

Describe a simple modification to the BST that will allow it to easily support finding the Kth smallest value in Θ(log n) average case time. Then write a pseudo-code function for finding the Kth smallest value in your modified BST.

  Collection and analysis of significant and detailed cost

Project cost estimates require the collection and analysis of significant and detailed cost information. In the case study assignment, project costs are collected in a table in order to produce an overall cost estimate.

  Saas and cloud computing

SaaS and Cloud Computing

  Flow chart or an algorithm

Show, using a flow chart or an algorithm, how you would solve the problem as described. Write a pseudocode program according to your flow chart or algorithm. Write a draft program in ARM assembly language to solve the problem as described

  Grouping attributes in relational algebra

Explain the difference between using functions with and without grouping attributes in relational algebra. Give examples.

  Write the program to use ci n to read in distances

The program should be a loop that does this calculation until it receives a zero or negative number for input

  An information security professional

Imagine the university that employs you as an information security professional has recently identified the need to design and build a digital forensic laboratory. You have been tasked with designing the lab for the organization.

  What is the difference between turn and roll

What is the difference between turn and roll? What difference does it make if you change the order of instructions in a particular world? When you are finished, click Tools on the menu bar, and then click World Statistics to see how long your Alic..

  How are sdlc processes supported in cmmi

Do CMMI standards support iterative software development? How are SDLC processes supported in CMMI? How are ISO standards different compared to other standards like CMM or IEEE? Do IEEE standards support iterative software development?

  Describe the context of an information system

Describe the context of an information system; compare the range of requirements gathering techniques; describe and apply feasibility study methods and approaches; develop system requirements models

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