Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
java-e001
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hugo Villagra
java-e001
Commits
1180ee9f
Commit
1180ee9f
authored
Oct 12, 2018
by
Marcos Echague
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Ejercicio10.java
parent
8f690dfe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
23 deletions
+24
-23
Ejercicio10.java
+24
-23
No files found.
Ejercicio10.java
View file @
1180ee9f
import
java.util.Scanner
;
/**
* Ejercicio10
*/
public
class
Ejercicio10
{
public
static
void
main
(
String
[]
args
)
{
String
[]
diasLaborales
=
{
"lunes"
,
"martes"
,
"miercoles"
,
"jueves"
,
"viernes"
};
Scanner
teclado
=
new
Scanner
(
System
.
in
);
System
.
out
.
println
(
"Ingrese el dia de la semana"
);
String
dia
=
teclado
.
nextLine
();
dia
=
dia
.
toLowerCase
();
for
(
int
i
=
0
;
i
<
diasLaborales
.
length
;
i
++){
if
(
dia
.
compareTo
(
diasLaborales
[
i
])==
0
){
System
.
out
.
println
(
"Es un dia laboral"
);
teclado
.
close
();
return
;
}
}
System
.
out
.
println
(
"No es un dia laboral"
);
teclado
.
close
();
}
}
\ No newline at end of file
import
java.util.Scanner
;
/**
* Ejercicio10
*/
public
class
Ejercicio10
{
public
static
void
main
(
String
[]
args
)
{
String
[]
diasLaborales
=
{
"lunes"
,
"martes"
,
"miercoles"
,
"jueves"
,
"viernes"
};
Scanner
teclado
=
new
Scanner
(
System
.
in
);
System
.
out
.
println
(
"Ingrese el dia de la semana"
);
String
dia
=
teclado
.
nextLine
();
dia
=
dia
.
toLowerCase
();
for
(
int
i
=
0
;
i
<
diasLaborales
.
length
;
i
++){
if
(
dia
.
compareTo
(
diasLaborales
[
i
])==
0
){
System
.
out
.
println
(
"Es un dia laboral"
);
teclado
.
close
();
return
;
}
}
System
.
out
.
println
(
"No es un dia laboral"
);
teclado
.
close
();
}
}
//mechague Excelente!. Se podria controlar el caso que ingrese por teclado cualquier cosa que no se aun dia de la semana.
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment