Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CS570-Java_Projects
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
Container registry
Model registry
Operate
Environments
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
bjv33
CS570-Java_Projects
Commits
667bb4e6
Commit
667bb4e6
authored
6 years ago
by
bjv33
Browse files
Options
Downloads
Patches
Plain Diff
Motorboat Test
parent
d05fa903
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
MotorboatTest.java
+28
-0
28 additions, 0 deletions
MotorboatTest.java
with
28 additions
and
0 deletions
MotorboatTest.java
0 → 100644
+
28
−
0
View file @
667bb4e6
public
class
MotorboatTest
{
public
static
void
main
(
String
[]
args
)
{
Motorboat
myBoat
=
new
Motorboat
();
//Starting Settings
myBoat
.
start
(
15
,
55
,
0.43
);
//User Prompt
System
.
out
.
println
(
"Testing the Motorboat Class"
);
System
.
out
.
println
(
"----------------------------"
);
//Boat Information
System
.
out
.
println
(
"My boat has "
+
myBoat
.
tank
()
+
" gallons in its tank."
);
System
.
out
.
println
(
"We are traveling at "
+
myBoat
.
userSpeed
()
+
" miles per hour."
);
System
.
out
.
println
(
"After traveling for 30 minutes, there are "
+
myBoat
.
efficient
()
+
" gallons in the tank."
);
System
.
out
.
println
(
"And we have traveled "
+
myBoat
.
distance
()
+
" miles."
);
//If tank is low, message to refuel
if
(
myBoat
.
tank
()
<
20
)
{
System
.
out
.
println
(
"We need to refuel before traveling back."
);
System
.
out
.
println
(
"Lets get 10 more gallons."
);
System
.
out
.
println
(
"After refueling, we have "
+
myBoat
.
refuel
()
+
" gallons in the tank."
);
}
else
System
.
out
.
println
(
"Ready to go back!"
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment