Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
DAE-Ujapack
/
Ujapack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ec2f3bce
authored
Oct 24, 2020
by
José Miguel Martínez Galián
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Metodo calcular importe hecho
parent
2ee85143
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
src/main/java/es/ujaen/dae/Ujapack/UjapackApplication.java
src/main/java/es/ujaen/dae/entidades/Envio.java
src/main/java/es/ujaen/dae/Ujapack/UjapackApplication.java
View file @
ec2f3bce
...
...
@@ -69,8 +69,8 @@ public class UjapackApplication {
}
//Prueba del metodo Calcular ruta
Envio
e
=
new
Envio
(
"Jose"
,
"Maria"
,
"Almeria"
,
"Almeria"
,
50
,
16
,
16
,
16
);
//Prueba del metodo Calcular ruta
y calcular importe
Envio
e
=
new
Envio
(
"Jose"
,
"Maria"
,
"Almeria"
,
"Almeria"
,
0.5f
,
20.4f
,
20.4f
,
20.4f
);
ArrayList
<
PuntodeControl
>
j
=
new
ArrayList
<>();
j
=
e
.
calcularRuta
(
puntosdecontrol
,
e
);
...
...
@@ -79,6 +79,9 @@ public class UjapackApplication {
for
(
int
i
=
0
;
i
<
j
.
size
();
i
++){
System
.
out
.
println
(
j
.
get
(
i
));
}
float
v
=
0
;
v
=
e
.
calcularImporte
(
e
);
System
.
out
.
println
(
v
);
//Fin de prueba del metodo calcular ruta. Esto debe pasarse a un test propio
}
...
...
src/main/java/es/ujaen/dae/entidades/Envio.java
View file @
ec2f3bce
...
...
@@ -35,7 +35,14 @@ public class Envio {
this
.
listadoPuntos
=
new
ArrayList
<>();
}
public
void
calcularImporte
(){}
//cambiar void por float
public
float
calcularImporte
(
Envio
e
){
float
importe
=
0
;
importe
=
(
e
.
getPeso
()*
e
.
getAlto
()*
e
.
getAncho
()*
e
.
getLargo
()*((
e
.
getListadoPuntos
().
size
())+
1
)/
1000
);
return
importe
;
}
...
...
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