Skip to content
This repository was archived by the owner on Oct 2, 2020. It is now read-only.
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
50 changes: 50 additions & 0 deletions Employee2.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package esrcitazione3;

import java.util.HashSet;
import java.util.Set;

public class Employee2 implements Comparable<Employee2>{
private int id;
private String name;
private String surname;
private String department;
private int salary;
private Set<String> skills;

public Employee2(int id, String name, String surname, String department, int salary, Set<String> skills){
this.id=id;
this.name = name;
this.surname = surname;
this.department = department;
this.salary = salary;
this.skills = skills;
}
public int getSalary(){return salary;}
public String getDepartment(){return department;}
public String getName(){return name;}


public int getId() {
return id;
}
public String getSurname() {
return surname;
}
public Set<String> getSkills() {
return skills;
}

public boolean equals(Object arg0) {
if(arg0 instanceof Employee2)
return ((Employee2)arg0).getId()==this.getId();
return false;
}
public String toString() {
return id+","+name+","+surname+","+ department+","+salary+","+skills.toString();
}

public int compareTo(Employee2 o) {
return this.id-o.getId();
}

}
21 changes: 21 additions & 0 deletions fibonacci.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include <stdio.h>

int main() {
int i,n,primo,secondo,terzo;

printf("Quanti numeri della successione vuoi visualizzare? ");
scanf("%d", &n);

primo=1;
secondo=1;

printf("%d\n",primo);
printf("%d\n",secondo);

for(i=2;i<n;i++) {
terzo=primo+secondo;
primo=secondo;
secondo=terzo;
printf("%d\n",terzo);
}
}