Advertisement
konlawat007

Homework 2

Aug 28th, 2014
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. การบ้านหน้า 52
  2. ข้อ 13.
  3.  
  4. public static void main(String[] args) {
  5. double x =7;
  6. double total = 4*(x*x*x) + 3*(x*x) + 2*x + 1;
  7. System.out.println("4x^3 + 3x^2 + 2X + 1 ="+ total);
  8. }
  9. ---------------
  10. ข้อ 14.
  11.  
  12.  
  13. public class TimeCal {
  14. public static void main(String[] args) {
  15. double time1h =1;
  16. double time2h =2;
  17. double time3h =3;
  18.  
  19. double min2 =30;
  20. double min3 =59;
  21. double sum1 =time1h*60 ;
  22. double sum2 =time2h*60 + min2 ;
  23. double sum3 =time3h*60 + min3 ;
  24.  
  25.  
  26. System.out.println("Please Chang hr to min following chioce");
  27.  
  28. System.out.println("1. 1Hr ="+sum1);
  29.  
  30. System.out.println("2. 2Hr 30min =" +sum2);
  31.  
  32. System.out.println("2. 3Hr 59min =" +sum3);
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement