Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added RETI/bianchi_emanuele/DHCP/bianchi_apipa.pkt
Binary file not shown.
Binary file added RETI/bianchi_emanuele/DHCP/bianchi_dhcp_01.pkt
Binary file not shown.
Binary file added RETI/bianchi_emanuele/DHCP/bianchi_dhcp_03.pkt
Binary file not shown.
Binary file added RETI/bianchi_emanuele/DHCP/bianchi_dhcp_04.pkt
Binary file not shown.
Binary file not shown.
Binary file added RETI/bianchi_emanuele/VLSM/VLSM_03.pkt
Binary file not shown.
Binary file added RETI/bianchi_emanuele/VLSM/bianchi_compito_10.pkt
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added RETI/bianchi_emanuele/vlan/bianchi_vlan_es_01.pkt
Binary file not shown.
Binary file added RETI/bianchi_emanuele/vlan/bianchi_vlan_es_02.pkt
Binary file not shown.
Binary file added RETI/bianchi_emanuele/vlan/bianchi_vlan_es_03.pkt
Binary file not shown.
Binary file added RETI/bianchi_emanuele/vlan/bianchi_vlan_es_04.pkt
Binary file not shown.
Binary file added RETI/bianchi_emanuele/vlan/bianchi_vlan_es_05.pkt
Binary file not shown.
Binary file added RETI/bianchi_emanuele/vlan/bianchi_vlan_es_06.pkt
Binary file not shown.
Binary file added RETI/bianchi_emanuele/vlan/bianchi_vlan_es_07.pkt
Binary file not shown.
Binary file not shown.
Binary file added RETI/bianchi_emanuele/vlan/bianchi_vlan_es_09.pkt
Binary file not shown.
Binary file added RETI/routing/bianchi_routing_es_01.pkt
Binary file not shown.
Binary file added RETI/routing/bianchi_routing_es_02-3.pkt
Binary file not shown.
12 changes: 12 additions & 0 deletions TPSI/bianchi_emanuele/JavaScript/bianchi_esercizio_js_09.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>esercizio 09</title>
<script src="bianchi_esercizio_js_09.js"></script>
</head>
<body>

</body>
</html>
30 changes: 30 additions & 0 deletions TPSI/bianchi_emanuele/JavaScript/bianchi_esercizio_js_09.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
console.log("prova")

let pwd
let nome = prompt("USERNAME:")
nome == null && alert("Cancel")
nome != null && (nome == "Admin" || alert("I don't know"));
nome == "Admin" && (pwd = prompt("PASSWORD"))
nome == "Admin" && pwd == null && alert("Cancel")
nome == "Admin" && pwd != null && pwd == "Agnell1no" || alert("Wrong Password")
nome == "Admin" && pwd == "Agnell1no" && alert("Welcome")

/*
let nome = prompt("USERNAME:")
if(nome != "Admin")
{
alert("i don't know")
}
else
{
let password = prompt("inserisci la password");
if(password != "Agnell1no")
{
alert("wrong password");
}
else
{
alert("welcome");
}
}
*/
11 changes: 11 additions & 0 deletions TPSI/bianchi_emanuele/JavaScript/bianchi_esercizio_js_10.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//Realizzare il ciclo for...in su un oggetto utente NON utilizzando il for...in ma un ciclo for normale
let utente = {
nome: "Mario",
cognome: "Rossi",
età: 30
}

for (let i = 0; i < Object.keys(utente).length; i++)
{
console.log(`la chiave ${i} ha valore ${utente[i]}`);
}
43 changes: 43 additions & 0 deletions TPSI/bianchi_emanuele/JavaScript/bianchi_esercizio_js_11.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Funzione costruttore per Automobile
function creaAutomobile(marca, modello, anno, colore, km) {
return {
marca: marca,
modello: modello,
anno: anno,
colore: colore,
km: km,

// Metodo 1: Avvia motore
avviaMotore: function() {
console.log(`${this.marca} ${this.modello} avviato!`);
},

// Metodo 2: Mostra info
mostraInfo: function() {
console.log(`Auto: ${this.marca} ${this.modello} (${this.anno})`);
console.log(`Colore: ${this.colore}, KM: ${this.km}`);
},

// Metodo 3: Aggiungi km
guida: function(kmAggiuntivi) {
this.km += kmAggiuntivi;
console.log(`Guidato ${kmAggiuntivi}km. Totale: ${this.km}km`);
}
};
}

