Question: #8364

CIS213 U1 Programming Assignment Complete Solution

Unit 1 Programming Assignment

Follow the directions for each of the following questions. Answer the question or provide the code in a space below the question.  

1. Write the complete script tag set for a script whose line statement is

document.write(“Hello, world.”);

2. Build a complete HTML document and include the answer to the previous question such that the page executes the script as the page loads.  Open the document in your browser to test the results.

3. Add a comment to the script in the previous answer that explains what the script does.

4. Create an HTML document that displays an alert dialog box immediately after the page loads and displays a different alert dialog box when the user clicks a form button.

5. Carefully study the document in Figure 1 on this page.  Without entering and loading the document, predict

a. What the page looks like

b. How users interact with the page

c. What the script does.

Then type information as shown in Figure 1 (observe capitalization and punctuation).  Do not type a carriage return after the “=” sign in the upperMe function statement; let the line word-wrap as it does in the following listing.  It’s ok to use carriage return between attribute name/value pairs, as shown in the first <input> tag.  Save the document as an HTML file and load the file into your browser to see how well you did.

6. Which of the following are valid variable declarations or initializations?  Explain why each one is or is not valid.  If an item is invalid, how do you fix it so that it is valid?

a. My_name = “Cindy”;

b. Var how many = 25;

c. Var zipcode = document.getElementById(“zip”).value

d. Var 1address = document.(“address1”).value

Figure 1

 

<html>

<head>

<title>Text Object Value</title>

<script type=”text/javascript”>

// <!

function upperMe() {

document.getElementById(“output”).value = document.getElementByid(“input”).value.toUpperCase();

}

//  -->

<body>

Enter lowercase letters for conversion to uppercase:<br>

<form name=”converter”>

                <input type=”text” name=”input” id=”input” value=”sample” onchange=”upperMe()” /><br />

                <input type=”text” name=”output” id=”output” value=”” />

</form>

</body>

</html>

 

Please name your file Lastname_U1_Programming.doc and submit it according to the directions below.

Upload Instructions:

Select the Add Submission button below. Click Add, located in the top left hand corner of the File Submission box. The File Picker window will appear. Click Upload a file and then select the Browse button. Navigate to your file location. Once the file is located, select it and then select the Open button, the Upload this file button, and then the Save changes button. Click Submit Assignment to complete the upload process. Select Send for marking.

© ECPI, 2013

Solution: #8366

CIS213 U1 Programming Assignment Complete Solution

2. Build a complete HTML document and include th...
Tutormaster
Rating: A+ Purchased: 11 x Posted By: Vikas
Comments
Posted by: Vikas

Online Users