liangm20

44-50, even

Sep 15th, 2016
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. 44.
  2. public class squareofinteger
  3. {
  4. public static void main(String[] args)
  5. {
  6. for(int number =1; number <= 9; number++)
  7. {
  8. int square = number*number;
  9. System.out.print(square+" ");
  10. }
  11. }
  12. }
  13. 46.
  14. public class fourstars
  15. {
  16. public static void main(String[] args)
  17. {
  18. int star;
  19. for(star=1; star<=4; star++)
  20. {
  21. System.out.print("*");
  22. }
  23. }
  24. }
  25. 48.
  26. //also change the input of double kilo to 50 and 100
  27. public class kilogramstopounds
  28. {
  29. public static void main(String[] args)
  30. {
  31. double kilo=10;
  32. double pounds;
  33. conversion(kilo);
  34. }
  35. public static void conversion(double kilo)
  36. {
  37. double pounds = kilo/.454;
  38. System.out.print(kilo + " kilograms = " + pounds + "pounds.");
  39. }
  40. }
  41. 50.
  42. public class circumference
  43. {
  44. public static void main(String [] args)
  45. {
  46. double radius = 3.2;
  47. double pi = 3.14159;
  48. double circumference = radius*2*pi;
  49. System.out.print("circumference = " + circumference);
  50. }
  51. }
Add Comment
Please, Sign In to add comment