This is to build a calculator Web applicaiton.(html, CSS, and JavaScript) The pa
ID: 3799565 • Letter: T
Question
This is to build a calculator Web applicaiton.(html, CSS, and JavaScript)
The page must feature a calculator that has buttons so users can enter any positive integer. It also needs to support the following mathmatical functions: addition, subtraction, multiplication, and division. As well as an equal button so that it performs the operations and a clear button to clear out the user input.
Like a simple calculator, the user should be able to click buttons to enter a number, and then press an operation and then key in another number. If the user clicks the equal button, it will perform the operation. However, the user can choose to do another mathematical operation instead, so they can perform complex operations.
If the user clicks the enter button and receives their results, they can choose to do another mathematical operation on the number or enter in a new number that replaces the old. This functionality should be similar to default Windows calculator in the regard.
Rejections
You use inline CSS or JavaScript. You have CSS outside of the head tag. You use any third party JavaScript libraries(third party CSS librarys are okay). You don't enable JavaScript's strict mode. You use var instead of let. You don't use the EventListener API.
Explanation / Answer
<html>
<head></head>
<body>
<center>
<h3>Calculator</h3>
<br/>
<style>calc{width:300px;height:250px;}
#btn{width:100%;height:40px;font-size:20px;}
</style>
<form Name="calc">
<table id="calc" border=2>
<tr>
<td colspan=5><input id="btn" name="display" type="text"></td>
<td><input name="M" type="number"></td>
</tr>
<tr>
<td><input id="btn" type=button value="0"></td>
<td><input id="btn" type=button value="1"></td>
<td><input id="btn" type=button value="2"></td>
<td><input id="btn" type=button value="+"></td>
</tr>
<tr>
<td><input id="btn" type=button value="3"></td>
<td><input id="btn" type=button value="4"></td>
<td><input id="btn" type=button value="5"></td>
<td><input id="btn" type=button value="-"></td>
</tr>
<tr>
<td><input id="btn" type=button value="6"></td>
<td><input id="btn" type=button value="7"></td>
<td><input id="btn" type=button value="8"></td>
<td><input id="btn" type=button value="x"></td>
</tr>
<tr>
<td><input id="btn" type=button value="9"></td>
<td><input id="btn" type=button value="C"></td>
<td><input id="btn" type=button value="="></td>
<td><input id="btn" type=button value="/"></td>
</tr>
<tr>
</tr>
</table>
</form>
</center>
</body>
</html>
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.