Completed more exercises

This commit is contained in:
raul 2024-01-18 12:22:02 +01:00
parent c496f40365
commit 1d3787dc42
4 changed files with 73 additions and 0 deletions

25
ejer10/10.html Normal file
View File

@ -0,0 +1,25 @@
<html>
<head>
<meta name="" charset="UTF-8" content="">
<style>
* {
text-align: center;
}
</style>
</head>
<body>
<script src="./10.js"></script>
<h1>Asteriscos</h1>
<form>
<!-- <select id="opciones"> -->
<!-- <option value="HOR">Horizontal</option> -->
<!-- <option value="VER">Vertical</option> -->
<!-- </select> -->
<input type="text" id="numeroDeAsteriscos" name="" value="">
<input type="submit" name="" onclick="main()" value="Mostrar">
</form>
</body>
</html>

9
ejer10/10.js Normal file
View File

@ -0,0 +1,9 @@
function main() {
var numAst = document.getElementById('numeroDeAsteriscos').value;
for (let a = 0; a < numAst; a++) {
for (let i = 0; i < numAst; i++) {
document.writeln(`*`);
}
document.writeln(`<br>`)
}
}

25
ejer11/11.html Normal file
View File

@ -0,0 +1,25 @@
<html>
<head>
<meta name="" charset="UTF-8" content="">
<style>
* {
text-align: center;
}
</style>
</head>
<body>
<script src="./11.js"></script>
<h1>Asteriscos</h1>
<form>
<!-- <select id="opciones"> -->
<!-- <option value="HOR">Horizontal</option> -->
<!-- <option value="VER">Vertical</option> -->
<!-- </select> -->
<input type="text" id="numeroDeAsteriscos" name="" value="">
<input type="submit" name="" onclick="main()" value="Mostrar">
</form>
</body>
</html>

14
ejer11/11.js Normal file
View File

@ -0,0 +1,14 @@
function main() {
var numAst = document.getElementById('numeroDeAsteriscos').value;
for (let a = 1; a < numAst; a++) {
for (let i = 0; i < a; i++) {
document.writeln(`*`);
}
document.writeln(`<br>`)
}
for (let i = 0; i < numAst / 2; i++) {
document.writeln(`*<br>`)
}
}