• May 20th, 2010, 11:21 PM
james
Hey guys i have anther program here that really needs your help.
Heres the question:
Do the following programs:
a) Write a program to display the sum of first 10 even numbers [2]
b) Write a program that displays the total number of multiples of 7 between the
numbers 1 and 100 [2]
c) Write a program to add seven terms of the following series. 1! + 2! + 3! ................
[3]

Code :

```public class quetion3a { public static void main(String[] args) { int num, sum; sum= 0; for (num=2; num<21; num=num+2) { sum=sum+num; } System.out.println("The sum of the first ten even numbers is "+sum); } }```
/>:o:o:o:o:o:confused::confused::confused:
• May 21st, 2010, 12:07 AM
Darryl.Burke
Hey, whaddya think this is, a homework service? ;)

The Java™ Tutorials

db
• May 22nd, 2010, 07:06 AM
dlorde
We can help you write the code, but we won't write it for you. Post the code you have so far and explain what you are stuck on.
• June 4th, 2010, 04:41 PM
javapenguin
For second part, perhaps

Code :

```int num1 = 1; int num2 = 1;   while (num2 >=1 && num2 <= 100) { num2 = num1 % 7;   if (num2 == 0) { isMultiple = true; System.out.println(num1); num2 = 1; num1 = num1 + 1;   }   else { isMultiple = false; num1 = num1+ 1 }   }```
• June 6th, 2010, 04:38 PM
javapenguin
```int arrayOfStoredFactorials[] = new int [7];   int list[] = new int[7];   for (int a = 0; a < 7; a++) { list[a] = a+1; }   for (int i= 0; i < 7 ; i++) { arrayOfStoredFactorials[i] = list[i];     if (i > 0) { arrayOfFactorials[i] = list[i] * list[i-1]; }   }   int sum = 0;   for (int index = 0; index < arrayOfFactorials.length; index++) { sum = sum + arrayOfFactorials[index[; }   System.out.println(sum);```