SlideShare a Scribd company logo
1 of 12
Download to read offline
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-!DOCTYPE html
2-html
3-head
4-style
/*table {
border-spacing: 0;
width: 400px;
height: 400px;
background-color: #81C7D4;
}
tr {
height: 200px;
}
td {
padding: 0;
margin: 0;
height: 200px;
} */
#monitor {
margin: 20px;
width: 360px;
height: 160px;
border: 0px;
background-color: white;
font-family: monospace;
text-align: right;
font-size: 160px;
}
div.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;
}
div.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;
}
div.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;
}
div.button:hover {
position: relative;
top: -5px;
left: -5px;
box-shadow: 10px 10px 10px;
}
div.button:active {
position: relative;
top: 5px;
left: 5px;
box-shadow: 0 0 0;
}
Demo
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
Solution
HTML:
Del%+
789-
456x
123/
0.=
CSS:
body {
background:#777;
}
#background {
width:300px;
height:400px;
background:gray;
margin:50px auto;
-webkit-animation:bgChange 2s 2s alternate infinite;
transition: all 2s ease;
}
button {
border:0;
color:#fff;
}
#result {
display:block;
font-family: sans-serif;
width:230px;
height:40px;
margin:10px auto;
text-align: right;
border:0;
background:#3b3535;
color:#fff;
padding-top:20px;
font-size:20px;
margin-left: 25px;
outline: none;
overflow: hidden;
letter-spacing: 4px;
position: relative;
top:10px;
}
#result:hover {
cursor: text;
}
#first-rows {
margin-bottom: 20px;
position: relative;
top:10px;
}
.rows {
width:300px;
margin-top:10px;
}
#delete {
width:110px;
height:50px;
margin-left:25px;
border-radius:4px;
}
/* Aligning the division and dot button properly */
.fall-back {
margin-left:3px !important;
}
/* Aligning the addition and equals to button properly */
.align {
margin-left: 6px !important;
}
/* Button styling */
.btn-style {
width:50px;
height:50px;
margin-left:5px;
border-radius:4px;
}
.eqn {
width:50px;
height:50px;
margin-left:5px;
border-radius:4px;
}
.first-child {
margin-left:25px;
}
/* Adding background color to the number values */
.num-bg {
background:#000;
color:#fff;
font-size:26px;
cursor:pointer;
outline:none;
border-bottom:3px solid #333;
}
.num-bg:active {
background:#000;
color:#fff;
font-size:26px;
cursor:pointer;
outline:none;
box-shadow: inset 5px 5px 5px #555;
}
/*Adding background color to the operator values */
.opera-bg {
background:#333;
color:#fff;
font-size:26px;
cursor: pointer;
outline:none;
border-bottom:3px solid #555;
}
.opera-bg:active {
background:#333;
color:#fff;
font-size:26px;
cursor: pointer;
outline:none;
box-shadow: inset 4px 4px 4px #555;
}
/*Adding a background color to the delete button */
.del-bg {
background:#24b4de;
color:#fff;
font-size:26px;
cursor: pointer;
outline:none;
border-bottom:3px solid #399cb9;
}
.del-bg:active {
background:#24b4de;
color:#fff;
font-size:26px;
cursor: pointer;
outline:none;
box-shadow: inset 4px 4px 4px #399cb9;
}
/*Adding a background color to the equals to button */
#eqn-bg {
background:#17a928;
color:#fff;
font-size:26px;
cursor: pointer;
outline:none;
border-bottom:3px solid #1f7a29;
}
#eqn-bg:active {
background:#17a928;
color:#fff;
font-size:26px;
cursor: pointer;
outline:none;
box-shadow: inset 4px 4px 4px #1f7a29;
}
@-webkit-keyframes bgChange {
0% {
background:#24b4de;
}
50% {
background:#17a928;
}
100% {
background:#399cb9;
}
}
JS:
window.onload = function() {
var current,
screen,
output,
limit,
zero,
period,
operator;
screen = document.getElementById("result");
var elem = document.querySelectorAll(".num");
var len = elem.length;
for(var i = 0; i < len; i++ ) {
elem[i].addEventListener("click",function() {
num = this.value;
output = screen.innerHTML +=num;
limit = output.length;
if(limit > 16 ) {
alert("Sorry no more input is allowed");
}
},false);
}
document.querySelector(".zero").addEventListener("click",function() {
zero = this.value;
if(screen.innerHTML === "") {
output = screen.innerHTML = zero;
}
else if(screen.innerHTML === output) {
output = screen.innerHTML +=zero;
}
},false);
document.querySelector(".period").addEventListener("click",function() {
period = this.value;
if(screen.innerHTML === "") {
output = screen.innerHTML = screen.innerHTML.concat("0.");
}
else if(screen.innerHTML === output) {
screen.innerHTML = screen.innerHTML.concat(".");
}
},false);
document.querySelector("#eqn-bg").addEventListener("click",function() {
if(screen.innerHTML === output) {
screen.innerHTML = eval(output);
}
else {
screen.innerHTML = "";
}
},false);
document.querySelector("#delete").addEventListener("click",function() {
screen.innerHTML = "";
},false);
var elem1 = document.querySelectorAll(".operator");
var len1 = elem1.length;
for(var i = 0; i < len1; i++ ) {
elem1[i].addEventListener("click",function() {
operator = this.value;
if(screen.innerHTML === "") {
screen.innerHTML = screen.innerHTML.concat("");
}
else if(output) {
screen.innerHTML = output.concat(operator);
}
},false);
}
}