// Main
const auto1 = creaAutomobile("Fiat", "Panda", 2020, "Bianca", 15000);
const auto2 = creaAutomobile("Volkswagen", "Golf", 2022, "Nera", 8000);
const auto3 = creaAutomobile("Toyota", "Yaris", 2019, "Rossa", 25000);
const auto4 = creaAutomobile("Renault", "Clio", 2021, "Blu", 12000);
const auto5 = creaAutomobile("Ford", "Fiesta", 2023, "Grigia", 3000);

console.log("=== ESERCIZIO JS_11 ===\n");

[auto1, auto2, auto3, auto4, auto5].forEach((auto, index) => {
console.log(`\n--- Auto ${index + 1} ---`);
auto.avviaMotore();
auto.mostraInfo();
auto.guida(100);
});
53 changes: 53 additions & 0 deletions TPSI/bianchi_emanuele/JavaScript/bianchi_esercizio_js_12.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
function creaAnimale(nome, specie, eta) {
return {
nome, specie, eta,
mangia: () => console.log(`${nome} sta mangiando`),
dorme: () => console.log(`${nome} sta dormendo`),
enumera: function() {
console.log("Attributi Animale:", Object.keys(this));
}
};
}

function creaAutomobile(marca, modello, km) {
return {
marca, modello, km,
avvia: () => console.log(`${marca} ${modello} avviata`),
frena: () => console.log(`${marca} ${modello} frena`),
enumera: function() {
console.log("Attributi Automobile:", Object.keys(this));
}
};
}

function creaPoligono(lati, colore, area) {
return {
lati, colore, area,
ruota: () => console.log(`Poligono ${lati} lati ruota`),
scala: () => console.log("Poligono scalato"),
enumera: function() {
console.log("Attributi Poligono:", Object.keys(this));
}
};
}

// Main
console.log("=== ESERCIZIO JS_12 ===\n");

console.log("ANIMALI:");
const cane1 = creaAnimale("Rex", "Cane", 3);
const cane2 = creaAnimale("Fido", "Cane", 5);
cane1.enumera();
cane2.enumera();

console.log("\nAUTOMOBILI:");
const auto1 = creaAutomobile("Fiat", "Panda", 15000);
const auto2 = creaAutomobile("VW", "Golf", 8000);
auto1.enumera();
auto2.enumera();

console.log("\nPOLIGONI:");
const triangolo1 = creaPoligono(3, "rosso", 10);
const triangolo2 = creaPoligono(3, "blu", 15);
triangolo1.enumera();
triangolo2.enumera();
16 changes: 16 additions & 0 deletions TPSI/bianchi_emanuele/JavaScript/bianchi_esercizio_js_13.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
function sommaFinoN(n) {
n = Number(n);
if (!Number.isInteger(n) || n < 0) return 0;

let somma = 0;
for (let i = 0; i <= n; i++) {
somma += i;
}
return somma;
}

// Main
console.log("=== ESERCIZIO JS_13 ===\n");
console.log("sommaFinoN(5):", sommaFinoN(5)); // 15
console.log("sommaFinoN('10'):", sommaFinoN("10")); // 55
console.log("sommaFinoN(8):", sommaFinoN(8)); // 36
24 changes: 24 additions & 0 deletions TPSI/bianchi_emanuele/JavaScript/bianchi_esercizio_js_14.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
function differenzaOrari(ora1, ora2) {
const tempo1 = (ora1.h || 0) * 3600000 + (ora1.m || 0) * 60000 + (ora1.s || 0) * 1000;
const tempo2 = (ora2.h || 0) * 3600000 + (ora2.m || 0) * 60000 + (ora2.s || 0) * 1000;

const diffMs = Math.abs(tempo2 - tempo1);

return {
ms: diffMs,
secondi: Math.floor(diffMs / 1000),
minuti: Math.floor(diffMs / 60000),
ore: Math.floor(diffMs / 3600000)
};
}

// Main
console.log("=== ESERCIZIO JS_14 ===\n");

const orario1 = { h: 10, m: 30, s: 45 };
const orario2 = { h: 12, m: 15, s: 20 };
console.log("Differenza 10:30:45 - 12:15:20:", differenzaOrari(orario1, orario2));

