Font size
  • A-
  • A
  • A+
Site color
  • R
  • A
  • A
  • A
Skip to main content
If you continue browsing this website, you agree to our policies:
  • Data Privacy Consent Form
Continue
x
PSHS-MC KHub
  • Home
  • Course search
  • More
You are currently using guest access
Log in
PSHS-MC KHub
Home Course search
Expand all Collapse all

Q1 1st Non-Graded Exercise: Variable Declaration

  1. Home
  2. Courses
  3. G9 Courses
  4. SY25.CS3
  5. JS Basics
  6. Q1 1st Non-Graded Exercise: Variable Declaration
Completion requirements
View
Make a submission
Receive a grade
Due: Friday, 8 August 2025, 9:00 PM

It is your time to apply what you have learned.

  1. Using VSCode, create a file inside the public folder of your your 1stQtrPortfolio and name it as Q11stNGSectionLastname.html.
  2. Develop a JavaScript code inside the script tag that will measure how much your favorite snack is for a lifetime supply. 
    • Declare a variable to store your present age (age). 
    • Declare a variable to store a maximum age (maxAge). 
    • Declare a variable that stores an estimated daily amount (numPerDay) consumed of your favorite snack. 
    • Calculate the average amount you will consume for the rest of your life. totalRequired = (numPerDay * 365) * (maxAge - age) 
    • The result should be shown on the screen as follows: "You will need NN to last you until the ripe old age of X".
  3. Save your work.
  4. Update the index.html inside your 1stQtrPortfolio and add a link to this first non-graded exercise. Example: 
    • <li><a href="./public/Q11stNGSectionLastname.html"> Q1 1st Non-Graded</a> 
    • </li> 
  5. Save the changes.
  6. Test your work by opening index.html using mouse right-click and choose live server.
  7. Commit (save) with your message to your Github repository.
  8. Submit the link to the Github live website to this assignment repository.  
Sample Output below:


Reminder: Your work should be your own, if you used an AI to do this exercise or had referred to resource online or even offline please do a proper citation as part of your web page (client facing)

See Guide on how to do: APA Citation: https://libguides.csudh.edu/citation/apa-7
Citing the use of an AI App/Resource: (OpenAI, personal communication, January 16, 2023).


Previous activity Q1 Quiz # 2 on JS Operations
Next activity Video Lectures on Introduction to JavaScript

Contact us

Follow us

You are currently using guest access (Log in)
Data retention summary
Policies
Powered by Moodle

This theme was developed by

Conecti.me
Moodle Appliance - Powered by TurnKey Linux