FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JavaProgramming/Function/Eligibility.java at patch-2 · subham500071430/JavaProgramming · GitHub
subham500071430
/
JavaProgramming
Public
forked from
karterhhgg/JavaProgramming
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
JavaProgramming
/
Function
/
Eligibility.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
28 lines (21 loc) · 762 Bytes
Breadcrumbs
JavaProgramming
/
Function
/
Eligibility.java
Copy path
File metadata and controls
28 lines (21 loc) · 762 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
//Write a function that takes in age as input and returns if that
//person is eligible to vote or not. A person of age > 18 is eligible to vote.
package
Function
;
import
java
.
util
.
Scanner
;
public
class
Eligibility
{
public
static
boolean
isEligibility
(
int
age
){
if
(
age
>=
18
){
System
.
out
.
print
(
"The person is eligible : "
+
" "
);
return
true
;
}
else
{
System
.
out
.
print
(
"The person is not eligible : "
+
" "
);
return
false
;
}
}
public
static
void
main
(
String
args
[]){
Scanner
sc
=
new
Scanner
(
System
.
in
);
int
age
=
sc
.
nextInt
();
// System.out.print("The circumference of a circle is:" +" ");
System
.
out
.
println
(
isEligibility
(
age
));
}
}
Back
|
FazBrowse Home
|
New Git URL