艾瑞克的 Hexo 空間

筆記-電費計算

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
<html>
<head>
<title>電費計算</title>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
</head>
<body>
<%
deg = Request.Form("txt1")
'Response.write deg
if deg >=0 and deg <=120 then
total_cost = deg * 1.63
cal_process = deg & " * 1.63 = " & total_cost
Response.write "Degree:" & deg &"<P>"
Response.Write "cal_process:" & cal_process
elseif deg >=121 and deg <=330 then
total_cost = (120-0)*1.63 + (deg-121)*2.38
cal_process = "(120-0)*1.63 + (" & deg & "-121)*2.38 = " & total_cost
Response.write "Degree:" & deg &"<P>"
Response.Write "Non Summer cal_process:" & cal_process
Response.write "<table border=1> <tr> <td>Degree</td> <td>Cost</td> <td>sum </tr> <tr> <td>0-120</td> <td>1.63</td> <td>195.6</td></tr> <tr> <td>" & "<B>" & deg & "</B>" &"(" & deg& "-121)" &" </td> <td>2.38</td> <td>" & (deg-121)*2.38 &"</td> </tr> <tr> <td>331-500</td> <td>3.52</td> <td></td> </tr> <tr> <td>501-700</td> <td>4.61</td> <td></td> </tr> <tr> <td>701-1000</td> <td>5.42</td> <td></td> </tr> <tr> <td>1001~</td><td>6.13</td> <td></td> </tr> <tr><td>deg<td>total<td><B>" & total_cost & "</B></td></td></tr></table>"
total_cost = (120-0)*1.63 + (deg-121)*2.10
cal_process = "(120-0)*1.63 + (" & deg & "-121)*2.10 = " & total_cost
Response.write "Degree:" & deg &"<P>"
Response.Write "cal_process:" & cal_process
Response.write "<table border=1> <tr> <td>Degree</td> <td>Cost</td> <td>sum </tr> <tr> <td>0-120</td> <td>1.63</td> <td>195.6</td></tr> <tr> <td>" & "<B>" & deg & "</B>" &"(" & deg& "-121)" &" </td> <td>2.10</td> <td>" & (deg-121)*2.10 &"</td> </tr> <tr> <td>331-500</td> <td>2.89</td> <td></td> </tr> <tr> <td>501-700</td> <td>3.79</td> <td></td> </tr> <tr> <td>701-1000</td> <td>4.42</td> <td></td> </tr> <tr> <td>1001~</td><td>4.83</td> <td></td> </tr> <tr><td>deg<td>total<td><B>" & total_cost & "</B></td></td></tr></table>"
elseif deg >=331 and deg <=500 then
total_cost = (120-0)*1.63 + (330-121)*2.38 + (deg-331)*3.52
cal_process = "(120-0)*1.63 + (330-121)*2.38 + (" & deg & "-331)*3.52 = " & total_cost
Response.write "Degree:" & deg &"<P>"
Response.Write "cal_process:" & cal_process
Response.write "<table border=1> <tr> <td>Degree</td> <td>Cost</td> <td>sum </tr> <tr> <td>0-120</td> <td>1.63</td> <td>195.6</td></tr><tr> <td>121-330</td><td>2.38</td><td>497.42</td></tr><tr><td>" & "<B>" & deg & "</B>" &"(" & deg & "-331) </td> <td>3.52</td> <td>"&(deg-331)*3.52 &"</td> </tr> <tr> <td>501-700</td> <td>4.61</td> <td></td> </tr> <tr> <td>701-1000</td> <td>5.42</td> <td></td> </tr> <tr> <td>1001~</td><td>6.13</td> <td></td> </tr> <tr><td>deg<td>total<td><B>" & total_cost & "</B></td></td></tr></table>"
total_cost = (120-0)*1.63 + (330-121)*2.10 + (deg-331)*2.89
cal_process = "(120-0)*1.63 + (330-121)*2.10 + (" & deg & "-331)*2.89 = " & total_cost
Response.write "Degree:" & deg &"<P>"
Response.Write "Non Summer cal_process:" & cal_process
Response.write "<table border=1> <tr> <td>Degree</td> <td>Cost</td> <td>sum </tr> <tr> <td>0-120</td> <td>1.63</td> <td>195.6</td></tr><tr> <td>121-330</td><td>2.10</td><td>497.42</td></tr><tr><td>" & "<B>" & deg & "</B>" &"(" & deg & "-331) </td> <td>2.89</td> <td>"&(deg-331)*2.89 &"</td> </tr> <tr> <td>501-700</td> <td>3.79</td> <td></td> </tr> <tr> <td>701-1000</td> <td>4.42</td> <td></td> </tr> <tr> <td>1001~</td><td>4.83</td> <td></td> </tr> <tr><td>deg<td>total<td><B>" & total_cost & "</B></td></td></tr></table>"
elseif deg >=501 and deg <=700 then
total_cost = (120-0)*1.63 + (330-121)*2.38 + (500-331)*3.52 + (deg-501)*4.61
cal_process = "(120-0)*1.63 + (330-121)*2.38 + (500-331)*3.52 + (" & deg & "-501)*4.61=<B>" & total_cost & "</B><P>"
Response.write "Degree:" & deg &"<P>"
Response.Write "cal_process:" & cal_process
Response.write "<table border=1> <tr> <td>Degree</td> <td>Cost</td> <td>sum </tr> <tr> <td>0-120</td> <td>1.63</td> <td>195.6</td></tr><tr> <td>121-330</td><td>2.38</td><td>497.42</td></tr><tr><td>331-500</td> <td>3.52</td> <td>594.88</td></tr> <tr><td>" & "<B>" & deg & "</B>" &"(" & deg &"-501)</td> <td>4.61</td> <td>" & (deg-501)*4.61&"</td> </tr> <tr> <td>701-1000</td> <td>5.42</td> <td></td> </tr> <tr> <td>1001~</td><td>6.13</td> <td></td> </tr> <tr><td>deg<td>total<td><B>" & total_cost & "</B></td></td></tr></table>"
total_cost = (120-0)*1.63 + (330-121)*2.10 + (500-331)*2.89 + (deg-501)*3.79
cal_process = "(120-0)*1.63 + (330-121)*2.10 + (500-331)*2.89 + (" & deg & "-501)*3.79=<B>" & total_cost & "</B><P>"
Response.write "Degree:" & deg &"<P>"
Response.Write "Non Summer cal_process:" & cal_process
Response.write "<table border=1> <tr> <td>Degree</td> <td>Cost</td> <td>sum </tr> <tr> <td>0-120</td> <td>1.63</td> <td>195.6</td></tr><tr> <td>121-330</td><td>2.10</td><td>497.42</td></tr><tr><td>331-500</td> <td>2.89</td> <td>594.88</td></tr> <tr><td>" & "<B>" & deg & "</B>" &"(" & deg &"-501)</td> <td>3.79</td> <td>" & (deg-501)*3.79&"</td> </tr> <tr> <td>701-1000</td> <td>4.42</td> <td></td> </tr> <tr> <td>1001~</td><td>4.83</td> <td></td> </tr> <tr><td>deg<td>total<td><B>" & total_cost & "</B></td></td></tr></table>"
elseif deg >=701 and deg <=1000 then
total_cost = (120-0)*1.63 + (330-121)*2.38 + (500-331)*3.52 + (700-501)*4.61 + (deg-701)*5.42
cal_process = "(120-0)*1.63 + (330-121)*2.38 + (500-331)*3.52 + (700-501)*4.61 + (" & deg & "-701)*5.42 = <B>" & total_cost & "</B><P>"
Response.write "Degree:" & deg &"<P>"
Response.Write "cal_process:" & cal_process
Response.write "<table border=1> <tr> <td>Degree</td> <td>Cost</td> <td>sum </tr> <tr> <td>0-120</td> <td>1.63</td> <td>195.6</td></tr><tr> <td>121-330</td><td>2.38</td><td>497.42</td></tr><tr><td>331-500</td> <td>3.52</td> <td>594.88</td></tr> <tr><td>501-700</td> <td>4.61</td> <td>917.39</td> </tr> <tr><td>" & "<B>" & deg & "</B>" & "(" & deg &"-701)</td> <td>5.42</td> <td>" & (deg-701)*5.42 &" </td> </tr> <tr> <td>1001~</td><td>6.13</td> <td></td> </tr> <tr><td>deg<td>total<td><B>" & total_cost & "</B></td></td></tr></table>"
total_cost = (120-0)*1.63 + (330-121)*2.10 + (500-331)*2.89 + (700-501)*3.79 + (deg-701)*4.42
cal_process = "(120-0)*1.63 + (330-121)*2.10 + (500-331)*2.89 + (700-501)*3.79 + (" & deg & "-701)*4.42 = <B>" & total_cost & "</B><P>"
Response.write "Degree:" & deg &"<P>"
Response.Write "Non Summer cal_process:" & cal_process
Response.write "<table border=1> <tr> <td>Degree</td> <td>Cost</td> <td>sum </tr> <tr> <td>0-120</td> <td>1.63</td> <td>195.6</td></tr><tr> <td>121-330</td><td>2.10</td><td>497.42</td></tr><tr><td>331-500</td> <td>2.89</td> <td>594.88</td></tr> <tr><td>501-700</td> <td>3.79</td> <td>917.39</td> </tr> <tr><td>" & "<B>" & deg & "</B>" & "(" & deg &"-701)</td> <td>4.42</td> <td>" & (deg-701)*4.42 &" </td> </tr> <tr> <td>1001~</td><td>4.83</td> <td></td> </tr> <tr><td>deg<td>total<td><B>" & total_cost & "</B></td></td></tr></table>"
elseif deg >=1001 then
total_cost = (120-0)*1.63 + (330-121)*2.38 + (500-331)*3.52 + (700-501)*4.61 + (1000-701)*5.42 + (deg-1001)*6.13
cal_process = "(120-0)*1.63 + (330-121)*2.38 + (500-331)*3.52 + (700-501)*4.61 + (1000-701)*5.42 + (" & deg & "-1001)*6.13 = <B>" & total_cost & "</B><P>"
Response.write "Degree:" & deg &"<P>"
Response.Write "cal_process:" & cal_process
Response.write "<table border=1> <tr> <td>Degree</td> <td>Cost</td> <td>sum </tr> <tr> <td>0-120</td> <td>1.63</td> <td>195.6</td></tr><tr> <td>121-330</td><td>2.38</td><td>497.42</td></tr><tr><td>331-500</td> <td>3.52</td> <td>594.88</td></tr> <tr><td>501-700</td> <td>4.61</td> <td>917.39</td> </tr> <tr><td>701-1000</td> <td>5.42</td> <td>1620.58</td> </tr> <tr> <td>" & "<B>" & deg & "</B>" &"(" & deg &"-1001)" & "</td><td>6.13</td> <td>" & (deg-1001)*6.13 & "</td> </tr> <tr><td>deg<td>total<td><B>" & total_cost & "</B></td></td></tr></table>"
total_cost = (120-0)*1.63 + (330-121)*2.10 + (500-331)*2.89 + (700-501)*3.79 + (1000-701)*4.42 + (deg-1001)*4.83
cal_process = "(120-0)*1.63 + (330-121)*2.10 + (500-331)*2.89 + (700-501)*3.79 + (1000-701)*4.42 + (" & deg & "-1001)*4.83 = <B>" & total_cost & "</B><P>"
Response.write "Degree:" & deg &"<P>"
Response.Write "Non Summer cal_process:" & cal_process
Response.write "<table border=1> <tr> <td>Degree</td> <td>Cost</td> <td>sum </tr> <tr> <td>0-120</td> <td>1.63</td> <td>195.6</td></tr><tr> <td>121-330</td><td>2.10</td><td>497.42</td></tr><tr><td>331-500</td> <td>2.89</td> <td>594.88</td></tr> <tr><td>501-700</td> <td>3.79</td> <td>917.39</td> </tr> <tr><td>701-1000</td> <td>4.42</td> <td>1620.58</td> </tr> <tr> <td>" & "<B>" & deg & "</B>" &"(" & deg &"-1001)" & "</td><td>4.83</td> <td>" & (deg-1001)*4.83 & "</td> </tr> <tr><td>deg<td>total<td><B>" & total_cost & "</B></td></td></tr></table>"
end if
%>
</body>
</html>

運算結果

avatar
下載-Pan Download 百度網盤下載工具