id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

gaurav.gupta@mq.edu.au variables > overallSpeed
prev  |  next  |  chance

Define a function that when passed three integers, first representing the distance between two points (say, A and B), the second representing the average speed from A to B, and the third representing the average speed back from B to A, returns the overall average speed.

REALLY understanding the fundamentals of variables and data types will be critical for this question.


overallSpeed(2, 5, 3) → 3.75
overallSpeed(10, 4, 6) → 4.8
overallSpeed(1000, 8, 25) → 12.121212121212121

...Save, Compile, Run (ctrl-enter)

double overallSpeed(int distance, int speed1, int speed2) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 4 Post-solution available

Copyright Nick Parlante 2017 - privacy