More Related Content

Similar to Notes1-this is web programming ... HTML2-I need the calculator l.pdf

Yeni metin belgesi (2)
Yeni metin belgesi (2)Yeni metin belgesi (2)
Yeni metin belgesi (2)makarnalar
 
Floating ad widget
Floating ad widgetFloating ad widget
Floating ad widgetpanther420
 
Xlrays online web tutorials
Xlrays online web tutorialsXlrays online web tutorials
Xlrays online web tutorialsYogesh Gupta
 
Teddy Bear Blue
Teddy Bear BlueTeddy Bear Blue
Teddy Bear Blueangeliclv
 
i tried my best to look the exact same from the picture- but some code.pdf
i tried my best to look the exact same from the picture- but some code.pdfi tried my best to look the exact same from the picture- but some code.pdf
i tried my best to look the exact same from the picture- but some code.pdfbolero3277
 
Hello I a having an issue with the code written in this ass.pdf
Hello I a having an issue with the code written in this ass.pdfHello I a having an issue with the code written in this ass.pdf
Hello I a having an issue with the code written in this ass.pdfabsgroup9793
 
Stylesheets for Online Help - Scott DeLoach, ClickStart
Stylesheets for Online Help - Scott DeLoach, ClickStartStylesheets for Online Help - Scott DeLoach, ClickStart
Stylesheets for Online Help - Scott DeLoach, ClickStartScott DeLoach
 
Kirtesh Khandelwal,Project on HTML and CSS ,Final Year BCA , Dezyne E'cole Co...
Kirtesh Khandelwal,Project on HTML and CSS ,Final Year BCA , Dezyne E'cole Co...Kirtesh Khandelwal,Project on HTML and CSS ,Final Year BCA , Dezyne E'cole Co...
Kirtesh Khandelwal,Project on HTML and CSS ,Final Year BCA , Dezyne E'cole Co...dezyneecole
 
IML 140 Design - Basics
IML 140 Design - BasicsIML 140 Design - Basics
IML 140 Design - BasicsEvan Hughes
 
Extracting ui Design - part 3 - transcript.pdf
Extracting ui Design - part 3 - transcript.pdfExtracting ui Design - part 3 - transcript.pdf
Extracting ui Design - part 3 - transcript.pdfShaiAlmog1
 
Practical ActivitiesWeek06lab08-1.pngPractical Activities.docx
Practical ActivitiesWeek06lab08-1.pngPractical Activities.docxPractical ActivitiesWeek06lab08-1.pngPractical Activities.docx
Practical ActivitiesWeek06lab08-1.pngPractical Activities.docxChantellPantoja184
 

Similar to Notes1-this is web programming ... HTML2-I need the calculator l.pdf (20)

Yeni metin belgesi (2)
Yeni metin belgesi (2)Yeni metin belgesi (2)
Yeni metin belgesi (2)
 
