Commit e7b1f4df authored by matthias's avatar matthias
Browse files

geloest Videothek

parent 9caa3d3e
......@@ -7,14 +7,13 @@ public class Videothek {
Medium[] lentMedia = new Medium[6];
public float lendAllMedia(Medium... medien) {
float summary = 0;
for (Medium m : medien) {
summary += m.lendMedia();
System.out.println("Der Leihstatus des Mediums ist: " + m.isLent);
System.out.println("Der Leihstatus des Mediums ist: " + m.isLent);
}
System.out.println("- -- -- -- -- -- -- -- -- -- -- -- -");
......@@ -22,24 +21,33 @@ public class Videothek {
return summary;
}
public float lendFirstThreeMedia(){
public void returnAllMedia(Medium... medien) {
for (Medium m : medien) {
m.isLent = false;
}
}
public float lendFirstThreeMedia() {
float summary = 0;
for (int i = 0; i <=2; i++){
for (int i = 0; i <= 2; i++) {
summary += allMedia[i].lendMedia();
}
System.out.println("Der Gesamtpreis beträgt: " + summary + " Euro.");
return summary;
}
public float lendLastThreeMedia(){
public float lendLastThreeMedia() {
float summary = 0;
for (int i = 3; i <6; i++){
for (int i = 3; i < 6; i++) {
summary += allMedia[i].lendMedia();
}
System.out.println("Der Gesamtpreis beträgt: " + summary + " Euro.");
return summary;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment