CSCE 102 Exam 1 Questions and
Answers Rated A+
What is the main purpose of a variable in programming?
To store data that can be used and manipulated within a program.
What is the function of an HTML tag?
To define the structure and content of a web page.
How do you create a comment ...
CSCE 102 Exam 1 Questions and
Answers Rated A+
What is the main purpose of a variable in programming?
✔✔ To store data that can be used and manipulated within a program.
What is the function of an HTML tag?
✔✔ To define the structure and content of a web page.
How do you create a comment in HTML code?
✔✔ Use `<!--` to open and `-->` to close the comment.
What is the purpose of using CSS in web development?
✔✔ To style and layout HTML elements on a web page.
How is a function defined in JavaScript?
✔✔ Using the `function` keyword followed by the function name and parentheses.
1
,What does the `<head>` element in an HTML document contain?
✔✔ Metadata, links to CSS files, and scripts that are not displayed on the web page.
How do you create a hyperlink in HTML?
✔✔ Using the `<a>` tag with the `href` attribute to specify the URL.
What is the difference between an ID and a class in CSS?
✔✔ An ID is unique to a single element, while a class can be used for multiple elements.
How do you declare a variable in JavaScript?
✔✔ Using `let`, `var`, or `const` followed by the variable name.
What does the `<title>` tag do in an HTML document?
✔✔ It sets the title of the web page, which is displayed in the browser tab.
What is the purpose of the `console.log()` function in JavaScript?
✔✔ To print output to the browser’s console for debugging purposes.
2
, How do you insert an image in an HTML document?
✔✔ Using the `<img>` tag with the `src` attribute to specify the image file path.
What is a loop in programming?
✔✔ A structure that repeats a block of code multiple times based on a condition.
How do you apply an external CSS stylesheet to an HTML document?
✔✔ By using the `<link>` tag inside the `<head>` section, with the `href` attribute pointing to
the CSS file.
What is the purpose of a `for` loop in JavaScript?
✔✔ To execute a block of code a specific number of times.
How do you write a basic `if` statement in JavaScript?
✔✔ Using the `if` keyword followed by a condition in parentheses and a block of code in curly
braces.
What does the `alt` attribute do in an `<img>` tag?
3
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller ExcellentScores. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $10.49. You're not tied to anything after your purchase.