Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // BlueJ project: lesson4/turningMathToJava
- // Video: Arithmetic Operations 2
- // TODO: The amdahlSpeedup, crossRatio and average methods
- // aren't working yet. Use the fact sheet and your new
- // knowledge of math expressions in java to fix these methods.
- public class MathInJava {
- double average = (a+b+c+d)/4;
- double amdahlSpeedup = 1/(s + (1-s)/n);
- double crossRatio = ((a-c) * (b-d))/((b-c) * (a-d));
- public double amdahlSpeedup(double s, double n) {
- return amdahlSpeedup;
- }
- public double crossRatio(double a, double b, double c, double d) {
- // To do!
- return crossRatio;
- }
- public double average(int a, int b, int c, int d)
- {
- return average;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement