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 perimeter of a square is four times the length of one side.
Write an expression for this quantity given side s
.
The perimeter of a rectangle is two times its width plus its height.
Write an expression for this quantity given width w
and
height h
.
The area of a square is the square of the length of one side. Write
an expression for this area given side s
.
The area of a rectangle is its width times its height. Write an
expression for this area given width w
and height
h
.
The area of a triangle is half the base time the height. Write an
expression for this area given base b
and height
h
.
The area of a trapezoid is half the sum of the bases times the
height. Write an expression for this area given bases
b1
and b2
and height h
.
The area of a circle is π times the square of the circle’s radius.
Write an expression for this area given radius r.
. You
can use Math.PI
to get a good approximation of π.
The circumference of a circle is 2πr. Write an expression for this
quantity given radius r
. You can use
Math.PI
to get a good approximation of π.
The curved surface area of a cylinder (i.e. the outside excluding
the top and bottom) is the circumference of its base circle times
its height. Write an expression for this area given a base radius of
r
and height h
. You can use
Math.PI
to get a good approximation of π.
The total surface area of a cylinder (the curved surface area plus
the top and bottom) is sum of the curved surface area plus two times
the area of the top and bottom circles. Write an expression for this
area given a base radius of r
and height
h
. You can use Math.PI
to get a good
approximation of π.
The volume of a circle is the area of the base circle times the
height. Write an expression for this volume given a base radius of
r
and height h
. You can use
Math.PI
to get a good approximation of π.
The curved surface area of a cone (i.e. the outside excluding the
circular base) is π times the radius of the base times the slant
height. Write an expression for this area given base radius
r
and slant height s
. You can use
Math.PI
to get a good approximation of π.
The total surface area of a cone is its curved surface area plus the
area of its circular base. Write an expression for this area given
base radius r
and slant height s
. You can
use Math.PI
to get a good approximation of π.
The total surface area of a cone can also be computed from its base
radius and height by computing its slant height as the square root
of the sum of the base radius squared and the height squared. Write
an expression for this area computed this way given base radius
r
and height h
. You can use
Math.PI
to get a good approximation of π. And the
function Math.sqrt()
computes the square root of its
arguments, e.g. Math.sqrt(2) => 1.4142135623730951
.
The volume of cone is the area of its circular base time a third of
its height. Write an expression for this volume given base radius
r
and height h
. You can use
Math.PI
to get a good approximation of π.
The surface area of a sphere is four times the area of a circle with
the same radius as the sphere. Write an expression for this volume
given radius r
. You can use Math.PI
to get
a good approximation of π.
The volume of a sphere is 4/3 times π times the radius cubed. Write
an expression for this volume given radius r.
. You can
use Math.PI
to get a good approximation of π.
Write an expression that, given two points on a line,
a
and b
, represented as numbers (imagine
mile makers on a road or something), evaluates to the midpoint
between them. For instance if a
is 6 and
b
is 10, the midpoint is 8. You can assume that
a
is not greater than b
If you remember the Pythagorean theorem, you know that the length of
the hypotenuse of a right triangle is the square root of the sum of
the squares of the two other sides. Write an expression for the
length of a hypotenuse of a triangle with sides a
and
b
. (Math.sqrt()
computes the square root
of its arguments, e.g.
Math.sqrt(2) => 1.4142135623730951
.)