Docsity

WGU C779 Web Development Foundations Practice Questions, Exams of Nursing

Toggle sidebar
bg1
WGU C779 Web Development Foundations
Practice Questions
Module 1: HTML Foundations
1. Which HTML tag defines the root element of an HTML document?
o A) <head>
o B) <html>
o C) <body>
o D) <main>
o Answer: B) <html>
o Rationale: The <html> tag is the container for all other HTML elements, except for
the <!DOCTYPE> declaration. The <head> contains metadata, the <body> contains the
visible content, and <main> denotes the primary content of the document.
2. What is the correct doctype declaration for an HTML5 document?
o A) <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
o B) <!DOCTYPE html>
o C) <!DOCTYPE HTML5>
o D) <!DOCTYPE HTML PUBLIC "HTML5">
o Answer: B) <!DOCTYPE html>
o Rationale: The <!DOCTYPE html> declaration is the standard, case-insensitive doctype
for HTML5. It tells the browser to render the page in standards mode.
3. Which tag is used to create an ordered (numbered) list?
o A) <ul>
o B) <ol>
o C) <li>
o D) <dl>
o Answer: B) <ol>
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f

Partial preview of the text

Download WGU C779 Web Development Foundations Practice Questions and more Exams Nursing in PDF only on Docsity!

WGU C779 Web Development Foundations

Practice Questions

Module 1: HTML Foundations

1. Which HTML tag defines the root element of an HTML document?

o A)

o B)

o C)

o D)

o Answer: B)

o Rationale: The tag is the container for all other HTML elements, except for the declaration. The contains metadata, the contains the visible content, and denotes the primary content of the document.

2. What is the correct doctype declaration for an HTML5 document?

o A)

o B)

o C)

o D)

o Answer: B)

o Rationale: The declaration is the standard, case-insensitive doctype for HTML5. It tells the browser to render the page in standards mode.

3. Which tag is used to create an ordered (numbered) list?

o A)

o B)

o C)

o D)

o Answer: B)

o Rationale: stands for "ordered list" and creates a numbered list. creates an unordered (bulleted) list, defines a list item, and creates a description list.

4. Which attribute makes an field mandatory before form submission?

o A) required="true"

o B) required

o C) mandatory

o D) validate

o Answer: B) required

o Rationale: The required is a boolean attribute in HTML5. When present, it specifies that an input field must be filled out before the user can submit the form.

5. What is the correct way to write a comment in HTML?

o A) // comment

o B) /* comment */

o C)

o D) # comment

o Answer: C)

o Rationale: HTML comments are written using the tags. Anything between them is ignored by the browser. The other syntaxes are for JavaScript, CSS, or other languages.

6. Which semantic HTML5 tag is used to define navigation links?

o A)

o B)

o C)

o D)

o Answer: B)

o Rationale: is a semantic element introduced in HTML5 to define a block of navigation links, such as menus or tables of contents, helping with both accessibility and SEO.

7. Which character encoding is the preferred choice for modern HTML documents?

o A) ASCII

o B) ISO-8859-

o Rationale: The (preformatted text) tag displays text in a fixed-width font and preserves both spaces and line breaks, making it ideal for displaying code blocks or ASCII art.

Module 2: Cascading Style Sheets (CSS) & Visual Design

11. Which CSS property is used to change the text color of an element?

o A) text-color

o B) font-color

o C) color

o D) background-color

o Answer: C) color

o Rationale: The color property sets the foreground text color of an element. background- color sets the element's background color.

12. Which CSS selector correctly targets an element with the id="main"?

o A) .main

o B) #main

o C) main

o D) *main

o Answer: B) #main

o Rationale: In CSS, the hash symbol (#) is used to select an element by its id attribute. The period (.) is used for class selectors.

13. Which value of the CSS opacity property represents a completely opaque element?

o A) 0.

o B) 0.

o C) 1.

o D) 1.

o Answer: C) 1.

o Rationale: The opacity property ranges from 0.0 (completely transparent) to 1.0 (completely opaque).

14. Which CSS directive is used to override normal cascading rules and ensure a style is applied?

o A) !override

o B) !important

o C) priority: high

o D) !primary

o Answer: B) !important

o Rationale: The !important rule provides a way to make a CSS declaration take precedence over normal cascading rules. It should be used sparingly, as it can make debugging stylesheets difficult.

15. Which two methods can be used to apply CSS to an HTML document? (Select two.)

o A) Embedding an internal stylesheet within the HTML document.

o B) Linking the HTML page to an external .css file.

o C) Using a o A) title

