Repository navigation
Expand file tree
/
Copy pathReturnmethodPracticeHw.java
More file actions
108 lines (70 loc) · 2.7 KB
/
Copy pathReturnmethodPracticeHw.java
File metadata and controls
108 lines (70 loc) · 2.7 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
package practice4;
public class ReturnmethodPracticeHw {
public static void main(String[] args) {
System.out.println(decorationParts("Pink","Blue","White"));
System.out.println(ticketType("A type","B type"));
System.out.println(serialNumber(9,11));
System.out.println(carNumber(3,9));
System.out.println(studyCase(true,false));
ReturnmethodPracticeHw rp = new ReturnmethodPracticeHw();
System.out.println(decorationParts("Black","SkyBlue","Green"));
System.out.println(ticketType("b type","c type"));
System.out.println(serialNumber(11,9));
System.out.println(carNumber(8,5));
System.out.println(studyCase(true,false));
}
public static String decorationParts (String Door, String Window, String Glass) {
String house;
house="One "+ Door +" door and two "+ Window + " windos ";
System.out.println(house);
String homeDecor = "The door is Pink, window is blue and Glass is white. ";
return(homeDecor);
}
public static String ticketType(String firstClass, String secondClass) {
String passengerType = firstClass + " passengers are posh and "+ secondClass + " passengers are middle class";
return(passengerType);
}
public static int serialNumber(int roundOne, int roundTwo) {
int serialCount;
serialCount= 28*roundOne /roundTwo;
return(serialCount);
}
public static int carNumber(int slot1, int slot2) {
int carCount;
carCount= 100/slot1 + 2*slot2;
return(carCount);
}
public static boolean studyCase (boolean statement1, boolean statement2) {
boolean inGeneral;
inGeneral = statement1 ;
System.out.println("This case study is " + statement1+ " but the other one is "+statement2 );
return(inGeneral);
}
public String decorationParts1 (String Door, String Window, String Glass) {
String house;
house="One "+ Door +" door and two "+ Window + " windos ";
System.out.println(house);
String homeDecor = "The door is Pink, window is blue and Glass is white. ";
return(homeDecor);
}
public String ticketType1(String firstClass, String secondClass) {
String passengerType = firstClass + " passengers are posh and "+ secondClass + " passengers are middle class";
return(passengerType);
}
public int serialNumber1(int roundOne, int roundTwo) {
int serialCount;
serialCount= 28*roundOne /roundTwo;
return(serialCount);
}
public int carNumber1(int slot1, int slot2) {
int carCount;
carCount= 100/slot1 + 2*slot2;
return(carCount);
}
public boolean studyCase1 (boolean statement1, boolean statement2) {
boolean inGeneral;
inGeneral = statement1 ;
System.out.println("This case study is " + statement1+ " but the other one is "+statement2 );
return(inGeneral);
}
}