Theme04
Theme04Theme04
Theme04
 
Theme02
Theme02Theme02
Theme02
 
Floating ad widget
Floating ad widgetFloating ad widget
Floating ad widget
 
Theme01
Theme01Theme01
Theme01
 
Xlrays online web tutorials
Xlrays online web tutorialsXlrays online web tutorials
Xlrays online web tutorials
 
Css(handbook)
Css(handbook)Css(handbook)
Css(handbook)
 
Teddy Bear Blue
Teddy Bear BlueTeddy Bear Blue
Teddy Bear Blue
 
i tried my best to look the exact same from the picture- but some code.pdf
i tried my best to look the exact same from the picture- but some code.pdfi tried my best to look the exact same from the picture- but some code.pdf
i tried my best to look the exact same from the picture- but some code.pdf
 
Hello I a having an issue with the code written in this ass.pdf
Hello I a having an issue with the code written in this ass.pdfHello I a having an issue with the code written in this ass.pdf
Hello I a having an issue with the code written in this ass.pdf
 
Stylesheets for Online Help - Scott DeLoach, ClickStart
Stylesheets for Online Help - Scott DeLoach, ClickStartStylesheets for Online Help - Scott DeLoach, ClickStart
Stylesheets for Online Help - Scott DeLoach, ClickStart
 
Kirtesh Khandelwal,Project on HTML and CSS ,Final Year BCA , Dezyne E'cole Co...
Kirtesh Khandelwal,Project on HTML and CSS ,Final Year BCA , Dezyne E'cole Co...Kirtesh Khandelwal,Project on HTML and CSS ,Final Year BCA , Dezyne E'cole Co...
Kirtesh Khandelwal,Project on HTML and CSS ,Final Year BCA , Dezyne E'cole Co...
 
Resume
ResumeResume
Resume
 
Resume
ResumeResume
Resume
 
Resume
ResumeResume
Resume
 
IML 140 Design - Basics
IML 140 Design - BasicsIML 140 Design - Basics
IML 140 Design - Basics
 
Spl book salution
Spl book salutionSpl book salution
Spl book salution
 
Extracting ui Design - part 3 - transcript.pdf
Extracting ui Design - part 3 - transcript.pdfExtracting ui Design - part 3 - transcript.pdf
Extracting ui Design - part 3 - transcript.pdf
 
Theme verdadeiro
Theme verdadeiroTheme verdadeiro
Theme verdadeiro
 
Practical ActivitiesWeek06lab08-1.pngPractical Activities.docx
Practical ActivitiesWeek06lab08-1.pngPractical Activities.docxPractical ActivitiesWeek06lab08-1.pngPractical Activities.docx
Practical ActivitiesWeek06lab08-1.pngPractical Activities.docx
 

More from aminbijal86

can someone proofread this for meAs a child, I used to watch T.V..pdf
can someone proofread this for meAs a child, I used to watch T.V..pdfcan someone proofread this for meAs a child, I used to watch T.V..pdf
can someone proofread this for meAs a child, I used to watch T.V..pdfaminbijal86
 
Describe the arrangement of Regulations for lifting machines and acc.pdf
Describe the arrangement of Regulations for lifting machines and acc.pdfDescribe the arrangement of Regulations for lifting machines and acc.pdf
Describe the arrangement of Regulations for lifting machines and acc.pdfaminbijal86
 
All of the following would require use of the equity method for inve.pdf
All of the following would require use of the equity method for inve.pdfAll of the following would require use of the equity method for inve.pdf
All of the following would require use of the equity method for inve.pdfaminbijal86
 
A nurse palpated enlarged lymph nodes. Describe signs and symptoms t.pdf
A nurse palpated enlarged lymph nodes. Describe signs and symptoms t.pdfA nurse palpated enlarged lymph nodes. Describe signs and symptoms t.pdf
A nurse palpated enlarged lymph nodes. Describe signs and symptoms t.pdfaminbijal86
 
Bell & Porter has the following average times (in hours) Inspecting .pdf
Bell & Porter has the following average times (in hours) Inspecting .pdfBell & Porter has the following average times (in hours) Inspecting .pdf
Bell & Porter has the following average times (in hours) Inspecting .pdfaminbijal86
 
