Partial solutions: The following solutions are not complete Java programs. They are kept brief to illustrate the main ideas of the complete programs.
1. Write a Java program to calculate the trianular function as follows:
Cos(x)=1 - 2!/x 2 + 4!/x4 - 6!/x6 ...
double power=1, fact=1, sum=0;
for(int i=1; i<10; i++)
Write a complete Java program that uses a for loop to compute the sum of the even numbers and the sum of the odd numbers between 1 and 50.
for(i=1; i<=50; i++)