-
Notifications
You must be signed in to change notification settings - Fork 0
/
calc.html
115 lines (65 loc) · 4.47 KB
/
calc.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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- RWB -->
<link rel="stylesheet" type="text/css" href="css/calc.css" /> <!-- Including CSS file-->
<script src="JavaScript/calc.js"></script> <!-- Including JavaScript file-->
<title>Calculator-tr</title>
</head>
<body>
<header>Calculator</header>
<!-- navigation links to home and converter pages -->
<nav>
<a href="home.html" title="Go to Home Page" class="nav_links">Home</a>  
<a href="conv.html" title="Use Converter" class="nav_links">Converter</a>
</nav>
<!-- wholeBody is the division thats holds all the divisions of calculator display,operations,calcbuttons -->
<div class="WholeBody">
<!-- calcButtons is the class holding numbers,reset and clear buttons -->
<div class="calcButtons" >
<!-- Calculator buttons -->
<div class="cal-keys" style="flex-grow:1"><button id="." type="button" onclick={dot()}> . </button></div>
<div class="cal-keys" style="flex-grow:2"><button id="0" type="button" onclick={changeAnswer(0)}> 0 </button></div>
<div class="cal-keys"><button id="1" type="button" onclick={changeAnswer(1)}> 1 </button></div>
<div class="cal-keys"><button id="2" type="button" onclick={changeAnswer(2)}> 2 </button></div>
<div class="cal-keys"><button id="3" type="button" onclick={changeAnswer(3)}> 3 </button></div>
<div class="cal-keys"><button id="4" type="button" onclick={changeAnswer(4)}> 4 </button></div>
<div class="cal-keys"><button id="5" type="button" onclick={changeAnswer(5)}> 5 </button></div>
<div class="cal-keys"><button id="6" type="button" onclick={changeAnswer(6)}> 6 </button></div>
<div class="cal-keys"><button id="7" type="button" onclick={changeAnswer(7)}> 7 </button></div>
<div class="cal-keys"><button id="8" type="button" onclick={changeAnswer(8)}> 8 </button></div>
<div class="cal-keys"><button id="9" type="button" onclick={changeAnswer(9)}> 9 </button></div>
<div class="cal-keys" style="flex-grow:1"><button id="reset" type="button" onclick={reset()}> RESET </button></div>
<div class="cal-keys" style="flex-grow:1"><button id="ac" type="button" onclick={clearLastEntry()}> AC </button></div>
</div>
<!-- Operations is the division holding +,-,*,/ operations -->
<div class="operations" >
<!-- Mathematical operations -->
<div class="cal-oper-keys" ><button id="+" type="button" onclick={addNumbers()}> + </button></div>
<div class="cal-oper-keys" ><button id="-" type="button" onclick={subNumbers()}> - </button></div>
<div class="cal-oper-keys" ><button id="*" type="button" onclick={mulNumbers()}> * </button></div>
<div class="cal-oper-keys" ><button id="/" type="button" onclick={divNumbers()}> / </button></div>
<div class="cal-oper-keys" ><button id="=" type="button" onclick={equalTo()}> = </button></div>
</div>
<!-- display is the class that displays history and current answer -->
<div class="display" >
<!-- Text box typing Calculator -->
<div id="text_input" >
<p>Enter the Expression to be calculated:</p><br>
      <input type="text" size="30" id="input" ><br><br>
            <button id="input" onclick={formValidate()}> = </button>
<br>
<p id ="input_message"> Enter input to get calculated output</p>
</div>
<!-- history class is for previous entries -->
<div class="history" id="history" >
History
</div>
<!-- answer class is for displaying current answer -->
<div class="answer" id="answer">
answer
</div>
</div>
</div>
</body>
</html>