C++ program An invoice contains a list of goods purchased in a store. One element of the list is a pair of goods - amount. To create an Invoice modeling class with fields: - list of purchased goods - associative array (map) with key object Stock and value its price In the Invoice class to implement: get () and set () methods for the list to work element by element methods for adding and removing goods • method for searching for a product by its code a method for calculating the amount paid for all purchases Add and change methods accept an Stock object as an argument. The search method returns a Stock object.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter13: Overloading And Templates
Section: Chapter Questions
Problem 15PE
icon
Related questions
Question
I need the answer as soon as possible
C++ program
An invoice contains a list of goods purchased in a store. One
element of the list is a pair of goods - amount. To create an
Invoice modeling class with fields:
- list of purchased goods - associative array (map) with key
object Stock and value its price
In the Invoice class to implement:
• get () and set () methods for the list to work element by
element
• methods for adding and removing goods
method for searching for a product by its code
a method for calculating the amount paid for all purchases
Add and change methods accept an Stock object as an
argument. The search method returns a Stock object.
class Stock {
int code;
std::string name;
double valuePerUnit;
int numberUnits;
public:
Stock::Stock() {
code
0;
%3D
name =
valuePerUnit = 1;
numberUnits = 1;
}
Stock::Stock(int c, std::string n, double v, int nu)
{
code = c;
name = n;
valuePerUnit = v;
numberUnits = nu;
}
Transcribed Image Text:C++ program An invoice contains a list of goods purchased in a store. One element of the list is a pair of goods - amount. To create an Invoice modeling class with fields: - list of purchased goods - associative array (map) with key object Stock and value its price In the Invoice class to implement: • get () and set () methods for the list to work element by element • methods for adding and removing goods method for searching for a product by its code a method for calculating the amount paid for all purchases Add and change methods accept an Stock object as an argument. The search method returns a Stock object. class Stock { int code; std::string name; double valuePerUnit; int numberUnits; public: Stock::Stock() { code 0; %3D name = valuePerUnit = 1; numberUnits = 1; } Stock::Stock(int c, std::string n, double v, int nu) { code = c; name = n; valuePerUnit = v; numberUnits = nu; }
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning