Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. package com.kasia;
  2.  
  3. import java.sql.SQLOutput;
  4.  
  5. public class Main {
  6. public static void main(String[] args) {
  7. int myValue=5;
  8. float MyFloat=5f;
  9. double Mydoule=5d;
  10. System.out.println("myintValue=" + myValue);
  11. System.out.println("myfloatValue=" + MyFloat);
  12.  
  13. double kg=5.6d;
  14. double pound= 0.45359237d*kg;
  15. System.out.println(pound);
  16.  
  17. double numPounds=200d;
  18. double numkg= numPounds*0.45359237d;
  19. System.out.println(numkg);
  20. char a='\u00A9';//unicode char
  21.  
  22. System.out.println(a);
  23. boolean MyBoolean= false;
  24. boolean Isx = true;
  25.  
  26.  
  27. double x=20d;
  28. double y=80d;
  29. double sum25=(x+y)*25;
  30. double theRemainder= sum25/40;
  31. if(theRemainder<=20)
  32. System.out.println("yotal was over the limit");
  33. int player= CalculateHighScoreposition(5000);
  34. displayHighScorePosition("jan",player);
  35. }
  36.  
  37.  
  38. public static void displayHighScorePosition(String name,int x){
  39. System.out.println(name+ "managed to get position "+ x+ " on the high score table");
  40. }
  41. public static int CalculateHighScoreposition(int score)
  42. {
  43. if(score>1000)
  44. return 1;
  45. else if(score>500 && score<1000)
  46. return 2;
  47. else if (score>100 && score <500)
  48. return 3;
  49. else return 4;
  50.  
  51.  
  52. }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement