Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Ü
übung1_präsent
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jona Sprinkmeier
übung1_präsent
Merge requests
!1
feature/rent
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
feature/rent
feature/rent
into
develop
Overview
0
Commits
1
Pipelines
0
Changes
3
Open
Axel Kirst
requested to merge
feature/rent
into
develop
4 years ago
Overview
0
Commits
1
Pipelines
0
Changes
3
Expand
0
0
Merge request reports
Compare
develop
version 1
a294d8de
4 years ago
develop (base)
and
latest version
latest version
a294d8de
1 commit,
4 years ago
version 1
a294d8de
1 commit,
4 years ago
3 files
+
39
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
src/car/Car.java
+
21
−
2
Options
@@ -5,7 +5,9 @@ public class Car {
private
int
id
;
private
int
cost
;
private
int
monthlyCost
;
private
boolean
taken
;
private
int
rentDuration
;
private
boolean
sold
;
public
Car
(
int
id
,
int
cost
)
{
@@ -14,6 +16,23 @@ public class Car {
this
.
sold
=
false
;
}
public
void
rent
(
int
dur
){
this
.
taken
=
true
;
this
.
rentDuration
=
dur
;
}
public
int
rentCost
()
{
return
this
.
monthlyCost
;
}
public
int
duration
(){
return
this
.
rentDuration
;
}
public
boolean
isRented
(){
return
this
.
taken
;
}
public
void
sell
()
{
this
.
sold
=
true
;
}
@@ -33,6 +52,6 @@ public class Car {
public
boolean
isAvailable
()
{
// check if a car is available (not sold or not rented)
return
!
isSold
();
return
!
isSold
()
&&
!
isRented
()
;
}
}
Loading