-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
35 lines (22 loc) · 823 Bytes
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
function calculate(){
//var medida = document.getElementsByName('radiomedidas');
var area = document.getElementById("valorA").value;
var lado = document.getElementById("valorB").value;
var altura = document.getElementById("valorAlt").value;
var resposta = (area*lado)*altura
let res = document.getElementById('res')
res.innerHTML = `O volume é ${resposta}cm²`
/*if(medida[0].cheked){
alert('deu certo ')
}else{
alert('deu NÃO')
}*/
}
function calculaCilindro(){
var pi = 3.14;
var r = document.getElementById("valorR").value;
var h = document.getElementById("valorAlt").value;
var resCilindro = document.getElementById("resCilindro");
var result = (3.14*(r**2))*h;
resCilindro.innerHTML = `O volume é ${result}cm²`
}