o B) alt

o C) src

o D) longdesc

o Answer: B) alt

o Rationale: The alt attribute provides a text alternative for an image. Screen readers read this text aloud to describe the image to visually impaired users.

22. Which organization developed the Web Content Accessibility Guidelines (WCAG)?

o A) ISO

o B) W3C

o C) IEEE

o D) ECMA

o Answer: B) W3C

o Rationale: The Web Content Accessibility Guidelines (WCAG) are developed by the World Wide Web Consortium (W3C) through its Web Accessibility Initiative (WAI).

23. What is the primary ethical requirement for using a copyrighted image found on the internet for a commercial website?

o A) It is free to use as long as you link back to the source.

o B) You can use it if you modify the image's colors.

o C) You must obtain permission or a license from the copyright owner.

o D) It is free to use for any purpose.

o Answer: C) You must obtain permission or a license from the copyright owner.

o Rationale: Copyright law grants exclusive rights to the creator of an original work. Using a copyrighted image without permission or a license is copyright infringement.

24. Which of the following would most likely be considered a trademark?

o A) The code for a website's login function.

o B) A company's logo and brand name.

o C) An original blog post.

o D) A photograph taken by an employee.

o Answer: B) A company's logo and brand name.

o Rationale: A trademark protects brand identifiers like names, logos, and slogans. Copyright protects original works of authorship, such as literary, dramatic, musical, and artistic works.

25. What does the American with Disabilities Act (ADA) require for web content?

o A) All websites must have a mobile version.

o B) All content must be available in at least two languages.

o C) Websites must provide text-based alternatives for non-text content.

o D) Websites cannot use JavaScript or cookies.

o Answer: C) Websites must provide text-based alternatives for non-text content.

o Rationale: The ADA's requirements for web accessibility include providing text alternatives for non-text content, such as images and multimedia, to make it accessible to people with disabilities.

26. Which action best accommodates web users with visual impairments?

o A) Using many different colors on the page.

o B) Ensuring that all pages can be rendered by audio screen readers.

o C) Providing a high-bandwidth version of the site.

o D) Using only bitmap images for all graphics.

o Answer: B) Ensuring that all pages can be rendered by audio screen readers.

o Rationale: Ensuring compatibility with screen readers is a primary method of accommodating users with visual impairments, as these programs convert on-screen text into speech or Braille.

27. Providing a hyperlink from your website to another site without permission is generally considered:

o A) Illegal and a violation of copyright law.

o B) Ethical, as long as you don't profit from it.

o C) Unethical but not illegal.

o D) Standard practice and widely accepted.

o Answer: D) Standard practice and widely accepted.

o Rationale: Hyperlinking is a fundamental part of the web's structure. Providing a link to another site does not generally require permission and is not considered a violation of ethics or law, as it simply directs users to a publicly available resource.

o C) Referencing

o D) Stacking

o Answer: A) Nesting

o Rationale: Nesting is the practice of placing one HTML element inside another. Proper nesting is essential for valid HTML and correct styling.

32. Which two HTML tags are containers for other tags (i.e., they contain most of the document's content or metadata)? (Select two.)

o A)

o B)

o C)

o D)

o Answer: A & B

o Rationale: The element is a container for metadata (data about the document), and the element is a container for all the visible content of a web page, such as text, images, and links.

33. Which of the following is an essential characteristic of a test server for web development?

o A) It is the main live server that customers use.

o B) It must be located in a different country than the live server.

o C) It must have the same configuration as the "live" or production server.

o D) It must be hosted on the developer's local computer only.

o Answer: C) It must have the same configuration as the "live" or production server.

o Rationale: A test server should mirror the live server's configuration (hardware, software, OS) as closely as possible to ensure that features that work in testing will also work after deployment.

34. Which two form elements should typically use the same name attribute for groups of related elements? (Select two.)

o A) Text fields

o B) Radio buttons

o C) Checkboxes

o D) Submit buttons

o Answer: B & C

o **Rationale:** For radio buttons, using the same name groups them together, allowing only one to be selected. For checkboxes, using the same name allows multiple selections and groups them as an array on the server side.

35. Which HTTP request method should be used for a form that appends parameters to a query string (e.g., in a search form)?

o A) POST

o B) GET

o C) PUT

o D) DELETE

o Answer: B) GET

o Rationale: The GET method appends form data to the URL as part of the query string. It is suitable for non-secure, idempotent requests like searches.

36. Which method type should be used to securely send sensitive form data (like a password) that requires processing by a server-side script?

o A) GET

o B) POST