Which part of the clavicle is most commonly fractured A. Later.pdf
Which part of the clavicle is most commonly fractured A. Later.pdfWhich part of the clavicle is most commonly fractured A. Later.pdf
Which part of the clavicle is most commonly fractured A. Later.pdfaminbijal86
 
Which of the following is NOT a criticism of the National Bureau of .pdf
Which of the following is NOT a criticism of the National Bureau of .pdfWhich of the following is NOT a criticism of the National Bureau of .pdf
Which of the following is NOT a criticism of the National Bureau of .pdfaminbijal86
 
When working with communications, is it more important to detect or .pdf
When working with communications, is it more important to detect or .pdfWhen working with communications, is it more important to detect or .pdf
When working with communications, is it more important to detect or .pdfaminbijal86
 
Which of the following are principles of the AICPA Code of Professio.pdf
Which of the following are principles of the AICPA Code of Professio.pdfWhich of the following are principles of the AICPA Code of Professio.pdf
Which of the following are principles of the AICPA Code of Professio.pdfaminbijal86
 
Thouhgts on the future of information technology (IT) software secur.pdf
Thouhgts on the future of information technology (IT) software secur.pdfThouhgts on the future of information technology (IT) software secur.pdf
Thouhgts on the future of information technology (IT) software secur.pdfaminbijal86
 
Two of the following ions depend on their conversion into a gas .pdf
Two of the following ions depend on their conversion into a gas .pdfTwo of the following ions depend on their conversion into a gas .pdf
Two of the following ions depend on their conversion into a gas .pdfaminbijal86
 
The systemic acquired resistance (SAR) demonstrated in the experimen.pdf
The systemic acquired resistance (SAR) demonstrated in the experimen.pdfThe systemic acquired resistance (SAR) demonstrated in the experimen.pdf
The systemic acquired resistance (SAR) demonstrated in the experimen.pdfaminbijal86
 
One implication of the Lyon hypothesis was that adult females would b.pdf
One implication of the Lyon hypothesis was that adult females would b.pdfOne implication of the Lyon hypothesis was that adult females would b.pdf
One implication of the Lyon hypothesis was that adult females would b.pdfaminbijal86
 
the problems of vietnam in communication during international busine.pdf
the problems of vietnam in communication during international busine.pdfthe problems of vietnam in communication during international busine.pdf
the problems of vietnam in communication during international busine.pdfaminbijal86
 
The first signs of niacin deficiency are all of the following EXCEPT .pdf
The first signs of niacin deficiency are all of the following EXCEPT .pdfThe first signs of niacin deficiency are all of the following EXCEPT .pdf
The first signs of niacin deficiency are all of the following EXCEPT .pdfaminbijal86
 
The Ba(s) gets formed after reductionBa2+ + 2e- -- Ba(s) which is.pdf
The Ba(s) gets formed after reductionBa2+ + 2e- -- Ba(s) which is.pdfThe Ba(s) gets formed after reductionBa2+ + 2e- -- Ba(s) which is.pdf
The Ba(s) gets formed after reductionBa2+ + 2e- -- Ba(s) which is.pdfaminbijal86
 
Submit a 2-3 page paper addressing each of the following 1.Define .pdf
Submit a 2-3 page paper addressing each of the following 1.Define .pdfSubmit a 2-3 page paper addressing each of the following 1.Define .pdf
Submit a 2-3 page paper addressing each of the following 1.Define .pdfaminbijal86
 
Nessus is a network security toolIn a pragraph describe the tool’s.pdf
Nessus is a network security toolIn a pragraph describe the tool’s.pdfNessus is a network security toolIn a pragraph describe the tool’s.pdf
Nessus is a network security toolIn a pragraph describe the tool’s.pdfaminbijal86
 
Solve given LP problem using simplex method and find maximum value o.pdf
Solve given LP problem using simplex method and find maximum value o.pdfSolve given LP problem using simplex method and find maximum value o.pdf
Solve given LP problem using simplex method and find maximum value o.pdfaminbijal86
 
