Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
maboglia committed Nov 7, 2017
1 parent 34de7f4 commit e68e192
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
19 changes: 19 additions & 0 deletions OOP4/container.html
@@ -0,0 +1,19 @@
<!doctype html>
<html>
<head>
<meta lang="it"/>
<meta charset="utf-8"/>
<title>contenitore di script</title>
<link rel="stylesheet" type="text/css" href="stile.css">
</head>

<body>
<input id="num1" type="text"/>
<input id="num2" type="text"/>
<button id="btn1">go</button>
<div id="output"><b>hello</b> div!</div>


<script src="test.js"></script>
</body>
</html>
41 changes: 41 additions & 0 deletions OOP4/test.js
@@ -0,0 +1,41 @@
function Studente (nome, cognome, anno) {

this.nome = nome;
this.cognome = cognome;
this.anno = 2017 - anno;
this.accendiPC = function () {
console.log(this.nome + "ha acceso il pc");
return "eseguito";
}

}


Studente.genere = 'M';



var studenti = [
new Studente("panco", "pallone", 1500),
new Studente("Panco", "pallone", 1400),
new Studente("Banco", "pallone", 1700),
new Studente("Zanco", "pallone", 1600),
new Studente("pinco", "pallino", 1200)

];

for (var i = 0; i < studenti.length; i++) {
var output = studenti[i].nome;
output += " ";
output += studenti[i].cognome;
output += " ";
output += studenti[i].anno;
output += " ";
output += studenti[i].accendiPC();
output += "<br>";
document.write(output);
}

//console.log(studenti[0].nome);
//console.log(studenti[1].nome);
//console.info(studenti.length);

0 comments on commit e68e192

Please sign in to comment.