Q3: Self-checkout machines provide a mechanism for customers to pay for purchases from a shop without...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Q3: Self-checkout machines provide a mechanism for customers to pay for purchases from a shop without direct input to the process by the shop's staff. Create a class called Checkout for performing checkout service in a shopping mall. Use char variable to represent the item, unsigned long to represent the barcode, float variables to represent the price and the weight as private data of the class. Provide a constructor that enables an object of this class to be initialized when it's declared Provide public methods that perform each of the following tasks: a. The operator & for printing the item, barcode, price and weight. b. A friend function called get price. This function would return the price when you provide it with an object and a barcode. This function should return -1 if the object's barcode doesn't match the input barcode. c. A friend function called get_price. This function would return the price when you provide it with an object and an item name. This function should return -1 if the object's item-name doesn't match the input item's name. Define the following array of objects as a database in your main. checkout a[3]={checkout("Sugar", 12345,1000,1), checkout("Rice", 13450,2000,2) checkout("Oil",13456,3000,1) }; Use get price function to return the price of the barcode (13450) and the item "Sugar" then print the results. [10 marks] Q3: Self-checkout machines provide a mechanism for customers to pay for purchases from a shop without direct input to the process by the shop's staff. Create a class called Checkout for performing checkout service in a shopping mall. Use char variable to represent the item, unsigned long to represent the barcode, float variables to represent the price and the weight as private data of the class. Provide a constructor that enables an object of this class to be initialized when it's declared Provide public methods that perform each of the following tasks: a. The operator & for printing the item, barcode, price and weight. b. A friend function called get price. This function would return the price when you provide it with an object and a barcode. This function should return -1 if the object's barcode doesn't match the input barcode. c. A friend function called get_price. This function would return the price when you provide it with an object and an item name. This function should return -1 if the object's item-name doesn't match the input item's name. Define the following array of objects as a database in your main. checkout a[3]={checkout("Sugar", 12345,1000,1), checkout("Rice", 13450,2000,2) checkout("Oil",13456,3000,1) }; Use get price function to return the price of the barcode (13450) and the item "Sugar" then print the results. [10 marks]
Expert Answer:
Related Book For
Organic Chemistry
ISBN: 978-1118133576
11th edition
Authors: Graham Solomons, Craig Fryhle, Scott Snyder
Posted Date:
Students also viewed these chemistry questions
-
Provide a mechanism for the following reaction. HCI CI
-
Provide a mechanism for the following reaction, based on your knowledge of the reaction of esters with Grignard reagents. OH MgBr (2 equiv.) Cl (2) NH,CI
-
Provide a mechanism for the following reaction. Draw a reaction energy coordinate diagram that illustrates the kinetic and thermodynamic pathways for this reaction. HBr Br+
-
What is step-down allocation? What are some criticisms of this allocation method?
-
Jim and Mary Jean are married and have two dependent children under the age of 13. Both parents are gainfully employed and during 2014 earn salaries as follows: $16,000 (Jim) and $5,200 (Mary Jean)....
-
Why might managers resist buying a more expensive piece of equipment, known to have a lower TCO, than a less expensive item?
-
Using any of the datasets that come with this text that include at least two quantitative variables and at least one categorical variable (or any other dataset that you find interesting and that...
-
Conglomerate Company purchased Individual Company for $860,000 cash. A schedule of the fair values of Individuals assets and liabilities as of the purchase date follows. 1. Make the journal entry...
-
How might the principles of Continuous Improvement, rooted in the ethos of empirical inquiry and relentless introspection, serve as a catalyst for the cultivation of a learning organization paradigm,...
-
Calculate the following four reliability coefficients using the Pearson product-moment correlation formula, correlate the scores to determine the reliability coefficient (xx). Show your work. 3....
-
Laura Cervantes. Laura Cervantes is a currency speculator and she sells eight June futures contracts for 500,000 pesos at the closing price quoted here: . a. What is the value of her position at...
-
Summarize the article titled "Supply chain integration and novelty-centered business model design: An organizational learning perspective" Authors: Taiwen Feng, Shan Yang, Hongyan Sheng. And also...
-
Make a program in c language Question 02 (18) Vital signs are measurements of the body's most basic functions. The four main vital signs routinely monitored by medical professionals and health care...
-
On January 1, Year 1, Goat CO, leased a machine from Ursula Co for a 4 year period ending December 31, 2024. - The equipment cost Ursula CO $956,000 and has an expected useful life of 5 years. -...
-
A loan arrangement in which a parent company reduces its political risk by using an intermediary bank rather than a direct transfer of funds to a subsidiary is called a(n) Multiple Choice parallel...
-
What are some disadvantages to using debt to fund your assets?
-
Consider an economy described by a Phillips curve, Tt = t_1+rt to, where > 0 is a parameter and t is the output gap: the log deviation of output in the Keynesian model from its level in the Classical...
-
Pedro Bourbone is the founder and owner of a highly successful small business and, over the past several years, has accumulated a significant amount of personal wealth. His portfolio of stocks and...
-
When 1-pentene reacts with N-bromosuccinimide (NBS), two products with the formula C5H9Br are obtained. What are these products and how are they formed?
-
Draw a hypothetical free-energy diagram for the SN2 reaction of iodide anion with 1-chlorobutane. Label the diagram as in Fig. 6.4, and assume it is exergonic but without specific values for G¡...
-
A group of oligosaccharides called Schardinger dextrins can be isolated from Bacillus macerans when the bacillus is grown on a medium rich in amylose. These oligosaccharides are all nonreducing. A...
-
Approximately 50,000 new titles, including new editions, are published each year in the United States, giving rise to a $25 billion industry in 2001. In terms of percentage of sales, this industry...
-
When you think of political persuasion, you may think of the effortsthat political campaigns undertake to persuade you that their candidate is betterthan the other candidate. In truth, campaigns are...
-
In late 2013, the taxi company Yourcabs.com in Bangalore, India, was facing a problem with the drivers using their platformnot all drivers were showing up for their scheduled calls. Drivers would...
Study smarter with the SolutionInn App