Closed github-learning-lab[bot] closed 3 years ago
Completed. Added files by instructions.
For this assignment, you will follow the instructions and complete a task showing your knowledge of the subject at the end. If at any moment you need help, feel free to contact your TAs.
GitHub is a cloud-based repository hosting service that is widely used in the tech industry. It allows teams to use Git for version control, collaboration, and file management. If you don't know what Git is, it's a version-control system for tracking changes, managing state, and concurrently developing on the same files or directories. Git and Github's tools are specifically designed to make coordinating work easier, and they are one of the most pervasive shared tools among students and the industry.
If you want to learn more about what it is and how to use it, try taking this GitHub Learning Lab Course. After finishing it, you will have a strong understanding of all the features GitHub has to offer. To make an account, go to: https://github.com/join to sign up. After making an account, you're all set to complete Task 3!
Task 2: create a repository and commit your homework javascript file to it (make sure you know key functions like commits, forking, pull request, branch, etc).
Good job, you're done with both parts!
Done.
Shortcuts:
.
: current directory..
: previous directory~
: home directoryDirectory (folder):
pwd
: print current directory (if you're lost, or need the full path to the current directory you're in)ls
: list everything in current directory (super useful to know which files/folders you can currently access)ls [directory path]
: list everything in current [directory path]cd [directory path]
: change directory to [directory path]
cd /home/users/Shreya/Documents/terminal.md
cd .
: change directory to current directory (doesn't really do much)cd ..
: change directory to previous directory (useful)cd ../some_folder_name
: change directory to some_folder_name directory in previous directory (sort of like going back one and into another folder)cd .
: change directory to home directoryOpening files (in terminal, you don't need this if you're using GitHub desktop)
In file:
vi
: open file[ECS] -> *+w+q
: save fileRunning a program
./[program_name.extension]
[any other expected arguments]
./sumarray.js
(week 2)./romanint.js 78
(week 3)Find more useful commands: https://www.techrepublic.com/article/16-terminal-commands-every-user-should-know/
Not sure which command to use or how it works? Google it! Everyone uses terminal so there's a lot of useful content/blogs/video tutorials online. You can also ask your mentor for help if you're not sure where to start.
Finished
When a section is completed, a new issue will be created with the next step. Click here to start!
FizzBuzz In SPACE
For this assignment, you will follow the instructions and complete a task showing your knowledge of the subject at the end. If at any moment you need help, feel free to contact your TAs.
:airplane: Starting off
Create a file called fizzbuzz.js
FizzBuzz
FizzBuzz is a program used to demonstrate basic functionality of a language, often when switching between programing languages or as an introduction (that's us!) to first learning a language.
The goals of the program is to go through the numbers from 1 to 100 and print "fizz" whenever a number is divisible by 3, print "buzz" when it's divisible by 5, print "fizzbuzz" when it's divisible by both 3 and 5, and print the number when it's not divisible by either. For our program, you will do something very similar:
For the numbers from 1 to 100:
Tip: copy paste the emojis to get it into your code!
Help:
:pencil: Commenting your Code
Use in line comments to explain how your code works. Commenting your code helps ensure that you understand what is happening, and helps the code reviewer read through your code easily. For example:
Great example:
When you start writing more code (200+ lines) you will want to do the next example. For this course, your code should not extend past 50-100 lines and we want to use your comments to see how well you understand the concepts and language, so it's better to use the previous example.
Okay example:
Don't do this:
:red_car: Running your Code
In this program, you need to allow your program to take a second argument, so:
node fizzbuzz.js
with an integer between 1-100 in terminal:pencil2: Testing
To test your code, run it with different integers in the program argument to see what happens.
Test Case 1:
If you run
node fizzbuzz.js 5
the output should be:Test Case 2:
If you run
node fizzbuzz.js 17
the output should be:Output example:
✅ Submit
Task 1: Complete the FizzBuzz program as described above
Commit a file called fizzbuzz.js
Good job, you're fizzing and buzzing in space!