Notes 1-this is web programming ... HTML 2-I need the calculator look exacly wha
ID: 3794592 • Letter: N
Question
Notes
1-this is web programming ... HTML
2-I need the calculator look exacly what in the picture with buttons 1 through 9( see the picture )
3- I have tried to do it but is not complete and my code ( the calculator acting wrong )
4- for example if I enter ( 9*9 ) I should get 81 and so on..... make sure ( - , + , / , and * ) working like other calculator please
5- here is the picture of the calculator with the requierments and my code also...
6- once you done, please copy and paste the code here. not provide code with picture. thanks in advance...
1-
2-
3-
Demo
0
+
-
*
/
7
8
9
4
5
6
C
1
2
3
0
.
=
0
+
-
*
/
7
8
9
4
5
6
C
1
2
3
0
.
=
In this assignment, you will develop a simple calculator similar to the following example 7 8 9 C
Explanation / Answer
So, here we go, I have done some changes in your code, and have used the predefined function to add, substract and do the basic functions, rather than creating my own functions, like you did by creating functions like addOne(), we don;t need these kind of functions, as there are predefines functions present in HTML.
So, the Corrected code is: -
<!DOCTYPE html>
<html>
<head>
<style>
table.maintable {
border-spacing: 0;
width: 400px;
height: 600px;
background-color: #81C7D4;
}
#monitor {
margin: 20px;
width: 750px;
height: 160px;
border: 0px;
background-color: white;
font-family: monospace;
text-align: right;
font-size: 160px;
}
input.button1 {
position: relative;
margin: 20px;
width: 160px;
height: 360px;
border: 0;
background-color: #A5DEE4;
font-family: monospace;
font-size: 150px;
text-align: center;
cursor: pointer;
-webkit-user-select: none;
}
input.button2 {
position: relative;
margin: 20px;
width: 360px;
height: 160px;
border: 0;
background-color: #A5DEE4;
font-family: monospace;
font-size: 150px;
text-align: center;
cursor: pointer;
-webkit-user-select: none;
}
input.button {
position: relative;
margin: 20px;
width: 160px;
height: 160px;
border: 0;
background-color: #A5DEE4;
font-family: monospace;
font-size: 150px;
text-align: center;
cursor: pointer;
-webkit-user-select: none;
}
input.button:hover,input.button1:hover,input.button2:hover {
position: relative;
top: -5px;
left: -5px;
box-shadow: 10px 10px 10px;
}
in.button:active {
position: relative;
top: 5px;
left: 5px;
box-shadow: 0 0 0;
}
</style>
<meta charset="utf-8">
<title>Demo</title>
</head>
<body>
<form Name="calc">
<table border=0>
<table class="maintable">
<tr>
<td colspan=4><input id="monitor" name="display" type="text"></td>
</tr>
<tr>
<td>
<table>
<tr>
<td><input class="button" type=button value="+"></td>
<td><input class="button" type=button value="-"></td>
<td><input class="button" type=button value="*"></td>
<td><input class="button" type=button value="/"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table>
<tr>
<td>
<table>
<tr>
<td><input class="button" type=button value="1"></td>
<td><input class="button" type=button value="2"></td>
<td><input class="button" type=button value="3"></td>
</tr>
<tr>
<td><input class="button" type=button value="4"></td>
<td><input class="button" type=button value="5"></td>
<td><input class="button" type=button value="6"></td>
</tr>
</table>
</td>
<td>
<table>
<tr>
<td><input class="button1" type=button value="C"></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table>
<tr>
<td>
<table>
<tr>
<td>
<table>
<tr>
<td><input class="button" type=button value="7"></td>
<td><input class="button" type=button value="8"></td>
<td><input class="button" type=button value="9"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table>
<tr>
<td><input class="button2" type=button value="0"></td>
<td><input class="button" type=button value="."></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td>
<table>
<tr>
<td><input class="button1" type=button value="="></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</table>
</form>
</body>
</html>
This code will run as specified in the question.
Thank You for using Chegg...
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.