const orario3 = { h: 8, m: 0, s: 0 };
const orario4 = { h: 9, m: 30, s: 0 };
console.log("Differenza 08:00:00 - 09:30:00:", differenzaOrari(orario3, orario4));
22 changes: 22 additions & 0 deletions TPSI/bianchi_emanuele/JavaScript/bianchi_esercizio_js_15.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
function fibonacci(n) {
n = Number(n);
if (!Number.isInteger(n) || n < 0) return 0;

if (n === 0 || n === 1) return n;

let a = 0, b = 1;
for (let i = 2; i <= n; i++) {
let temp = a + b;
a = b;
b = temp;
}
return b;
}

// Main
console.log("=== ESERCIZIO JS_15 ===\n");
console.log("fibonacci(0):", fibonacci(0)); // 0
console.log("fibonacci(5):", fibonacci(5)); // 5
console.log("fibonacci(8):", fibonacci(8)); // 21
console.log("fibonacci(10):", fibonacci(10)); // 55
console.log("fibonacci(12):", fibonacci(12)); // 144
23 changes: 23 additions & 0 deletions TPSI/bianchi_emanuele/JavaScript/bianchi_esercizio_js_16.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
function orarioMinore(ora1, ora2, ora3) {
const tempo1 = (ora1.h || 0) * 3600 + (ora1.m || 0) * 60 + (ora1.s || 0);
const tempo2 = (ora2.h || 0) * 3600 + (ora2.m || 0) * 60 + (ora2.s || 0);
const tempo3 = (ora3.h || 0) * 3600 + (ora3.m || 0) * 60 + (ora3.s || 0);

const tempi = [tempo1, tempo2, tempo3];
const minTempo = Math.min(...tempi);

if (tempo1 === minTempo) return ora1;
if (tempo2 === minTempo) return ora2;
return ora3;
}

// Main
console.log("=== ESERCIZIO JS_16 ===\n");

console.log("Minore di 10:30, 09:15, 11:00:", orarioMinore(
{h:10,m:30}, {h:9,m:15}, {h:11,m:0}
));

console.log("Minore di 14:20:30, 14:10:45, 14:25:10:", orarioMinore(
{h:14,m:20,s:30}, {h:14,m:10,s:45}, {h:14,m:25,s:10}
));
9 changes: 9 additions & 0 deletions TPSI/bianchi_emanuele/JavaScript/bianchi_esercizio_js_17.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function max2(a, b) {
return a > b ? a : b;
}

// Main
console.log("=== ESERCIZIO JS_17 ===\n");
console.log("max2(5, 8):", max2(5, 8));
console.log("max2(12, 7):", max2(12, 7));
console.log("max2(-1, 0):", max2(-1, 0));
9 changes: 9 additions & 0 deletions TPSI/bianchi_emanuele/JavaScript/bianchi_esercizio_js_18.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function max3(a, b, c) {
return a > b ? (a > c ? a : c) : (b > c ? b : c);
}

// Main
console.log("=== ESERCIZIO JS_18 ===\n");
console.log("max3(5, 8, 3):", max3(5, 8, 3));
console.log("max3(12, 15, 7):", max3(12, 15, 7));
console.log("max3(10, 10, 10):", max3(10, 10, 10));
35 changes: 35 additions & 0 deletions TPSI/bianchi_emanuele/JavaScript/bianchi_esercizio_js_19.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
function analizzaOggetto(obj) {
console.log("=== ANALISI OGGETTO ===\n");
for (let [nome, valore] of Object.entries(obj)) {
const tipo = typeof valore;
const valoreVisualizzato = tipo === 'string' ? valore.toLowerCase() : valore;
console.log(`Nome: ${nome}`);
console.log(`Tipo: ${tipo}`);
console.log(`Valore: ${valoreVisualizzato}\n`);
}
}

// Main
console.log("=== ESERCIZIO JS_19 ===\n");

const persona1 = {
nome: "Mario ROSSI",
eta: 30,
citta: "ROMA",
lavora: true,
hobby: ["calcio", "tennis"],
salario: 2500.50
};

const auto1 = {
marca: "FIAT",
modello: "PANDA",
anno: 2020,
colore: "NERO",
km: 15000,
nuovo: false
};

analizzaOggetto(persona1);
console.log("\n--- Secondo oggetto ---\n");
analizzaOggetto(auto1);
Loading