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.
Twenty questions. Mostly multiple choice. A few short answer. Move through the questions with the arrows next to n of 20 in the question box.
What does the ln
in
System.out.println
stand for?
Lane
Line
Alone
Natural log
How many lines does the following code print:
System.out.print("Hello");
System.out.println(", world!");
System.out.println("Goodbye!");
1
2
3
4
What’s a good data type type to represent a temperature in degrees Celsius?
int
double
boolean
String
None of the above.
What’s a good data type type to represent the number of teachers at BHS?
int
double
boolean
String
None of the above.
What’s a good data type type to represent the number of dollars in your bank account?
int
double
boolean
String
None of the above.
What’s a good data type type to represent text in almost any characters used by different languages around the world?
int
double
boolean
String
None of the above.
What’s a good data type type to represent whether a senior is allowed to go to the prom?
int
double
boolean
String
None of the above.
What’s a good data type type to represent the number of atoms in the universe?
int
double
boolean
String
None of the above.
Which of these is not an expression?
10
x
int y;
10.5
a + b * c
(int) n
"hello, world!"
Which of these is the correct way to compute the fraction of
seniors in a section as a double
given the
int
variables numberOfSeniors
and
totalNumberOfStudents
?
(double) numberOfSeniors / totalNumberOfStudents
(double) (numberOfSeniors / totalNumberOfStudents)
Which of these is would also work to compute the fraction of
seniors in a section as a double
given the
int
variables numberOfSeniors
and
totalNumberOfStudents
?
1.0 * numberOfSeniors / totalNumberOfStudents
numberOfSeniors / totalNumberOfStudents * 1.0
Which of these is the correct way to convert the
double
variable fractionSeniors
to a
percentage in the range 0 to 100 rounded to the nearest integer.
(int) (fractionSeniors * 100)
(int) fractionSeniors * 100
(int) fractionSeniors * 100 + 0.5
(int) (fractionSeniors * 100 + 0.5)
(int) (fractionSeniors + 0.5 * 100)
(int) (fractionSeniors + 0.5) * 100
Which if these is the correct expression to get the value of the digit in the one’s place?
n / 10
n % 10
n * 10
n / 10.0
What is the value of this expression:
6 - 12 / 3.0
Hit enter to save answer.
What is the value of this expression:
3 / 12 * 8.0
Hit enter to save answer.
What is the value of this expression:
7 - 2 % 3
Hit enter to save answer.
To compute the true mathematical mod of a
and
b
(what a % b
would be if
%
was true mod rather than remainder) you can
compute the remainder of a
divided by
b
, add b
to that, and then and take
the remainder of that whole thing when divided by
b
. Write an expression that implements that formula
in Java using a
and b
as the two
operands.
Hit enter to save answer.
What is x
after the following code runs:
int x = 0;
x += 1;
x -= 10;
x *= -3;
x %= 5;
x = x * 2;
x--;
Hit enter to save answer.
Same code as before except we don’t know the initial value of
x
. This time write out a single expression that
expresses the final result in terms of x
.
x += 1;
x -= 10;
x *= -3;
x %= 5;
x = x * 2;
x--;
Hit enter to save answer.
Which kind of monster are double
values like?
Giant spiders
Orcs
Zombies
Poltergeists