sudoaptinstallname

Untitled

Jan 23rd, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. package com.company;
  2. /*
  3. Amon Guinan
  4. Wednesday, January 23, 2019
  5.  
  6. Program calculates the sum of the first four factors of seven.
  7. */
  8. public class six_twentyFour {
  9. public static void main(String [] args)
  10. {
  11. int sum;
  12. int mults_of_7 = 0;
  13. int count = 1;
  14.  
  15. while(count <= 4)
  16. {
  17. sum = count * 7;
  18. System.out.println(count+" : "+sum);
  19. count = count +1;
  20. mults_of_7 = mults_of_7 + sum;
  21. }
  22. System.out.print("Sum: "+mults_of_7);
  23. }
  24. }
Add Comment
Please, Sign In to add comment