Module: 3 Testing code and images

Jan 31, 2026

Testing Code

Variables:

1. price1: This variable is assigned the numeric value 5.

2. price2: This variable is assigned the numeric value 6

3. total: This variable stores the result of adding price1 and price2, which is 11

The code defines two numeric variables, calculates their sum, and then updates the content of a specific HTML paragraph element to display the result. This interaction between JavaScript and HTML allows dynamic content updates on a webpage.

Testing Photos and Images:

When you’re trying to figure out which image format to use, PNG, GIF, or JPG, there are a few things to keep in mind, like quality, loading speed, and whether you need transparency. PNG are great if you need high-quality images with transparencies, like for logos or detailed graphics. But heads up: they can be a bit hefty in file size, which might slow down your website. GIFs, on the other hand, are your go-to for simple graphics and animations. They do have a limited color palette, which can make the quality a bit iffy, but they get the job done for basic needs. Think of those fun little animated memes you see everywhere. Now, if you’re dealing with photographs, JPGs are probably your best bet. They load more quickly because they balance file size and quality. which is often more important than having every pixel perfect. Each of these formats has its own perks and quirks, so it really depends on what you’re aiming for. Understanding these differences can help you pick the right one for your project. Personally, I’ve found that mixing and matching based on a project’s specific needs often yields the best results.

Module 4 Assignment

Feb 7,2026

JavaScript discussion

Making the if statements initially appeared to be simple. It was easy to set up the conditions, but it was difficult to determine the day using “getDay().” However, it was challenging to think of fresh and engaging things to say each day. I needed to make sure every message was distinct. Mondays, for example, may require some encouragement, such as “Hey, it’s Monday! Let’s begin this week. “Friday!” On the other hand, it might indicate that Fridays are happier. The weekend is almost here. Finding the ideal tone was more difficult than I had anticipated.

Here’s the corrected version of the provided code:

html<!DOCTYPE html>

<html>

<body>

<p id=”demo”>Display the result here.</p>

<script>

var greeting;

var hour = new Date().getHours();

if (hour < 18) {

    greeting = “Good day”;

} else {

    greeting = “Good evening”;

}

document.getElementById(“demo”).innerHTML = greeting;

</script>

</body>

</html>

Fixes Made:

I added a closing curly brace `}` after the first `if` statement to properly close the block. I also added an `else` statement correctly to ensure the code runs without errors.

Photoshop

The experience of using Photoshop proved to be very fruitful. I discovered that I needed to learn how to adjust the quality settings, resize photos, and save them in the appropriate format (in this case, JPEG). The USF tutorials were really beneficial, particularly the sections on web image optimization. The interface initially felt a little daunting, almost like entering a different universe. However, I became more comfortable using the tools as I followed the tutorials.

Leave a comment