Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
js-e001
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Silvia Barrientos
js-e001
Commits
2e064084
Commit
2e064084
authored
Sep 05, 2020
by
Silvia Barrientos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace javaScript.js
parent
31a1303f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
JavaScript/Ejercicio1/javaScript.js
+16
-16
No files found.
JavaScript/Ejercicio1/javaScript.js
View file @
2e064084
function
init
(){
var
calcular
=
document
.
getElementById
(
"calcular"
);
var
x
=
document
.
getElementById
(
"n1"
);
var
y
=
document
.
getElementById
(
"n2"
);
calcular
.
onclick
=
function
()
{
var
x
=
5
;
var
y
=
2
;
var
operaciones
=
parseInt
(
x
)
+
parseInt
(
y
);
x
.
textContent
=
parseInt
(
Math
.
random
()
*
10
);
y
.
textContent
=
parseInt
(
Math
.
random
()
*
10
);
console
.
log
(
"La suma de x más y: "
+
operaciones
);
var
operaciones
=
x
-
y
;
console
.
log
(
"La resta de x menos y: "
+
operaciones
);
var
operaciones
=
x
*
y
;
console
.
log
(
"La multiplicacion de x por y: "
+
operaciones
);
calcular
=
parseInt
(
x
.
textContent
)
+
parseInt
(
y
.
textContent
);
console
.
log
(
"La suma de x más y: "
+
calcular
);
calcular
=
parseInt
(
x
.
textContent
)
-
parseInt
(
y
.
textContent
);
console
.
log
(
"La resta de x menos y: "
+
calcular
);
var
operaciones
=
x
/
y
;
console
.
log
(
"La division de x entre y: "
+
operaciones
);
calcular
=
parseInt
(
x
.
textContent
)
*
parseInt
(
y
.
textContent
);
console
.
log
(
"La multiplicacion de x por y: "
+
calcular
);
calcular
=
parseInt
(
x
.
textContent
)
/
parseInt
(
y
.
textContent
);
console
.
log
(
"La division de x entre y: "
+
calcular
);
console
.
log
(
"x elevado a la potencia de y: "
+
Math
.
pow
(
x
,
y
));
calcular
=
Math
.
pow
(
parseInt
(
x
.
textContent
),
parseInt
(
y
.
textContent
));
console
.
log
(
"x elevado a la potencia de y: "
+
calcular
);
var
operaciones
=
x
%
y
;
console
.
log
(
"El resto de la división entera entre x e y: "
+
operaciones
);
calcular
=
parseInt
(
x
.
textContent
)
%
parseInt
(
y
.
textContent
);
console
.
log
(
"El resto de la división entera entre x e y: "
+
calcular
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment