Skip to content

Instantly share code, notes, and snippets.

View FranciscoImanolSuarez's full-sized avatar
🏠
Working from home

Francisco Imanol Suarez FranciscoImanolSuarez

🏠
Working from home
View GitHub Profile
// https://www.hackerrank.com/challenges/welcome-to-java/problem?isFullScreen=true
public class Solution {
public static void main(String[] args) {
System.out.println("Hello, World.");
System.out.println("Hello, Java.");
}
}
public class Solution {
public static void main(String[] args) {
System.out.println("Hello, World.");
System.out.println("Hello, Java.");
}
}
import java.util.*;
public class Collections {
public static void main(String[] args) {
Map<Integer, String> map = new HashMap<Integer, String>();
Map<Integer, String> treeMap = new TreeMap<Integer, String>();
Map<Integer, String> linkedHashMap = new LinkedHashMap<Integer, String>();
//create set interface
Set<Integer> set = new HashSet<Integer>();
Dont aprovved by pancho
function crearAuto() {
class Auto {
constructor(marca, modelo, color, motor, duenios) {
this.marca = marca;
this.modelo = modelo;
this.color = color;
this.motor = motor;
this.duenios = [];
}
agregarDuenio(nombre, apellido, DNI, esDueño) {
function crearPersona() {
class Persona {
constructor(nombre, edad, domicilio, amigos) {
this.nombre = nombre;
this.edad = edad;
this.domicilio = domicilio;
this.amigos = [];
}
agregarAmigos(nombre, edad) {
this.amigos.push({ nombre: nombre, edad: edad });
let numeroUno = 0;
let numeroDos = 0;
//numeroUno = parseInt(prompt("Ingrese numero uno"))
//numeroDos = parseInt(prompt("Ingrese numero dos"))
//numeroUno = 2;
//numeroDos = 10;
for(let i = numeroUno + 1; i < numeroDos; i++ ){
console.log('El numero es ' + ' ' + i)
/*
Utilizando un bucle, mostrar la suma, y la media de los numeros
introducidos hasta introducir un numero negativo y ahi mostrar el resultado
- Sumar numeros y media
- Condicion de corte: Numero negativo
*/
/*
let numero = 0;
/*
Programa que pida dos numeros y que nos diga cual es el mayor, el menor y si son iguales
- Pedir dos numeros
- Condicionales > < ===
*/
let numeroUno = 30;
let numeroDos = 20;
// === | ==
{{ ENTRADA | PIPE }}