o C) PUT

o D) HEAD

o Answer: B) POST

o Rationale: The POST method sends form data in the body of the HTTP request, not in the URL. This makes it more secure for sensitive information and is required for data that will change the server's state (e.g., updating a database).

37. Which of the following HTML code examples will create a functional, formatted hyperlink?

o A) WGU

o B) WGU

o C) WGU

o D)

o Answer: A) WGU

o Rationale: The correct syntax for a hyperlink uses the (anchor) tag with the href attribute to define the link destination. The content between the opening and closing tags is the clickable text.

38. Which HTML5 element is used to draw graphics on a web page, typically with JavaScript?

o D) To secure the connection between a browser and a server.

o Answer: B) To structure the content of a webpage.

o Rationale: HTML (HyperText Markup Language) is used to structure the content of a webpage. Browsers decode HTML to render the page's headings, paragraphs, lists, links, and other elements.

42. What is the main role of the World Wide Web Consortium (W3C)?

o A) To regulate and censor content on the web.

o B) To develop web standards and guidelines.

o C) To sell domain names and web hosting services.

o D) To create web browsers like Chrome and Firefox.

o Answer: B) To develop web standards and guidelines.

o Rationale: The W3C is the main international standards organization for the World Wide Web. It develops protocols and guidelines to ensure the long-term growth of the web.

43. What does the acronym XML stand for?

o A) eXtended Media Language

o B) eXtensible Markup Language

o C) eXtra Modern Language

o D) eXperimental Meta Language

o Answer: B) eXtensible Markup Language

o Rationale: XML is a markup language designed to store and transport data. It is both human- and machine-readable. Unlike HTML, which has predefined tags, XML allows users to define their own tags.

44. Which statement accurately describes a key difference between HTML and XML?

o A) HTML is case-sensitive, while XML is not.

o B) HTML is a data storage language, while XML is a display language.

o C) HTML can tolerate simple syntax mistakes, while XML does not.

o D) HTML and XML files use the same file extensions.

o Answer: C) HTML can tolerate simple syntax mistakes, while XML does not.

o Rationale: Browsers often attempt to "fix" or render poorly formatted HTML. In contrast, XML parsers are strict and will stop processing and throw an error if the document is not well-formed (e.g., missing a closing tag).

45. What is the function of a MIME type?

o A) To compress files for faster download.

o B) To encrypt data sent between a client and a server.

o C) To map file name extensions to corresponding applications.

o D) To define the structure and syntax of an XML document.

o Answer: C) To map file name extensions to corresponding applications.

o Rationale: MIME (Multipurpose Internet Mail Extensions) types tell a browser or operating system how to handle a file. For example, the text/css MIME type tells the browser to treat a .css file as a stylesheet.

46. What is a Document Type Definition (DTD)?

o A) A file that defines the structure of an XML or HTML document.

o B) The main content section of a webpage.

o C) A type of CSS rule for styling fonts.

o D) A JavaScript framework for building user interfaces.

o Answer: A) A file that defines the structure of an XML or HTML document.

o Rationale: A DTD (Document Type Definition) is a set of rules that defines the legal building blocks of an XML or HTML document. It dictates the tags, attributes, and their nesting structure.

47. What does an HTTP 404 error signify?

o A) The server is temporarily overloaded.

o B) The requested file does not exist on the server.

o C) The server requires authentication credentials.

o D) The request was successful.

o Answer: B) The requested file does not exist on the server.

o Rationale: An HTTP 404 Not Found status code indicates that the client was able to communicate with the server, but the server could not find the requested resource (e.g., a page or image).

48. When a user enters a domain name (e.g., www.wgu.edu) into a browser, what is the first main step that occurs before the web page is loaded?

o A) The browser sends the HTTP request.

o B) The browser renders the HTML content.

o Answer: C) JPEG

o Rationale: JPEG (Joint Photographic Experts Group) uses lossy compression to reduce file size, making it ideal for complex images like photographs where minor detail loss is acceptable.

52. Which image file format supports animation and transparency, and is often used for simpler line drawings?

o A) GIF

o B) JPEG

o C) PNG

o D) WebP

o Answer: A) GIF

o Rationale: GIF (Graphics Interchange Format) is an 8-bit format that supports simple animations and single-color transparency. It is best suited for graphics with solid colors, like logos or diagrams, rather than photographs.

53. Which Web-ready image file formats support animation? (Select two.)

o A) JPEG

o B) GIF 89a

o C) PNG

o D) BMP

o Answer: B & C

