Skip to content
This repository was archived by the owner on Dec 10, 2021. It is now read-only.

Commit 1647d66

Browse files
committed
ht6: array of workers
1 parent d6c5fe3 commit 1647d66

File tree

5 files changed

+68
-0
lines changed

5 files changed

+68
-0
lines changed

src/Main.class

-2.09 KB
Binary file not shown.

src/com.company/Cat.class

246 Bytes
Binary file not shown.

src/com.company/Cat.java

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.company;
2+
3+
public class Cat {
4+
String name;
5+
int age;
6+
7+
public void sayMeow() {
8+
System.out.println(name + " meowed");
9+
}
10+
11+
public Cat(String name, int age) {
12+
this.name = name;
13+
this.age = age;
14+
}
15+
}

src/Main.java src/com.company/Main.java

+29
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,14 @@ public static void main(String[] args) throws IOException {
151151
}
152152
}
153153
*/
154+
package com.company;
155+
154156
import java.io.BufferedReader;
155157
import java.io.IOException;
156158
import java.io.InputStreamReader;
157159
import java.util.Locale;
160+
import java.util.Scanner;
161+
import com.company.Cat;
158162

159163
/*public class Main {
160164
public static void main(String[] args) throws IOException {
@@ -204,6 +208,7 @@ public static void main(String[] args) throws IOException {
204208
}
205209
*/
206210

211+
/*
207212
public class Main {
208213
public static void main(String[] args) throws IOException{
209214
//task 1
@@ -254,4 +259,28 @@ public static void leap(int year) {
254259
System.out.println("The year isn't leap");
255260
}
256261
}
262+
}*/
263+
264+
//lesson 6
265+
public class Main {
266+
/*public static void main(String args[]) {
267+
Cat cat1 = new Cat("Oliver", 6);
268+
Cat cat2 = new Cat("Pumpin", 5);
269+
cat1.sayMeow();
270+
cat2.sayMeow();
271+
}*/
272+
273+
public static void main(String args[]) {
274+
Person[] persArray = new Person[5];
275+
persArray[0] = new Person("Ivanov Ivan", "Engineer", "[email protected]", "892312312", 30000, 30);
276+
persArray[1] = new Person("Dasha Koreyka", "ABOBA", "[email protected]", "12121212121", 12000, 12);
277+
persArray[2] = new Person("Alexey Shevtsov", "Expert", "[email protected]", "+380635993686", 1000000000000, 165125)
278+
persArray[3] = new Person("Igor Tokac", "Kreslo master", "[email protected]", "88005553535", 666666666, 32)
279+
persArray[4] = new Person("Valeriy Albetovich", "Amogus", "[email protected]", "66666666666", 13, 40);
280+
for (i = ; i > persArray.length; i ++) {
281+
if (i.age > 40) {
282+
System.out.println(repsArray);
283+
}
284+
}
285+
}
257286
}

src/com.company/Worker.java

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.company;
2+
3+
public class Worker {
4+
String snf;
5+
String job;
6+
String email;
7+
String phone;
8+
int salary;
9+
int age;
10+
11+
12+
public void workerInfo() {
13+
System.out.println(Worker);
14+
}
15+
16+
public Worker(String snf, String job, String email, String phone, int salary, int age) {
17+
this.snf = snf;
18+
this.job = job;
19+
this.email = email;
20+
this.phone = phone;
21+
this.salary = salary;
22+
this.age = age;
23+
}
24+
}

0 commit comments

Comments
 (0)