<html>
<head>
<script>
function dis(val)
{
document.getElementById("result").value+=val
}
function solve()
{
let x = document.getElementById("result").value
let y = eval(x)
document.getElementById("result").value = y
}
function clr()
{
document.getElementById("result").value = ""
}
</script>
<style>
body{
background-color:#0a072b;
}
input[type="button"]
{
background-color:red;
color: white;
border: solid black 5px;
width:100px;
height: 100px;
font-size: 30px;
box-shadow:
}
input[type="text"]
{
border: solid black 2px;
width:300px;
height:90px;
margin-left: 5px;
font-size:40px;
font-family: DotumChe;
color: red;
background-color: yellow;
font-weight: bolder;
}
table{
margin-left:455px;
}
h1{
font-size: 50px;
font-weight: bolder;
color: white;
text-align: center;
font-family: arial;
}
marquee{
font-size: 20px;
font-family: arial;
color:white;
margin: 0px;
padding: 0px;
}
</style>
</head>
<body>
<h1>Calculator</h1>
<table border="1">
<tr>
<td colspan="3"><input type="text" id="result"/></td>
<td><input type="button" value="c" onclick="clr()"/> </td>
</tr>
<tr>
<td><input type="button" value="1" onclick="dis('1')"/> </td>
<td><input type="button" value="2" onclick="dis('2')"/> </td>
<td><input type="button" value="3" onclick="dis('3')"/> </td>
<td><input type="button" value="/" onclick="dis('/')"/> </td>
</tr>
<tr>
<td><input type="button" value="4" onclick="dis('4')"/> </td>
<td><input type="button" value="5" onclick="dis('5')"/> </td>
<td><input type="button" value="6" onclick="dis('6')"/> </td>
<td><input type="button" value="-" onclick="dis('-')"/> </td>
</tr>
<tr>
<td><input type="button" value="7" onclick="dis('7')"/> </td>
<td><input type="button" value="8" onclick="dis('8')"/> </td>
<td><input type="button" value="9" onclick="dis('9')"/> </td>
<td><input type="button" value="+" onclick="dis('+')"/> </td>
</tr>
<tr>
<td><input type="button" value="." onclick="dis('.')"/> </td>
<td><input type="button" value="0" onclick="dis('0')"/> </td>
<td><input type="button" value="=" onclick="solve()"/> </td>
<td><input type="button" value="*" onclick="dis('*')"/> </td>
</tr>
</table> <br><br>
<marquee>This pragram is developed by Arjun sapkota. Please don't try to modefy it.</marquee>
</body>
</html>
This comment has been removed by the author.
ReplyDelete#include
ReplyDeleteusing namespace std;
class grade
{
int n,aa,a,bb,b,cc,c,dd,d,total;
public:
void get()
{
cout<<"Enter number of subject :";
cin>>n;
cout<<"***************************"<>aa;
cout<<"Number of subject of A :";
cin>>a;
cout<<"Number of subject of B+ :";
cin>>bb;
cout<<"Number of subject of B :";
cin>>b;
cout<<"Number of subject of C+ :";
cin>>cc;
cout<<"Number of subject of C :";
cin>>c;
cout<<"Number of subject of D+ :";
cin>>dd;
cout<<"Number of subject of D :";
cin>>d;
total=aa+a+bb+b+cc+c+dd+d;
cout<<"The sum is "<<total;
}
};
int main()
{
grade g;
g.get();
return 0;
}
#include
Deleteusing namespace std;
class grade
{
int n,aa=4.0,a=3.6,bb=3.2,b=2.8,cc=2.4,c=2.0,dd,d,total;
public:
void get()
{
cout<<"Enter number of subject :";
cin>>n;
cout<<"***************************"<>aa;
cout<<"Number of subject of A :";
cin>>a;
cout<<"Number of subject of B+ :";
cin>>bb;
cout<<"Number of subject of B :";
cin>>b;
cout<<"Number of subject of C+ :";
cin>>cc;
cout<<"Number of subject of C :";
cin>>c;
cout<<"Number of subject of D+ :";
cin>>dd;
cout<<"Number of subject of D :";
cin>>d;
total=aa+a+bb+b+cc+c+dd+d;
cout<<"The sum is "<<total;
}
};
int main()
{
grade g;
g.get();
return 0;
}
This comment has been removed by a blog administrator.
ReplyDeletePost a Comment