This repository has been archived by the owner on Jun 22, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Claudiu Bicsabi
committed
Apr 17, 2018
1 parent
a37c6ff
commit 15ddef2
Showing
10 changed files
with
93 additions
and
63 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package JavaBasicsLab.S04_05; | ||
|
||
public class CabinetVeterinar { | ||
Caine[] registruCaini; | ||
String numeDoctor; | ||
Caine caineleCabinetului; | ||
private int numarCaini; | ||
|
||
public CabinetVeterinar() { | ||
this.registruCaini = new Caine[20]; | ||
this.numarCaini = 0; | ||
} | ||
|
||
public void vaccineaza(Caine c){ | ||
c.setVaccinat(true); | ||
} | ||
|
||
public void adaugaCaine(Caine c){ | ||
registruCaini[numarCaini] = c; | ||
numarCaini++; | ||
} | ||
|
||
public void print() { | ||
for (int i = 0; i < numarCaini; i++) { | ||
System.out.println(registruCaini[i].getNume()); | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/JavaBasicsLab/S04/Caine.java → src/JavaBasicsLab/S04_05/Caine.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package JavaBasicsLab.S04; | ||
package JavaBasicsLab.S04_05; | ||
|
||
public class Caine { | ||
private String rasa; | ||
|
2 changes: 1 addition & 1 deletion
2
...aBasicsLab/S04/Homework/CashRegister.java → ...sicsLab/S04_05/Homework/CashRegister.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...JavaBasicsLab/S04/Homework/Inventory.java → ...aBasicsLab/S04_05/Homework/Inventory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/JavaBasicsLab/S04/Homework/Main.java → src/JavaBasicsLab/S04_05/Homework/Main.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/JavaBasicsLab/S04/Homework/ShopItem.java → ...vaBasicsLab/S04_05/Homework/ShopItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...aBasicsLab/S04/Homework/ShoppingCart.java → ...sicsLab/S04_05/Homework/ShoppingCart.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package JavaBasicsLab.S04_05; | ||
|
||
public class MainClassSession4 { | ||
public static void main(String[] args) { | ||
Caine c1 = new Caine("Gigel", -4); | ||
|
||
c1.setRasa("Beremanez"); | ||
c1.setVaccinat(true); | ||
|
||
System.out.println(c1.getNume()); | ||
System.out.println(c1.getRasa()); | ||
System.out.println(c1.getVarsta()); | ||
System.out.println(c1.isVaccinat()); | ||
|
||
Caine c2 = new Caine("Azor", -6); | ||
System.out.println(c2.getVarsta()); | ||
|
||
c2.setVarsta(2); | ||
System.out.println(c2.getVarsta()); | ||
|
||
CabinetVeterinar doggyVet = new CabinetVeterinar(); | ||
|
||
System.out.println("Stadiul vaccinarii cainelui: " + c2.isVaccinat()); | ||
doggyVet.vaccineaza(c2); | ||
System.out.println("Stadiul vaccinarii cainelui: " + c2.isVaccinat()); | ||
|
||
doggyVet.adaugaCaine(c1); | ||
doggyVet.adaugaCaine(c2); | ||
|
||
doggyVet.print(); | ||
|
||
System.out.println(c1); | ||
System.out.println(doggyVet.registruCaini[0]); | ||
System.out.println(doggyVet.registruCaini[3]); | ||
|
||
int in = 3; | ||
|
||
System.out.println("-------"); | ||
|
||
Caine c3 = c2; | ||
System.out.println(c2.getNume()); | ||
System.out.println(c3.getNume()); | ||
c3.setNume("Grasu"); | ||
System.out.println(c2.getNume()); | ||
System.out.println(c3.getNume()); | ||
c2.setNume("Slabul"); | ||
System.out.println(c2.getNume()); | ||
System.out.println(c3.getNume()); | ||
|
||
System.out.println("======="); | ||
|
||
c3.setNume(c1.getNume()); | ||
System.out.println(c3.getNume()); | ||
c1.setNume("Marius"); | ||
System.out.println(c1.getNume()); | ||
System.out.println(c3.getNume()); | ||
|
||
} | ||
} |