-
Notifications
You must be signed in to change notification settings - Fork 0
/
cal_net.cpp
223 lines (195 loc) · 4.89 KB
/
cal_net.cpp
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
string SN;
cout << "Enter School Name :";
cin >> SN;
"\n";
int py;
cout << "Enter Present Year :";
cin >> py;
"\n";
string Fname;
cout << "Enter Your First Name :";
cin >> Fname;
"\n";
string Mname;
cout << "Enter Your Middle Name (enter 0 to skip) :";
cin >> Mname;
if (Mname=="0")
{
Mname='\0';
}
else{
string space=" ";
Mname.append(space);
}
"\n";
string Lname;
cout << "Enter Your Last Name :";
cin >> Lname;
"\n";
string PAN;
cout << "Enter PAN Number :";
cin >> PAN;
"\n";
int BP1;
cout << "Enter 1st Basic Pay :";
cin >> BP1;
int BP2;
cout << "Enter 2nd Basic Pay :";
cin >> BP2;
#ifndef ONLINE_JUDGE
// freopen("input.txt","r",stdin);
freopen("trial01.html", "w", stdout);
#endif
// Header
int pasty = py - 1;
int fy = py + 1;
string header;
ifstream headerread;
while (getline(headerread, header))
{
cout << header << "\n";
}
cout << "<h1 id=\"centre\">SALARY STATEMENT FOR THE YEAR " << pasty << "-" << py << " (A.Y. " << py << "-" << fy << ")</h1>\n";
cout << "<H3 id=\"centre\" >" << SN << " PRIMARY SCHOOL</H3>\n";
cout << "<H3 id=\"centre\" style=\"text-align:left;\">" << Fname << " " << Mname << Lname << "<span style=\"float:right;\"> PAN- " << PAN << " </span> </H3>\n";
// Header ends
string html_bp;
ifstream fileread("infile.txt");
while (getline(fileread, html_bp))
{
cout << html_bp << "\n";
}
int BP;
float MA = 500;
float HT = 400;
float PTAX = 200;
float GI = 60;
for (int i = 0; i < 13; i++)
{
if (i < 4)
{
BP = BP1;
}
else if (i < 12)
{
BP = BP2;
}
else
{
BP = BP1 * 4 + BP2 * 8;
MA = 500 * 12;
HT = 400 * 12;
PTAX = 200 * 12;
GI = 60 * 12;
}
float da = BP * 0.03;
float HRA = BP * 0.12;
float GS = BP + da + HRA + MA + HT;
float PF = BP * 0.06;
float TD = PF + PTAX + GI;
float NS = GS - TD;
int myr;
if (i<10)
{
myr=pasty-2000;
}
else if(i<12)
myr=py-2000;
else
myr='\0';
string month;
switch (i)
{
case 0:
month = "Mar-";
break;
case 1:
month = "Apr-";
break;
case 2:
month = "May-";
break;
case 3:
month = "Jun-";
break;
case 4:
month = "Jul-";
break;
case 5:
month = "Aug-";
break;
case 6:
month = "Sep-";
break;
case 7:
month = "Oct-";
break;
case 8:
month = "Nov-";
break;
case 9:
month = "Dec-";
break;
case 10:
month = "Jan-";
break;
case 11:
month = "Feb-";
break;
case 12:
month = "Total";
break;
}
cout << "<tr>\n";
if (i<=11){
cout << "<td>" << month << myr << "</td>"<<"\n";
}
else{
cout << "<td>" << month << "</td>"<< "\n";
}
cout << "<td>" << BP << "</td>"
<< "\n";
cout << "<td>" << da << "</td>"
<< "\n";
cout << "<td>" << HRA << "</td>"
<< "\n";
cout << "<td>" << MA << "</td>"
<< "\n";
cout << "<td>" << HT << "</td>"
<< "\n";
cout << "<td>" << GS << "</td>"
<< "\n";
cout << "<td>" << PF << "</td>"
<< "\n";
cout << "<td>" << PTAX << "</td>"
<< "\n";
cout << "<td>" << GI << "</td>"
<< "\n";
cout << "<td>" << TD << "</td>"
<< "\n";
cout << "<td>" << NS << "</td>"
<< "\n";
cout << "</tr>\n";
}
cout << "</table>\n";
cout << "<br>\n";
cout << "<br>\n";
cout << "<br>\n";
cout << "<br>\n";
cout << "<br>\n";
cout << "<p style=\"text-align:left;\">\n";
cout << " <strong>Signature of SI/S</strong>\n";
cout << " <span style=\"float:right;\">\n";
cout << " <strong>Signature of Teacher</strong>\n";
cout << " </span>\n";
cout << "</p>\n";
cout << "</body>\n";
cout << "</html>\n";
return 0;
}