Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class sensFinder {
  3. public static Scanner scan = new Scanner(System.in);
  4. public static double first;
  5. public static double low;
  6. public static double high;
  7.  
  8. public static void main(String[] args) {
  9. System.out.println("Start by finding our starting point");
  10. System.out.println("To do this, find the sensitivity you need to do a full 360");
  11. System.out.println("while also using your entire surface");
  12. System.out.println("What is this starting number?");
  13. first = scan.nextDouble();
  14. for (int i = 0; i < 5; i++) {
  15. low = first*0.5;
  16. high = first*1.5;
  17. System.out.println("Now, try a sensitivity of a: "+low);
  18. System.out.println("Then b: "+high);
  19. System.out.println("Which do you prefer, a or b?");
  20. String check = scan.next();
  21. if (check.equalsIgnoreCase("a")) first = (first + low)/2;
  22. if (check.equalsIgnoreCase("b")) first = (first + high)/2;
  23. }
  24. System.out.println("");
  25. System.out.println("Your final sensitivity is: "+first);
  26.  
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement