Let's take a look at your earlier post:
Originally posted by Mimi Sini:
thanks for your response this is what i have for the first one..
and then i was told to do this, but i still don't understand how. where to input
a. Write a small html document with no script to display Hello with a font size being 7. That is:
<font size=7>Hello</font><br>
b. Put this line into a loop and display 7 Hello with the same font size (i.e. 7)
c. Now you have a control variable say i But goes from one to seven.
What you need is replacing the number 7 by i.
Next, let's look at the code from your last post:
Let's clean that up a little by combining it with what you had in the first post of using 'i' as the index variable rather than 'varname'. Plus we need to include the variable declaration like you had above. That would give you this:
If you look at that code, that's the same code from my previous post. When run, that will print out Hello, all in the same font size of 7:
<font size=7>Hello</font>
<font size=7>Hello</font>
<font size=7>Hello</font>
<font size=7>Hello</font>
etc...
So that means you have part a and part b taken care of. All you need to do is part c. Take a look again at what your instructions say for part c, with some emphasis added:
c. Now you have a control variable say i. It goes from one to seven.
What you need to do is replace the number 7 with i.
You want to get it to print Hello in an increasing font size. So you ultimately want it to print:
<font size=1>Hello</font>
<font size=2>Hello</font>
<font size=3>Hello</font>
<font size=4>Hello</font>
etc...
The only difference in those lines is the value of the size... and if you look the loop above, you have a variable, 'i', that each time through the loop is 1 larger than the last time. That's exactly what you want to do with the value of 'size'. And you mentioned you know how to output a variable. So you have all the pieces to the puzzle:
1) you need to have a number in some output increase by 1 each time
2) you have a variable that increases by 1 each time
3) you know how to output that variable
4) I showed you in my first post how to combine a variable with other "hard coded" output
Give it some thought and
you should see how the pieces go together. I (or someone else) could just give you the answer; but that's not our way here at JavaRanch because we know people learn better and retain the information when they figure things out.
Let us know how you do. If you still have trouble, let us know what you have tried and we can help further.