Welcome to the GitHub repository for the CS4421-2022 cohort (ISE) at the University of Limerick! Here you will find all the exercises and content regarding CS4421. You are free to submit PR's to improve the content.
So for this exercise, we wil be looking at a physics problem and using what we've learned so far to implement a solution to the below problem.
- A bicyclist goes up a hill at 30 km/hr and comes back down the same hill at 90 km/hr.
- You are to find and output the average speed for this trip.
- Note: It will not be 60 km/hr
- Also calculate and output the cyclist's average speed if they go up the hill at 20 km/hr and down the hill at 100 km/hr.
Before writing any code, you should make sure that you understand the problem on paper before trying to then put that into code.
This project will require you to work with doubles(decimal numbers) in java rather than using integers. To make whole numbers work as doubles, you should write them as 1.0, 3.0 instead of just 1, 3. Example below
int integer = 123;
double wholeNumberAsDouble = 123.0;
For this exercise, we will be autograding it so you will need to have your print outs in a specific format which can be found below.
Expected output format
"For a bicycle going up the hill at X speed and down the hill at Y speed, the average speed is : AverageSpeed km/hr"
Example output(Answer is not correct)
For a bicycle going up the hill at 30 speed and down the hill at 90 speed, the average speed is : 45 km/hr
You should do this for both the scenarios in the problem space and print them out to the console. There is no requirement to in take the speeds but instead, you should put these parameters above into variables for them to be used.
- Adam J. Doherty Master student at UL
- Ivan Hugo Guevara PhD researcher at Confirm Centre@UL
- Dr. Salim Saay Lecturer at University of Limerick
- Prof. Tiziana Margaria Full professor and Co-Director of Immersive Software Engineering [1] at University of Limerick