-
Notifications
You must be signed in to change notification settings - Fork 0
/
insure.html
178 lines (151 loc) · 2.75 KB
/
insure.html
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> Calculate the insurance amount </title>
</head>
<body>
<script type="text/javascript">
function calculate(zone,age,cc)
{
var zone; // a , b -- done
var cc; // <1000 1001-1500 1500 -- done
var age; // <5 5-10 >10 --------- done
var od; //
var act; // 670 800 2500 670 800 2500 -- done
var pa=100; // 100 all -- done
var ncb; // 20 25 35 45 50
var stax; // 10.3 % -- done
var cost;
var amount; // stores value
var random; //
// a starts from here
if (zone=="a")
{
if (cc<1000)
{
if (age<5)
{
od=3.127;
}
else if(cc>1000 && cc<1500)
{
od=3.283;
}
else if(cc<1500)
{
od=3.362;
}
act=670;
}
if (cc<1000)
{
if (age<5)
{
od=3.283;
}
else if(cc>1000 && cc<1500)
{
od=3.447;
}
else if(cc<1500)
{
od=3.529;
}
act=800;
}
if (cc<1500)
{
if (age<5)
{
od=3.440;
}
else if(cc>1000 && cc<1500)
{
od=3.612;
}
else if(cc<1500)
{
od=3.698;
}
act=2500;
}
amount=(cost*od)/100; // simple yo yo
random=amount+act+pa;
document.write(random);
alert("random");
return random;
}
// b starts from here
else if(zone=="b")
{
if (cc<1000)
{
if (age<5)
{
od=3.039;
}
else if(cc>1000 && cc<1500)
{
od=3.191;
}
else if(cc<1500)
{
od=3.267;
}
act=670;
}
if (cc<1000)
{
if (age<5)
{
od=3.191;
}
else if(cc>1000 && cc<1500)
{
od=3.351;
}
else if(cc<1500)
{
od=3.430;
}
act=800;
}
if (cc<1500)
{
if (age<5)
{
od=3.343;
}
else if(cc>1000 && cc<1500)
{
od=3.510;
}
else if(cc<1500)
{
od=3.594;
}
act=2500;
}
document.write(amount);
document.write(cost);
document.write(od);
amount=(cost*od)/100; // simple yo yo
random=amount+act+pa;
document.write(random);
//alert("random");
return random;
}
}
</script>
<form name="calinsure" action="" method="GET">
Zone <input type="text" name="zone" value="b"><Br>
Cost of Car <input type="text" name="cost" value="3000"><Br>
Age of Vehicle <input type="text" name="age" value="1"><Br>
CC of Engine <input type="text" name="cc" value="200"><Br>
NCB 20 <input type="radio" name="NCB" value="20"> 25 <input type="radio" name="NCB" value="25"> 35 <input type="radio" name="NCB" value="35"> 45 <input type="radio" name="NCB" value="45"> 50 <input type="radio" name="NCB" value="50"><Br>
<! Premium <input type="text" name="premium" value="calculate(zone,age,cc)">
<input type="submit" name="calc" value="Calculate Insurance" onClick="calculate(zone,age,cc)"><Br>
</form>
</body>
</html>