Advertisement
Guest User

Albert Katz

a guest
Nov 26th, 2014
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. // BlueJ project: lesson4/turningMathToJava
  2. // Video: Arithmetic Operations 2
  3.  
  4. // TODO: The amdahlSpeedup, crossRatio and average methods
  5. // aren't working yet. Use the fact sheet and your new
  6. // knowledge of math expressions in java to fix these methods.
  7.  
  8. public class MathInJava {
  9. double average = (a+b+c+d)/4;
  10. double amdahlSpeedup = 1/(s + (1-s)/n);
  11. double crossRatio = ((a-c) * (b-d))/((b-c) * (a-d));
  12.  
  13.  
  14. public double amdahlSpeedup(double s, double n) {
  15.  
  16. return amdahlSpeedup;
  17. }
  18.  
  19.  
  20. public double crossRatio(double a, double b, double c, double d) {
  21. // To do!
  22. return crossRatio;
  23. }
  24.  
  25.  
  26.  
  27. public double average(int a, int b, int c, int d)
  28. {
  29.  
  30. return average;
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement