Aha, so that's what an assignment looks like.
Well with the greatest respect to your lecturer, it's abit out of date in the direction it steers you. In particular, these days nobody should be encouraged to use
document.write(); , which is one of the greatest evils ever include in Javascript. I used it for many years before I saw the light.
Personally, I would regard much of the assigment as advice.
Symantically, only the first two sensences are instructions. The rest have main verbs "should" and "can" and may therefore be regarded as advisory not mandatory. In English, mandation is expressed by use of the imperitive tense (as in sentences 1 and 2), or main verbs "must" or "shall".
That said, I don't think there's anything in my code which departs from the assigment - even including the advisory stuff. Here's my statement of compliance (it's a useful exercise) :
- Write an script that outputs xhtml to display the following patterns separately
Compliant
- one below the other.
Compliant
- Use for statements to generate the patterns.
Compliant
- All asterisks (*) should be printed by a single statement of the form document.write ( '*' ); which causes the asterisks to print side by side.
(Advisory) Compliant
- A statement of the form document.write("<br />"); can be used to move to the next line.
(Advisory) Compliant
- A statement of the form document.write( " " ); can be used to display a space for the last two patterns.
(Advisory) Compliant
- There should be no other output programs in the program.
(Advisory) Compliant
- [Hint: The last two patterns require that each line begin with an appropriate number of blank spaces. you may need to use the xhtml <pre></pre> tags.]
(Advisory) Compliant
For several years I wrote System Requirements Specifications in which every statement was very carefully measured to convey precisely the right level of meaning/mandation/advise. "Should" was generally avoided (unless specifically defined) because it can imply mandation when none was intended and
vice versa, leaving the respondant (you in this case) free to apply the most favourable interpretation - each statement individually. That gives you a lot of freedom to code the thing how you want.
So if they argue, tell them Airshow said so.
Airshow