Create a new webpage for each problem

Assignment Help JAVA Programming
Reference no: EM131565699

Review chapters [JS, 19-25] and [HTMLCSS, 13-18]. Make sure that you have done all the problems listed on the website at the end of each chapter.

Please create a new webpage for each problem. For inputs of arrays, have the user to enter a value into the prompt until the user has entered nothing. This way, the user can insert an unknown number of values into an array. The user will input the values via the prompt function. The script will display the output on the webpage by using the document.write function.
For these problems, do not use built-in functions unless specified otherwise.

A. Built-In String Functions
For all of your implementations, you are not allowed to use any built-in function unless specified otherwise. However, you are allowed to use string's length, string's charAt() function or simply the [ ] operator, and the concat() function or simply the + operator. To learn how to use strings properly is to not use arrays at all.
slice (1-loop)
Implement the built-in JavaScript string function, slice, by using string operations and loops. Your input shall be a string, the first index, and the second index. The output shall be the sliced string. Compare your implementation against the built-in function "string.slice(firstIndex, secondIndex)."
indexOf (2-loops)
Implement the built-in JavaScript string function, indexOf, by using string operations, string length, and two for-loops. Your first input will be a haystack string. Your second input will be a needle string. Your third input will be an offset index, in which the search will start from that index. The output shall be the index of the needle string appeared in the haystack string. However, if the needle string is not found in the haystack string, simply output a -1. There are three parts:
a) Implement indexOf by using just the slice built-in function. This implementation needs one loop.
b) Implement indexOf without the slice function or any other built-in function. This needs two-loops.
c) Compare both your implementations against the built-in function "haystack.indexOf(needle, offset)."

replace (1-or-2-loops)
There are two parts for this problem. You need three inputs: haystack string, needle string, and the new string. The output will be the replaced string that basically replaces all the needle strings appearing in the haystack string with the new string.
a) Using indexOf() and slice() function, output a new string so long as the index is non-negative that has had all the strings replaced. Because you need to treat every occurrence of the needle string in the haystack string, you will need to use a loop until indexOf has returned a negative value.
b) Without using any built-in function, output a new string that has all of your needle strings replaced with your new string. This will necessitate two-nested-loops.
c) Compare both your implementations against "haystack.replace(needle, newString)."

B. For-Loops (HTML)
HTML encodings
Prompt the user to enter a string. Output the text properly on the webpage by having some special characters displayed correctly on your browser. You may use the built-in function, replace. Apply the following rules:
• Replace "<" with "&lt;"
• Replace ">" with "&gt;"
• Replace "&" with "&amp;"
• If there are two or more spaces, replace it with a regular space followed by the correct number of hard spaces (&nbsp;). For example, " " (5-spaces) will be replaced with " &nbsp;&nbsp;&nbsp;&nbsp;" (one regular space plus four hard spaces)

Input Output
Hello, 9 < 10 + 1 > 10. You & me. Hello, 9 &lt; 10 + 1 &gt; 10. &nbsp;You &amp; me.

Bold, Underline, Italics (1-or-2-loops)
Output HTML styles from a string of text. In the old days, we use certain symbols in the text to bold, italicize, and underline certain words within the text. That is, a text that is surrounded by two "*" will be bolded. A text surrounded by two "/" will be italicized. And, a text surrounded by two "_" will be underlined. We will assume that no overlaps are allowed, i.e. *_this is allowed_* but *_this is not allowed*_.
Input: The *Quick _Brown Fox_* /Jumps Over/ the Lazy Dog.

HTML: <b>Quick <u>Brown Fox</u></b> <em>Jumps Over</em> the Lazy Dog.

You see: The Quick Brown Fox Jumps Over the Lazy Dog.

Reference no: EM131565699

Questions Cloud

Describe female serial killers motivations tend : When exploring demographics, we see that male serial killers are more common than female serial killers right? Do you believe that their motivations
How can a company measure the ethical leadership : re there any descriptors in the list that are difficult to observe? How can a company measure the ethical leadership within the organization?
Write a class sortedstringlist : String as a parameter and inserts it into the list at its proper position so the list always remains sorted alphabetically.
What additional questions may uncover the ethical culture : What additional questions may uncover ethical culture of organization? How could management measure ethical health of organization other than survey questions?
Create a new webpage for each problem : Create a new webpage for each problem. For inputs of arrays, have the user to enter a value into the prompt until the user has entered nothing.
Explain two legal implications of failing to report : Explain whether there is a statutory requirement to report these issues in your state or region. If not, explain your course of action.
Compare fred and rosemary west motivations : How can you compare Fred and Rosemary West motivations to that Jeffrey Dahmer
Rosemary west be classified as sexual predators : Can Fred and Rosemary West be classified as sexual predators why or why not
Developing a software package that requires users : Imagine you are developing a software package that requires users to enter their own password - bool that returns whether or not a StringBuilder object

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd