Review of HTML, CSS, and JavaScript :Programming Foundations with JavaScript, HTML and CSS (Java Programming and Software Engineering Fundamentals Specialization) Answers 2025
1. Question 1
✔️ To style the web page
❌ To put images on the web page
❌ To layout the web page
❌ To make the web page interactive
2. Question 2 — Select all correct
✔️ A for loop inside a for loop
✔️ A list of lists
✔️ A list inside a table
❌ A table
❌ An image
3. Question 3 — Select all errors
✔️ The <title> tag should be inside the <head> tag.
✔️ The unordered list should be inside the <li> (New York).
✔️ There should be a dot before oddNums in CSS (class selector).
✔️ The HTML is missing <html> tags.
❌ background-color incorrect → (It is correct)
❌ semicolons should not be there → (They should be there)
❌ <img> missing width → (Width is optional)
4. Question 4
✔️ The if inside the else only applies to pixels not in the first if → so only upper-right becomes green, and left side becomes blue.
(Correct choice is the second statement.)
❌ First option
❌ Third option
5. Question 5 — Select all errors
✔️ The call to makeDarker does not pass an image as an argument.
✔️ The function is missing a return statement.
❌ Missing var for img (not required)
❌ Missing function keyword (incorrect)
❌ Function makes image gray (incorrect — it subtracts equally but does NOT set same values)
6. Question 6
✔️ Work small examples → write steps → find patterns → code → test and debug.
(This is the second option.)
❌ First option
❌ Third option
7. Question 7 — Select all global variables
✔️ grayimage
✔️ image
❌ avg
❌ ff
❌ theImage
❌ pix
(Only variables declared outside functions are global.)
8. Question 8
✔️ onchange
❌ onmouseover
❌ oninput
❌ onclick
9. Question 9
✔️ Add:
greenImage.drawTo(canvas);
This displays the processed image.
10. Question 10
✔️ The onclick event handler calls a function that applies the filter to the image, then the filtered image is drawn on the canvas.
❌ All other options are incorrect order.
📌 Summary Table
| Q | Correct Answer(s) |
|---|---|
| 1 | To style the web page |
| 2 | For loop in for loop, list of lists, list inside table |
| 3 | Title inside head, UL inside LI, dot before class, missing html tags |
| 4 | Only px not in first if get green → wrong quadrant |
| 5 | Missing argument in call, missing return |
| 6 | Work examples → pattern → code → test |
| 7 | grayimage, image |
| 8 | onchange |
| 9 | greenImage.drawTo(canvas); |
| 10 | onclick applies filter → then draw |