Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help with the below C++ Program: Create a class that implements a cash register. A user of the cash register object should be able

Need help with the below C++ Program:

image text in transcribed
Create a class that implements a cash register. A user of the cash register object should be able to record the sale of up to 25 items. The program should loop until the user enters 'Q' to quit. When the user enters 'Q' the cash register should print the items and a total to the screen {don't worry about tax}. The program should loop, asking the user what they would like to do. There are 3 options: - P - Prompt the user for an item. This includes the item name and price. Store this information in the cash register as a separate object [an Cltem object}. I recommend storing the Cltem object in an array of Cltems {or an STL vector of Cltems if you wish}. - C - Calculate and display the total of all items stored in the cash register object. - Q - Quit the program if the user enters 'Q'. Your solution must contain the following: - A class named CRegister which contains a priv_ate::' array of Cltems. Use a function to add to the Cltem to the CRegister class (something like 'void AddltemiCltemSc item} I {your code goes here> }\". You will also need a way to store the current number of Cltems in the array. How you do that is up to you. - A class named Cltems that stores pn'y_atee' variables: string called name and a double called price. - A function called 'TotalMe" in the ERegister that loops over all of it's items and prints their name and the total. - A loop in main that loops until the user enters 'Q' or 25 items have been purchased. - Using only Accessor and Mutatorra' functions to get and set the data in the CFlegister and Cltem classes

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions