-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsnippets.txt
69 lines (51 loc) · 3.42 KB
/
snippets.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
inputter:
for (byte sector = 1; sector <= dataset.length; sector++)
{
for (byte subSector = 1; subSector <= dataset[0].length; subSector++)
{
for (byte street = 1; street <= dataset[0][0].length; street++)
{
for (byte house = 1; house <= dataset[0][0][0].length; house++)
{
for (byte portion = 1; portion <= dataset[0][0][0][0].length; portion++)
{
System.out.printf("CID: %d\n",dataset[sector-1][subSector-1][street-1][house-1][portion-1].CID);
System.out.printf("Name: %s\n",dataset[sector-1][subSector-1][street-1][house-1][portion-1].customerName);
System.out.printf("Electricity Reading: %d\n",dataset[sector-1][subSector-1][street-1][house-1][portion-1].utilities[0].currentReading);
System.out.printf("Gas Reading: %d\n",dataset[sector-1][subSector-1][street-1][house-1][portion-1].utilities[1].currentReading);
System.out.printf("Water Litres: %d\n",dataset[sector-1][subSector-1][street-1][house-1][portion-1].utilities[2].currentReading);
System.out.printf("Internet Reading: %d\n",dataset[sector-1][subSector-1][street-1][house-1][portion-1].utilities[3].currentReading);
}
}
}
}
}
setter:
for (byte sector = 1; sector <= dataset.length; sector++)
{
for (byte subSector = 1; subSector <= dataset[0].length; subSector++)
{
for (byte street = 1; street <= dataset[0][0].length; street++)
{
for (byte house = 1; house <= dataset[0][0][0].length; house++)
{
for (byte portion = 1; portion <= dataset[0][0][0][0].length; portion++)
{
dataset[sector-1][subSector-1][street-1][house-1][portion-1] = new CBSRecord();
long CID = (long) sector *subSector*street*house*house*portion;
dataset[sector-1][subSector-1][street-1][house-1][portion-1].CID = CID;
System.out.print("Enter Name: ");
dataset[sector-1][subSector-1][street-1][house-1][portion-1].customerName = input.nextLine();
System.out.print("Enter Electricity Reading: ");
dataset[sector-1][subSector-1][street-1][house-1][portion-1].utilities[0].currentReading = input.nextInt();
System.out.print("Enter Gas Reading: ");
dataset[sector-1][subSector-1][street-1][house-1][portion-1].utilities[1].currentReading = input.nextInt();
System.out.print("Enter Water Litres Consumed: ");
dataset[sector-1][subSector-1][street-1][house-1][portion-1].utilities[2].currentReading = input.nextInt();
System.out.print("Enter Internet reading: ");
dataset[sector-1][subSector-1][street-1][house-1][portion-1].utilities[3].currentReading = input.nextInt();
}
}
}
}
}