Welcome to AP Computer Science A. 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.
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 AP Computer Science A 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.
Write a method that takes three String
s and returns a
String
with the second argument inserted into the first
argument immediately before the first occurrence of the third
argument. (You can assume the third argument is present in the first
argument.) For instance
insertBefore("abcd", "xxx", "bc")
would return
"axxxbcd"
.
Write a method that takes three String
s and returns a
String
with the second argument inserted into the first
argument immediately after the first occurrence of the third
argument. (You can assume the third argument is present in the first
argument.) For instance
insertBefore("abcd", "xxx", "bc")
would return
"abcxxxd"
.
Write a method that takes a single String
argument and
returns a String
consisting of the argument reversed.
For instance reverse("abcd")
would return
"dcba"
.
Write a method that takes a single Sting
and returns a
new string with all the space characters (" "
) removed.
Write a method that takes an ArrayList
of
String
s and a String
to use as a delimiter
and returns a String
consisting of all the strings in
the list joined together with the delimiter between them. For
instance, given the list ["a", "b", "c"]
and delimiter
","
it should return "a,b,c"
.
Write a method that takes an array of String
s and
returns a boolean
indicating whether the array is
sorted.
Recall that the String
method
compareTo
returns a negative number if the
String
it is invoked on is less than its argument, a
number greater than 0 if it is greater than, and 0 if they are
equals
. For exameple "abc".compareTo("bcd") will return
a negative number and "bcd".compareTo("abc") will return a positive
number.
Write a method that takes a single String
argument and
returns an ArrayList
of String
s containing
all the non-empty substrings of the argument. For instance,
allSubstrings("food")
should return the list:
["f", "fo", "foo", "food", "o", "oo", "ood", "o", "od",
"d"]
.
Write a method that takes a one-character String
and
returns a boolean
indicating whether it is a digit
character (i.e. one of the digits from 0-9).
Write a method that takes a String
consisting of
interspersed whole numbers and other characters and returns an
ArrayList
of Integer
s containing the
numeric values. For instance
numbers("123,456x99")
should return the list
[123, 456, 99]
.
You can turn a string consisting of just digits into a nummber using
the method Integer.parseInt
, e.g.
Integer.parseInt("123")
returns the int
123
.
Write a method that takes a single String
argument
consisting of a single run-length-encoded set of letters, i.e. a
letter followed by a number indicating how many copies of that
letter should occur, that returns the decoded version of the string.
For instance runLengthDecode("a2b3")
should return
"aabbb"
.
You can turn a string consisting of just digits into a nummber using
the method Integer.parseInt
, e.g.
Integer.parseInt("123")
returns the int
123
.