Advertisement
476179

Untitled

Nov 12th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. System.out.println("Example 1:");
  2. double sales = 12345.67;
  3. System.out.printf("are sales are %f for the day.\n\n", sales);
  4.  
  5.  
  6.  
  7. System.out.println("Example 2: ");
  8. double temp1 = 72.5, temp2 = 83.7;
  9. System.out.printf("The temperature are %f and %f degress\n\n", temp1, temp2);
  10.  
  11.  
  12.  
  13. System.out.println("Example 3: ");
  14. double value1 = 3.0, value2 = 6.0, value3 = 9.0;
  15. System.out.printf("%f %f %f\n\n",value1, value2, value3);
  16.  
  17.  
  18. System.out.println("Example 4: ");
  19. int hours = 40;
  20. System.out.printf("I worked %d hours this week",hours);
  21. //%d for integers.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement