Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A partial code of HTML and CSS is given as follow: Part a (5 marks) Show how prototype enables you to extend an existing String

image text in transcribed

A partial code of HTML and CSS is given as follow:

image text in transcribed

Part a (5 marks) Show how prototype enables you to extend an existing String class by writing a JavaScript method that will perform the following tasks: Use a method named "divideby235" The method takes in one argument The argument is an English word The method needs to check whether the English word is in the string If the English word is in the string, the method will count the number of characters in the English word and return: "This word can be divided by 2" if the number of characters of the word is divisible by 2 "This word can be divided by 3" if the number of characters of the word is divisible by 3 o "This word can be divided by 5" if the number of characters of the word is divisible by 5 o "This word cannot be divided by 2, 3 or 5" if the number of characters of the word is NOT divisible by 2, 3 or 5 If the English word is NOT in the string, the method will return "This word is NOT in the string" In addition, show how you make use of your new method by using innerHTML. Part b (5 marks) Create the following HTML page with the appropriate CSS. A partial code is given, and you are to complete the following code. (Note: Only HTML and CSS should be used) You are to follow the specifications given: - Table needs to be used to contain the sketch The turtle sketch has a hidden bigger turtle sketch that once you hover on it, the bigger turtle sketch will display and cover the original turtle sketch Set the size of the turtle sketch to 100px (same width and height) Set the size of the bigger sketch of turtle to 200px (same width and height) Figure and figcaption need to be used for the turtle Sketch of turtle is given as an image file "turtle.png" If the image file of turtle cannot be found, the text "turtle" should be displayed Ordered list needs to be used for the description of turtles and gold fishes Pet shop Pet Turtle Small turtle 1. Turtles should have land and water 2. Turtles can take calcium and vitamins 3. Gold fishes are common to keep as pet fish

Pet shop

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

More Books

Students also viewed these Databases questions