To design a web application for a standard calculator.
Clone the github repository and create Django admin interface.
Change settings.py file to allow request from all hosts.
Use CSS for creating attractive colors.
Write JavaScript program for implementing five different operations.
Validate the HTML and CSS code.
Publish the website in the given URL.
<!DOCTYPE html>
<html>
<head>
<title>Simple Calculator</title>
<style type="text/css">
table{
border: 1px solid black;
margin-left: auto;
margin-right: auto;
}
input[type="text"]{
border: 1px solid rgb(21, 84, 193);
padding: 20px 30px;
font-size: 24px;
font-weight: bold;
border-radius: 2px;
}
input[type="button"]{
width: 100%;
padding: 20px 40px;
background-color:rgb(22, 170, 145);
border-radius: 2px;
}
</style>
</head>
<body>
<form name="form1" onload="result.value=''">
<h1 style="text-align: center;color:rgb(255, 0, 30);">Simple Calculator</h1>
<table id="calc">
<tr>
<td colspan="4">
<input type="text" id="result">
</td>
</tr>
<tr>
<td><input type="button" value="1" onclick="result.value+='1'"/></td>
<td><input type="button" value="2" onclick="result.value+='2'"/></td>
<td><input type="button" value="3" onclick="result.value+='3'"/></td>
<td><input type="button" value="+" onclick="result.value+='+'"/></td>
</tr>
<tr>
<td><input type="button" value="4" onclick="result.value+='4'"/></td>
<td><input type="button" value="5" onclick="result.value+='5'"/></td>
<td><input type="button" value="6" onclick="result.value+='6'"/></td>
<td><input type="button" value="-" onclick="result.value+='-'"/></td>
</tr>
<tr>
<td><input type="button" value="7" onclick="result.value+='7'"/></td>
<td><input type="button" value="8" onclick="result.value+='8'"/></td>
<td><input type="button" value="9" onclick="result.value+='9'"/></td>
<td><input type="button" value="*" onclick="result.value+='*'"/></td>
</tr>
<tr>
<td><input type="button" value="/" onclick="result.value+='/'"/></td>
<td><input type="button" value="0" onclick="result.value+='0'"/></td>
<td><input type="button" value="." onclick="result.value+='.'"/></td>
<td><input type="button" value="=" onclick="result.value=eval(result.value)"/></td>
</tr>
<tr>
<td colspan="4">
<input type="button" value="clearall" id="clear" onclick="result.value=''">
</td>
</tr>
</table>
</form>
</body>
</html>
The simple calculator has been completed successfully