Show a rightmost derivation for the string(id + id) id Usin.pdf
Show a rightmost derivation for the string(id + id)  id Usin.pdfShow a rightmost derivation for the string(id + id)  id Usin.pdf
Show a rightmost derivation for the string(id + id) id Usin.pdfaminbijal86
 

More from aminbijal86 (20)

can someone proofread this for meAs a child, I used to watch T.V..pdf
can someone proofread this for meAs a child, I used to watch T.V..pdfcan someone proofread this for meAs a child, I used to watch T.V..pdf
can someone proofread this for meAs a child, I used to watch T.V..pdf
 
Describe the arrangement of Regulations for lifting machines and acc.pdf
Describe the arrangement of Regulations for lifting machines and acc.pdfDescribe the arrangement of Regulations for lifting machines and acc.pdf
Describe the arrangement of Regulations for lifting machines and acc.pdf
 
All of the following would require use of the equity method for inve.pdf
All of the following would require use of the equity method for inve.pdfAll of the following would require use of the equity method for inve.pdf
All of the following would require use of the equity method for inve.pdf
 
A nurse palpated enlarged lymph nodes. Describe signs and symptoms t.pdf
A nurse palpated enlarged lymph nodes. Describe signs and symptoms t.pdfA nurse palpated enlarged lymph nodes. Describe signs and symptoms t.pdf
A nurse palpated enlarged lymph nodes. Describe signs and symptoms t.pdf
 
Bell & Porter has the following average times (in hours) Inspecting .pdf
Bell & Porter has the following average times (in hours) Inspecting .pdfBell & Porter has the following average times (in hours) Inspecting .pdf
Bell & Porter has the following average times (in hours) Inspecting .pdf
 
Which part of the clavicle is most commonly fractured A. Later.pdf
Which part of the clavicle is most commonly fractured A. Later.pdfWhich part of the clavicle is most commonly fractured A. Later.pdf
Which part of the clavicle is most commonly fractured A. Later.pdf
 
Which of the following is NOT a criticism of the National Bureau of .pdf
Which of the following is NOT a criticism of the National Bureau of .pdfWhich of the following is NOT a criticism of the National Bureau of .pdf
Which of the following is NOT a criticism of the National Bureau of .pdf
 
When working with communications, is it more important to detect or .pdf
When working with communications, is it more important to detect or .pdfWhen working with communications, is it more important to detect or .pdf
When working with communications, is it more important to detect or .pdf
 
Which of the following are principles of the AICPA Code of Professio.pdf
Which of the following are principles of the AICPA Code of Professio.pdfWhich of the following are principles of the AICPA Code of Professio.pdf
Which of the following are principles of the AICPA Code of Professio.pdf
 
Thouhgts on the future of information technology (IT) software secur.pdf
Thouhgts on the future of information technology (IT) software secur.pdfThouhgts on the future of information technology (IT) software secur.pdf
Thouhgts on the future of information technology (IT) software secur.pdf
 
Two of the following ions depend on their conversion into a gas .pdf
Two of the following ions depend on their conversion into a gas .pdfTwo of the following ions depend on their conversion into a gas .pdf
Two of the following ions depend on their conversion into a gas .pdf
 
The systemic acquired resistance (SAR) demonstrated in the experimen.pdf
The systemic acquired resistance (SAR) demonstrated in the experimen.pdfThe systemic acquired resistance (SAR) demonstrated in the experimen.pdf
The systemic acquired resistance (SAR) demonstrated in the experimen.pdf
 
One implication of the Lyon hypothesis was that adult females would b.pdf
One implication of the Lyon hypothesis was that adult females would b.pdfOne implication of the Lyon hypothesis was that adult females would b.pdf
One implication of the Lyon hypothesis was that adult females would b.pdf
 
the problems of vietnam in communication during international busine.pdf
the problems of vietnam in communication during international busine.pdfthe problems of vietnam in communication during international busine.pdf
the problems of vietnam in communication during international busine.pdf
 
The first signs of niacin deficiency are all of the following EXCEPT .pdf
The first signs of niacin deficiency are all of the following EXCEPT .pdfThe first signs of niacin deficiency are all of the following EXCEPT .pdf
The first signs of niacin deficiency are all of the following EXCEPT .pdf
 
