-
Notifications
You must be signed in to change notification settings - Fork 0
/
Children.h
68 lines (58 loc) · 1.48 KB
/
Children.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#include <iostream>
#include "Cloths.h"
#include <string>
#include <sstream>
#include <cstring>
#include <string.h>
#include <fstream>
#include "mainfunction.h"
#include "Invoice.h"
#ifndef Children_H
#define Children_H
using namespace std;
class Children : public Cloths
{
private:
friend class Add;
public:
static int children_count;
float children_price;
static float total_children_amount;
Children()
{
children_count += 1;
cout << " Enter Children Dress ID, Name and Price.\n";
cout << "\t Children Dress ID: ";
cin >> dressid;
cout << "\t Children Dress Name: ";
cin >> dressname;
cout << "\t Children Dress Price: ";
cin >> price;
children_price = price;
total_children_amount += children_price;
system("cls");
/// Building a file entry combining all infos
string childrenProduct, strDressId, strPrice, dressType = "Children";
ostringstream ostrDressId, ostrPrice;
ostrDressId << dressid;
strDressId = ostrDressId.str();
ostrPrice << price;
strPrice = ostrPrice.str();
childrenProduct = strDressId + " " + dressType + " " + dressname + " " + strPrice + "\n";
/// Writing to file
fstream productFile;
productFile.open("Products.txt", ios::app);
if (!productFile)
cout << "File not Created!";
else
{
productFile << childrenProduct;
productFile.close();
}
/// Going back to main menu after successful inserting male product
mainMenu();
}
};
int Children ::children_count = 0;
float Children ::total_children_amount = 0;
#endif