This is a lab project we are working on, and I am at a standstill. I am in a beginner Computer Science course, for background purposes, so please don't get too technical. Any help would be greatly appreciated. Thanks
1. A variable that counts the iterations of a loop is called a loop index or loop control variable. In the preceding examples nyear serves as an index, counting the number of years to the next millennium. This type of loop is frequently written using a for loop.
for (initialization; condition; update)
statement
Write a program controlled by two (non-nested) for loops that produces the following listing of inclusive dates, from the fifth century B.C. through the fifth century A.D.
Century 5 BC 400-499
Century 4 BC 300-399
Century 3 BC 200-299
Century 2 BC 100-199
Century 1 BC 1-99
Century 1 AD 1-99
Century 2 AD 100-199
Century 3 AD 200-299
Century 4 AD 300-399
Century 5 AD 400-499
Here is what I have; I can get the first line to come out, but having problem with the repetition down.
public class Century
{
public static void main(String[] args)
{
for (int i = 5 ; i <= 5 ; i++)
{
int years = ((i-1)*100);
int years2 = ((i*100) -1);
System.out.println("Century " + i +" "+ "BC" +" "+ years + " - " + years2);
{
{
for (int j = 1; j <=1 ; j++)
{
int year3 = ((j+1)*100);
int years4 = ((j*100) -1);
System.out.println("Century " + j +" "+ "AD" +" "+ years + " - " + years2);
{
}
}
}
}}}
}