Write an application that finds the total and average of odd numbers from 1 to 15. Your program must use a counted loop to accomplish this task.
So far all I have is >
public class OddLoop {
public static void main(String[] args) {
{
int total = 1;
for (int i = 3; i <= 15; i += 2)
{
total = total * i;
}
System.out.println("The sum of the odd integers is:" + total);
}
}
}
Any Help will be greatly appreciated! Thank you for your time!