Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Projet GORDYJAN_BAGNOLY_GARCIA_POIGNONNEC
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
POIGNONNEC
Projet GORDYJAN_BAGNOLY_GARCIA_POIGNONNEC
Commits
96a0604c
Commit
96a0604c
authored
May 13, 2019
by
Théo GORDYJAN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finished the Engine package
parent
fa45fb1e
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
90 additions
and
68 deletions
+90
-68
workspace.xml
garage/.idea/workspace.xml
+41
-61
ElectricEngine.java
garage/src/Engine/ElectricEngine.java
+13
-1
Engine.java
garage/src/Engine/Engine.java
+14
-4
HybridEngine.java
garage/src/Engine/HybridEngine.java
+11
-1
PetrolEngine.java
garage/src/Engine/PetrolEngine.java
+11
-1
No files found.
garage/.idea/workspace.xml
View file @
96a0604c
This diff is collapsed.
Click to expand it.
garage/src/Engine/ElectricEngine.java
View file @
96a0604c
package
Engine
;
public
class
ElectricEngine
{
public
class
ElectricEngine
extends
Engine
{
public
ElectricEngine
(
String
_cylindre
,
Double
_price
)
{
super
(
_cylindre
,
_price
);
this
.
type
=
EngineType
.
ELECTRIC
;
}
public
String
toString
()
{
return
"Electric Engine"
;
}
}
garage/src/Engine/Engine.java
View file @
96a0604c
...
...
@@ -3,13 +3,13 @@ package Engine;
public
class
Engine
{
protected
EngineType
type
;
pr
ivate
String
cylindre
;
pr
ivate
Double
price
;
pr
otected
String
cylindre
;
pr
otected
Double
price
;
public
Engine
(
String
_cylindre
,
Double
_price
)
{
this
.
cylindre
=
_cylindre
;
this
.
price
=
_price
;
this
.
price
=
getPrice
()
;
}
...
...
@@ -22,7 +22,17 @@ public class Engine {
}
public
Double
getPrice
()
{
if
(
this
.
getClass
()
==
DieselEngine
.
class
)
{
return
2000
d
;
}
else
if
(
this
.
getClass
()
==
ElectricEngine
.
class
)
{
return
1800
d
;
}
else
if
(
this
.
getClass
()
==
HybridEngine
.
class
)
{
return
3000
d
;
}
else
if
(
this
.
getClass
()
==
PetrolEngine
.
class
)
{
return
1400
d
;
}
else
{
return
0
d
;
}
}
...
...
garage/src/Engine/HybridEngine.java
View file @
96a0604c
package
Engine
;
public
class
HybridEngine
{
public
class
HybridEngine
extends
Engine
{
public
HybridEngine
(
String
_cylindre
,
Double
_price
)
{
super
(
_cylindre
,
_price
);
this
.
type
=
EngineType
.
HYBRID
;
}
public
String
toString
()
{
return
"Hybrid Engine"
;
}
}
garage/src/Engine/PetrolEngine.java
View file @
96a0604c
package
Engine
;
public
class
PetrolEngine
{
public
class
PetrolEngine
extends
Engine
{
public
PetrolEngine
(
String
_cylindre
,
Double
_price
)
{
super
(
_cylindre
,
_price
);
this
.
type
=
EngineType
.
PETROL
;
}
public
String
toString
()
{
return
"Petrol Engine"
;
}
}
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