o Rationale: The GIF 89a format has supported simple looping animations for decades. PNG (Portable Network Graphics) also has an animation format (APNG) that is widely supported and offers higher quality than animated GIFs.

54. Which file format supports image layers, allowing you to manipulate components of an image independently of the whole?

o A) JPEG

o B) GIF

o C) PNG

o D) TIFF

o Answer: C) PNG

o Rationale: The PNG format natively supports multiple layers and transparency, which is crucial for professional image editing work. Other formats like JPEG and GIF flatten all layers into a single image.

55. What occurs when a user with a slow Internet connection attempts to download a non- interlaced image?

o A) The image will load in a series of low-resolution passes.

o B) The browser will cancel the download to save bandwidth.

o C) The image will remain invisible until it has completely downloaded.

o D) The browser will display a placeholder icon.

o Answer: C) The image will remain invisible until it has completely downloaded.

o Rationale: Non-interlaced images load one line of pixels at a time from top to bottom. On slow connections, the user will see a blank space where the image will be, or a partial image that loads slowly, but the full image doesn't appear until the download is complete. Interlacing (or progressive rendering) allows a low-quality version to appear quickly.

56. Which protocol and language pair is used to add authentication and encryption to secure online transactions?

o A) FTP and SSH

o B) SSL/TLS and HTTPS

o C) SMTP and POP

o D) TCP and IP

o Answer: B) SSL/TLS and HTTPS

o Rationale: SSL (Secure Sockets Layer) and its successor TLS (Transport Layer Security) are cryptographic protocols that provide secure communication over a network. HTTPS (HTTP Secure) is the use of HTTP over SSL/TLS to encrypt data sent between a web browser and a server, securing online transactions.

57. Which of the following is an XML-based protocol used by credit card companies to add security to online credit and debit card transactions?

o A) 3-D Secure

o B) Secure Shell (SSH)

o C) Pretty Good Privacy (PGP)

o D) Internet Protocol Security (IPsec)

o Answer: A) 3-D Secure

Module 7: Programming & Scripting Basics (JavaScript)

61. Which of the following is a client-side scripting language that provides dynamic, interactive capabilities to webpages?

o A) PHP

o B) Java

o C) JavaScript

o D) Ruby

o Answer: C) JavaScript

o Rationale: JavaScript is a lightweight, interpreted programming language that runs in the web browser (client-side). It is used to add interactivity, manipulate the DOM, handle events, and create dynamic web content.

62. Which symbol is used for a single-line comment in JavaScript?

o A)

o B) /* comment */

o C) // comment

o D) # comment

o Answer: C) // comment

o Rationale: In JavaScript, // denotes a single-line comment. Everything from the // to the end of the line is ignored by the JavaScript engine.

63. What is an event handler in programming?

o A) A block of code that defines a new data type.

o B) A function that runs when a specific event occurs (e.g., a mouse click).

o C) A variable that stores the state of a program.

o D) A method for optimizing code for faster execution.

o Answer: B) A function that runs when a specific event occurs (e.g., a mouse click).

o Rationale: Event handlers are blocks of code (functions) that are triggered by specific user or system events, such as clicking a button, moving the mouse, or the page finishing loading. They are fundamental to creating interactive web pages.

64. What is an array in programming?

o A) A single variable that can store multiple values.

o B) A type of loop that repeats code a fixed number of times.

o C) A function that returns a value.

o D) A condition that evaluates to true or false.

o Answer: A) A single variable that can store multiple values.

o Rationale: An array is a data structure that holds an ordered list of elements, which can be of any data type. It allows you to store and access a collection of items using a single variable name and an index number.

65. Which programming statement executes a process only when a particular condition is true?

o A) for loop

o B) if / then statement

o C) while loop

o D) function declaration

o Answer: B) if / then statement

o Rationale: The if statement is a fundamental conditional statement. It executes a block of code if a specified condition evaluates to true. An optional else clause can run code if the condition is false.

66. Can JavaScript be used on both the client-side and the server-side?

o A) No, only on the client-side in a web browser.

o B) Yes, with the help of server-side runtimes like Node.js.

o C) No, only on the server-side for database queries.

o D) Yes, but only for styling and layout.

o Answer: B) Yes, with the help of server-side runtimes like Node.js.

o Rationale: Traditionally a client-side language, JavaScript can now be run on the server- side using runtimes like Node.js. This allows developers to use a single language for both front-end and back-end development.

67. Which programming term describes a placeholder in memory used to store information for later use in a program?

o A) Constant

o B) Variable

o C) Function

o D) Object

o Answer: B) Variable