0% found this document useful (0 votes)
4 views

Lab2

The document outlines the requirements for Lab 2 of COMP 1073, which involves creating a Random Story Generator using HTML, CSS, and JavaScript. Key tasks include generating a random story, allowing for a custom name input, and converting imperial measurements to metric based on user selection. It also provides detailed instructions for submitting the project on GitHub, emphasizing the importance of regular updates and proper repository management.

Uploaded by

Joao Pedro
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Lab2

The document outlines the requirements for Lab 2 of COMP 1073, which involves creating a Random Story Generator using HTML, CSS, and JavaScript. Key tasks include generating a random story, allowing for a custom name input, and converting imperial measurements to metric based on user selection. It also provides detailed instructions for submitting the project on GitHub, emphasizing the importance of regular updates and proper repository management.

Uploaded by

Joao Pedro
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

COMP 1073 – Client-Side JavaScript

LAB 2
Random Story Generator

DESCRIPTION

Using the HTML, CSS and JavaScript code provided to you, modify the JavaScript so that
the page that does the following:

1. Generates a random story in a paragraph when the user pressed the button.
2. Replaces the default name "Bob" in the story with a custom name, but only if a
custom name is entered into the "Enter custom name" text field before the generate
button is pressed.
3. Converts the default imperial weight (pounds) and temperature (°F) values to kilograms
(kg) and centigrade (°C) if the “metric” radio button is checked before the generate
button is pressed.
4. Will generate another random silly story if you press the button again (and again...).

INSTRUCTIONS

Follow along with the numbered instructions inside the code comments in the
provided JavaScript file.

EVALUATION
Criteria Mark
The above tasks have been completed /10

This lab based on the excellent assessment challenge at https://developer.mozilla.org/en-


US/docs/Learn/JavaScript/First_steps/Silly_story_generator
Image credit: https://openclipart.org/detail/231988/child-with-book 1

GitHub Submission Instructions:

1. Create a folder inside GitHub repository named COMP1073-Lab2-YourName.


2. Submit the GitHub repository link on the Blackboard.

Submitting Your Project on GitHub

Follow these steps to submit your project files to GitHub. It’s crucial that you commit and push your
changes each time you make an update. Failure to follow these steps for each and every assignment
and lab will result in an immediate zero.

Step 1: Create a GitHub Repository

1. Log in to GitHub: Go to GitHub and log in to your account.


2. Create a New Repository:
o Click the "+" icon in the upper-right corner and select "New repository".
o Name your repository.
o Choose whether the repository should be public or private.(You must keep private )
o Click "Create repository".

Step 2: Initialize Git in Your Project Folder

1. Open Terminal/Command Prompt:


o Navigate to your project folder using cd path/to/your/project.
2. Initialize Git:
o Run the command git init to initialize a local Git repository in your project folder.

Step 3: Add Your Files to the Repository

1. Add Files:
o Run git add . to stage all your files for the first commit.
2. Commit Your Files:
o Run git commit -m "Initial commit" to commit the files to your local repository with a
message.

Step 4: Link Your Local Repository to GitHub

1. Add the Remote Repository:


o Run git remote add origin https://github.com/yourusername/your-repository-name.git
(replace yourusername and your-repository-name with your GitHub username and
repository name).
2. Push Your Files to GitHub:
o Run git push -u origin main to upload your files to GitHub. For older Git versions, you
might use master instead of main.

Step 5: Make Changes and Keep Your Repository Updated


1. Make Changes: After making changes to your files, repeat the following steps:
o Stage your changes: git add .
o Commit your changes: git commit -m "Describe your change"
o Push your changes to GitHub: git push
2. Single Upload: Ensure you push your changes every time you make an update, so your repository
remains up-to-date with all your work.

Step 6: Verify Your Changes on GitHub

1. Check Your Repository: Go to your GitHub repository in your browser and verify that your files
have been uploaded and the changes are reflected.

Step 7: Share Your Repository

1. Share the Link: Copy the URL of your GitHub repository and submit it to your teacher or share it
with your classmates as required.

Important Notice:

If you do not follow these steps for each and every assignment and lab, you will receive a zero right
away. It is essential to keep your work up-to-date on GitHub as this will also serve as proof of your
progress and effort.

You might also like