Question: Hello, please give the code in JAVASCRIPT with a page in HTML to display it too. Thank you. ASSIGNMENT: Assignment (H.M.S. Stringsarefore): Admiral Captain Corcoran

Hello, please give the code in JAVASCRIPT with a page in HTML to display it too. Thank you.

ASSIGNMENT:

Assignment (H.M.S. Stringsarefore): Admiral Captain Corcoran has been given a fleet of a dozen new pirate chasing ships which the queen her majesty wishes to name after her significant other (spouse / pet / other), but she cannot give every ship the same name. Create a program which accepts the name of her significant other and uses that name to derive different 12 ship names through JavaScript string operations. (use charAt, indexOf, substring, trim, replace, toUpperCase, toLowerCase) Store the names into an array and write them to the page as a list. Make sure the names put fear into the heart of every pirate!

information:

Perhaps the most frequently used String attribute is the Length property. As with all object properties, you can access the length property through dot name nomenclature; the object name followed by a dot followed by the name of the property. (strName.length) This all works because JavaScript string objects are shipped from the factory knowing how to report their length. If you need to know how long a string is, you can find out with the following code:

There's even more fun to be had with String methods. While not providing as rich a string method tool kit as some object oriented language, JavaScript still presents the programmer with a useful set of built in utilities. As we look at some of these utilities, keep in mind that in JavaScript, ALL method calls on strings return a NEW string, leaving the original string untouched. Finally, let's remember from our objects lesson that all methods are preceded by a dot and followed by the symbols () as such: strName.method();

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!