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 3rd Graded Exercise (Guessing Game) on JS IO Statements:

  1. Home
  2. Courses
  3. G9 Courses
  4. SY25.CS3
  5. JS Statements
  6. Q1 3rd Graded Exercise (Guessing Game) on JS IO Statements:
Completion requirements
View
Make a submission
Receive a grade
Due: Friday, 22 August 2025, 5:00 PM
 

Instructions

  1. This simple exercise is to practice the use of basic input and output statements of JS and also the if statement.
  2. In your portfolio, create a file inside the public folder and name it as Q13GSectionLastName.html
  3. Copy the code template given below. 
  4. Include the necessary HTML tags to display the input screen as shown in the sample initial screen.
  5. Inside the checkIt() function, the JS code:
    1. should be able to read the information typed by the user.
    2. compare it against the variable dNumber containing a random number from 1 to 100.
    3. display a result of either Higher, Lower or You are correct!
  6. Change the content of header2 <h2></h2> to contain your name and section.
    • Example:  
      • <h2> Q1 3rd Graded Exercise submitted by Pablo Nase of 9Carbon </h2>
  7. Save your work.
  8. Edit the index.html of your portfolio and add a link to this exercise.  As shown below:
    • <li><a href="./public/Q13GSectionLastName.html"> Third Graded Exercise </a> 
    • </li>
  1. Save your changes, test by opening index.html with live server.  You should be seeing a link to your third graded exercise and when you click on it an output similar to the one shown below should be seen.
  2. Commit (save) your work in your Github account to update the online version of your portfolio.
  3. Submit the link to the live Github live website of your portfolio and also link to your code in github.
  4. Reminder: Your work should be your own, incorporate a citation to all resources used in this exercise should be inside a footer tag.  Since this is a graded exercise, the use of AI is NOT permitted.

    See Guide on how to do: APA Citation: https://libguides.csudh.edu/citation/apa-7

Sample Output

Initial State:

When User Entered a Number and the button is clicked (It will display Higher / Lower or You are correct)

 

Code Template



<!DOCTYPE html>
<html>
<body>    <h2> Q1 3rd Graded Exercise submitted by name of section</h2>
   <!-- Enter your HTML tags below  but before the opening script tag -->     <script>        var dNumber = Math.floor(Math.random() * 100) + 1; // generates a number from 1  to 100 when the page loads         function checkIt() {
              
            
         
        }
    </script> </body> </html>

Rubrics for Grading

1.  The HTML/JS Code meeting the requirements (7pts) - (HTML tags 2pts, JS Code to read, process and display the result 5pts)

2.  The file is inside the public folder of the 1st Qtr portfolio made in the 1st Graded Exercise with updated index.html with updated name on the header 2 tag. (3pts)

 

Previous activity Q1 2nd Graded Exercise (Tip) on I/O Statements and Number Objects
Next activity Video Lectures: Input and Output functions

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