The Ba(s) gets formed after reductionBa2+ + 2e- -- Ba(s) which is.pdf
The Ba(s) gets formed after reductionBa2+ + 2e- -- Ba(s) which is.pdfThe Ba(s) gets formed after reductionBa2+ + 2e- -- Ba(s) which is.pdf
The Ba(s) gets formed after reductionBa2+ + 2e- -- Ba(s) which is.pdf
 
Submit a 2-3 page paper addressing each of the following 1.Define .pdf
Submit a 2-3 page paper addressing each of the following 1.Define .pdfSubmit a 2-3 page paper addressing each of the following 1.Define .pdf
Submit a 2-3 page paper addressing each of the following 1.Define .pdf
 
Nessus is a network security toolIn a pragraph describe the tool’s.pdf
Nessus is a network security toolIn a pragraph describe the tool’s.pdfNessus is a network security toolIn a pragraph describe the tool’s.pdf
Nessus is a network security toolIn a pragraph describe the tool’s.pdf
 
Solve given LP problem using simplex method and find maximum value o.pdf
Solve given LP problem using simplex method and find maximum value o.pdfSolve given LP problem using simplex method and find maximum value o.pdf
Solve given LP problem using simplex method and find maximum value o.pdf
 
Show a rightmost derivation for the string(id + id) id Usin.pdf
Show a rightmost derivation for the string(id + id)  id Usin.pdfShow a rightmost derivation for the string(id + id)  id Usin.pdf
Show a rightmost derivation for the string(id + id) id Usin.pdf
 

Recently uploaded

Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnershipsexpandedwebsite
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxAdelaideRefugio
 
MOOD STABLIZERS DRUGS.pptx
MOOD     STABLIZERS           DRUGS.pptxMOOD     STABLIZERS           DRUGS.pptx
MOOD STABLIZERS DRUGS.pptxPoojaSen20
 
ANTI PARKISON DRUGS.pptx
ANTI         PARKISON          DRUGS.pptxANTI         PARKISON          DRUGS.pptx
ANTI PARKISON DRUGS.pptxPoojaSen20
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................MirzaAbrarBaig5
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文中 央社
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSAnaAcapella
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppCeline George
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxMarlene Maheu
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital ManagementMBA Assignment Experts
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxneillewis46
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi RajagopalEADTU
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSean M. Fox
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesPooky Knightsmith
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽中 央社
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportDenish Jangid
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024Borja Sotomayor
 
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxAnalyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxLimon Prince
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjMohammed Sikander
 

Recently uploaded (20)

Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptx
 
MOOD STABLIZERS DRUGS.pptx
MOOD     STABLIZERS           DRUGS.pptxMOOD     STABLIZERS           DRUGS.pptx
MOOD STABLIZERS DRUGS.pptx
 
ANTI PARKISON DRUGS.pptx
ANTI         PARKISON          DRUGS.pptxANTI         PARKISON          DRUGS.pptx
ANTI PARKISON DRUGS.pptx
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge App
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptx
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptx
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopal
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical Principles
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024
 
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxAnalyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 

