Welcome to BHS Computer Science. If you are a student in the class, the first thing you need to do (and which we should have done in class) is set up your GitHub account.
Once you have a GitHub account, click “Log in to GitHub” below to proceed. Or you can click “Use anonymously” to play with the environment but you will not be able to save your work or submit assignments. (You can always log in later by clicking the at the top of the page.)
If you don’t have a GitHub account yet, please create one and then log in here for further instructions.
Congratulations! You have successfully connected this app to GitHub. However you are not yet a member of the GitHub organization for this class, something Mr. Seibel needs to set up for you.
This is your GitHub profile URL:
Click the clipboard icon to copy it and then submit it at this form so he can add you.
Congratulations! You have successfully connected this app to GitHub. And it looks like you have an invitation to join the GitHub organization for this class. You need to accept that invitation before you can proceed. The invite should be sent to whatever email you used when you created your GitHub account.
I see you are logged into GitHub and a member of the berkeley-high-cs GitHub organization. However there seems to have been some problem finishing the setup for your account. Please let Mr. Seibel know.
This is a tool for the BHS Computer Science class at Berkeley High School. It is intended to provide a simple environment for experimenting with Javascript without all the complexities of a full development environment such as ReplIt or Glitch which we may use later in the year.
It is also designed to take advantage of the browser’s ability to run Javascript natively. It does not need access to a server to run code making in extremely responsive even if the Wifi is flaking out.
Finally, under the covers it is saving work to a GitHub repository in a very simplified workflow that does not depend on immediately learning any git commands. Code written in this environment for each assignment is saved to a directory and branch specific to that assignment each time it is saved. Thus when the assignment is done, it is easy to go to GitHub and create a PR containing just the work on that assignment which can then be commented on and worked on further before it is turned in and merged to main.
You're all set! You don't need to worry about this yet but we have successfully created a GitHub repository for your work:
You can get to it any time by clicking on your GitHub username at the top-right of the screen.
The sum of two numbers is what you get when you add them together.
Write an expression for the sum of the two numbers
a
and b
.
The difference between two numbers is what you get when you subtract
the second from the first. Write an expression for the difference
between the two numbers a
and b
.
The product of two numbers is what you get when you multiply them.
Write an expression for the product of the two numbers
a
and b
.
The ratio between two numbers is what you get when you divide the
first by the second. Write an expression for the ratio of the two
numbers a
and b
.
The remainder of of dividing one number by another is the integer
part left over after doing a division. Write an expression for the
reminder after dividing a
by b
.
The average of two numbers is their sum divided by two. Write an
expression for the average of the two numbers a
and
b
.
The average of three numbers is their sum divided by three. Write an
expression for the average of the numbers a
,
b
, and c
.
The average of an arbitrary number of numbers is their total divided
the number of numbers. Write expression for the average of a set of
count
numbers whose total is total
.
The distance between two numbers (e.g. on the number line) is the
absolute value of their difference. The
Math.abs
function returns the absolute value of its
argument. Write an expression that computes the distance between two
numbers a
and b
.
The “Manhattan distance” between two points in 2d space is the sum
of the distance between the points along the x axis (crosstown) and
the distance between the points along the y axis (uptown/downtown).
Write an expression that computes the Manhattan distance between two
points the first whose x,y coordinates are given by the numbers
x1
and y1
and the second by the numbers
x2
and y2
.
The normal way we measure the distance between points in 2d space is
called Euclidian distance and is computed as the square root of the
sum of the squares of the distance along the x and y axes. Write an
expression that computes the Euclidian distance between two points
the first whose x,y coordinates are given by the numbers
x1
and y1
and the second by the numbers
x2
and y2
. You can use the function
Math.sqrt
to compute the square root of a number, e.g.
Math.sqrt(4)
⟹ 2
.