Question: IMPLEMENT THE addItem() and printReceipt() functions only in C++ . (you can add helper functions/variables if needed) // You are working in a company that
IMPLEMENT THE addItem() and printReceipt() functions only in C++. (you can add helper functions/variables if needed)
// You are working in a company that writes software to run on supermarket checkout systems. This is the interface of one of the components in the system:
class ShoppingCart {
/*
called every time the cashier swipes a new item
barcodeString: string output of a barcode scanner
number: number of instances of this item being added
*/
void addItem(string barcodeString, int number){
}
// outputs a formatted receipt to stdout.
void printReceipt();
}
/*
The expected format of the receipt is:
Item Unit price Quantity Total
Pear $1.20 2 $2.40
Apple $0.30 3 $0.90
Total: $3.30
focus on code quality, maintainability, and testability.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
