Advertisement
calcpage

APCS_SHORTS_C1X5_Sum10.java

Oct 4th, 2013
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 0.44 KB | None | 0 0
  1. /*
  2. Sum10.java      MrG     2013.1003
  3. purpose:        using println to do arithmetic!
  4. required files:     Sum10.java      main class
  5. translator phase:   javac Sum10.java
  6. interpreter phase:  java Sum10
  7. */
  8.  
  9. //main method
  10. public class Sum10
  11. {
  12.     public static void main(String[] args)
  13.     {
  14.         System.out.print("1+2+3+4+5+6+7+8+9+10 = ");
  15.         System.out.println(1+2+3+4+5+6+7+8+9+10);
  16.     }
  17. }
  18.  
  19. //C1X6: find the sum of the reciprocals of the first 10 positive integers
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement