-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIfstatement.java
More file actions
149 lines (128 loc) · 3.73 KB
/
Copy pathIfstatement.java
File metadata and controls
149 lines (128 loc) · 3.73 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
package Introduction;
public class Ifstatement {
/*
* Decision making in java is one of the most important topic in java
* we two
*
* IF STATEMENT & SWICTH CASE ARE USED FOR MAKING DECISON
*
* we have student score we criteria for admission to a school course
*
* course
* student
* criteria
*
* IF ( boolean CONDITION A ){
* write your code here frowhar you wanted the decission to be
* }
*
* ELSE{
* CONDITION B
* }
*
* ELSE (CONDITION C)
* {
* WRIET OUT YTEH CONDITION HERE
*
* }
*
* opretaors
*
* aritmentic operators { * , + ,- / ,
* logical operators && , || & |
* relationa l operators > ,< >= >=, <=
* comparison operator
*
* if student plays football, shoul dbe admitted
* else if he plays music should also be admitted
* if no skills reated to this two not admitted
if they do both admitted the student
we are lookign student wo can play music or football or no admition
String Student;
String sport = football;
String Skill = music ;
*/
static String Student;
static String sport = "football";
static String Skill = "music" ;
public static void main(String[] args) {
// if student plays football admitted if, music skills admitted else no admission fro this tudent
// these test is to choose one out of the options
// if(sport == "tennis"){
// System.out.println("===== student admitted ========");
// }else if(Skill == "music") {
// System.out.println(" ========= student is also admitted === ");
// }
//choose both to make decision if student plays ball and music
// if(sport == "tennis" && Skill == "music") {// here we are testing for two
// System.out.println("===student should be admitted===");
// }else if(sport == "tennis" || Skill == "music"){ // here we are testing for one
// System.out.println("== admission granted " );
// }else {// if nothing display this
// System.out.println("== admission not granted " );
// }
//
/*
* if account balance = 1000;
* status = true;
*
*
* buy a show that is
* String show = "brown"
* if show is not brwon dont buy
* boolean buy = true;
*
*
*
*
*/
// double accountBalance = 3000;
// boolean status = true;
// double range = 1000;
// String Info = "activate";
//
// if( range == accountBalance ) {
// System.out.println("===Account activated==" + Info);
// }else{
// System.out.println("===Account is not activated===");
// }
//
//
// String Day = "Sunday";
//
//
// if(Day == "Sunday") {
// System.out.println("===Today is Sunday===");
// }else if(Day=="Monday") {
// System.out.println("===Today is not Monday===");
//
// }else {
// System.out.println("Your choice day is wrong");
// }
//
// int x = 10;
// int y = 20;
// String name ="5";
// String lastname = "Michael";
// int age = 5;
//
// int sizeName = lastname.length();
//
// if(x==y) {
// System.out.println("x and y are equal");
// }else {
// System.out.println("x and y are not equal");
// }
//
// Another if statement
// if (sizeName.equals(name)){
// System.out.println("Both values are equal");
// }else {
// System.out.println("Not equal");
// }
// if (x == y && y == age ) {
// System.out.println();
// }
//
}
}