Notes1-this is web programming ... HTML2-I need the calculator l.pdf

  • 1. 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-!DOCTYPE html 2-html 3-head 4-style /*table { border-spacing: 0; width: 400px; height: 400px; background-color: #81C7D4; } tr { height: 200px; } td { padding: 0; margin: 0; height: 200px; } */ #monitor { margin: 20px; width: 360px; height: 160px; border: 0px; background-color: white; font-family: monospace; text-align: right;
  • 2. font-size: 160px; } div.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; } div.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; } div.button { position: relative; margin: 20px; width: 160px; height: 160px; border: 0; background-color: #A5DEE4; font-family: monospace;
  • 3. font-size: 150px; text-align: center; cursor: pointer; -webkit-user-select: none; } div.button:hover { position: relative; top: -5px; left: -5px; box-shadow: 10px 10px 10px; } div.button:active { position: relative; top: 5px; left: 5px; box-shadow: 0 0 0; } Demo 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
  • 4. C Solution HTML: Del%+ 789- 456x 123/ 0.= CSS: body { background:#777; } #background { width:300px; height:400px; background:gray; margin:50px auto; -webkit-animation:bgChange 2s 2s alternate infinite; transition: all 2s ease; } button { border:0; color:#fff; } #result { display:block; font-family: sans-serif; width:230px; height:40px; margin:10px auto;
  • 5. text-align: right; border:0; background:#3b3535; color:#fff; padding-top:20px; font-size:20px; margin-left: 25px; outline: none; overflow: hidden; letter-spacing: 4px; position: relative; top:10px; } #result:hover { cursor: text; } #first-rows { margin-bottom: 20px; position: relative; top:10px; } .rows { width:300px; margin-top:10px; } #delete { width:110px; height:50px; margin-left:25px; border-radius:4px; } /* Aligning the division and dot button properly */ .fall-back { margin-left:3px !important;
  • 6. } /* Aligning the addition and equals to button properly */ .align { margin-left: 6px !important; } /* Button styling */ .btn-style { width:50px; height:50px; margin-left:5px; border-radius:4px; } .eqn { width:50px; height:50px; margin-left:5px; border-radius:4px; } .first-child { margin-left:25px; } /* Adding background color to the number values */ .num-bg { background:#000; color:#fff; font-size:26px; cursor:pointer; outline:none; border-bottom:3px solid #333; } .num-bg:active { background:#000; color:#fff; font-size:26px; cursor:pointer;
  • 7. outline:none; box-shadow: inset 5px 5px 5px #555; } /*Adding background color to the operator values */ .opera-bg { background:#333; color:#fff; font-size:26px; cursor: pointer; outline:none; border-bottom:3px solid #555; } .opera-bg:active { background:#333; color:#fff; font-size:26px; cursor: pointer; outline:none; box-shadow: inset 4px 4px 4px #555; } /*Adding a background color to the delete button */ .del-bg { background:#24b4de; color:#fff; font-size:26px; cursor: pointer; outline:none; border-bottom:3px solid #399cb9; } .del-bg:active { background:#24b4de; color:#fff; font-size:26px; cursor: pointer; outline:none; box-shadow: inset 4px 4px 4px #399cb9;
  • 8. } /*Adding a background color to the equals to button */ #eqn-bg { background:#17a928; color:#fff; font-size:26px; cursor: pointer; outline:none; border-bottom:3px solid #1f7a29; } #eqn-bg:active { background:#17a928; color:#fff; font-size:26px; cursor: pointer; outline:none; box-shadow: inset 4px 4px 4px #1f7a29; } @-webkit-keyframes bgChange { 0% { background:#24b4de; } 50% { background:#17a928; } 100% { background:#399cb9; } } JS: window.onload = function() { var current, screen, output,
  • 9. limit, zero, period, operator; screen = document.getElementById("result"); var elem = document.querySelectorAll(".num"); var len = elem.length; for(var i = 0; i < len; i++ ) { elem[i].addEventListener("click",function() { num = this.value; output = screen.innerHTML +=num; limit = output.length; if(limit > 16 ) { alert("Sorry no more input is allowed"); } },false); } document.querySelector(".zero").addEventListener("click",function() { zero = this.value; if(screen.innerHTML === "") { output = screen.innerHTML = zero;
  • 10. } else if(screen.innerHTML === output) { output = screen.innerHTML +=zero; } },false); document.querySelector(".period").addEventListener("click",function() { period = this.value; if(screen.innerHTML === "") { output = screen.innerHTML = screen.innerHTML.concat("0."); } else if(screen.innerHTML === output) { screen.innerHTML = screen.innerHTML.concat("."); } },false); document.querySelector("#eqn-bg").addEventListener("click",function() { if(screen.innerHTML === output) { screen.innerHTML = eval(output); }
  • 11. else { screen.innerHTML = ""; } },false); document.querySelector("#delete").addEventListener("click",function() { screen.innerHTML = ""; },false); var elem1 = document.querySelectorAll(".operator"); var len1 = elem1.length; for(var i = 0; i < len1; i++ ) { elem1[i].addEventListener("click",function() { operator = this.value; if(screen.innerHTML === "") { screen.innerHTML = screen.innerHTML.concat(""); } else if(output) { screen.innerHTML = output.concat(operator); } },false);
  • 12. } }