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 public class named TestQuestion
. This class is
going to represent a single question on a test, identified by an id,
the text of the question, and the number of points the question is
worth but for now just write the basic class defintition.
Add three instance variables, a String
named
id
which will hold the question identifer, a
String
named question
to hold the question
text, and a double
named points
that holds
the point value of the question.
Write a constructor that takes four arguments, a
String
test name, an int
question number,
a String
containing the text of the question, and a
double
which is the point value of the question.
The first two argument sould be combined to produce a
String
identifier of the form Test name-question number
which will be assigned to the instance variable id
. For
instance if the test name is "FINAL"
and the question
number is 1
, then id
should be set to
"FINAL-1"
. The other two arguments should be assigned
to the other two instance variables.
Write getters, getId
, getQuestion
, and
getPoints
, that each return the value of the
corresponding instance variable.
Write setters, setQuestion
and setPoints
,
that set the value of the corresponding instance variable. Note, you
should not write a setter for id
as it should
not change after the object is constructed.
Write a method score
that takes a double
argument representing the amount of credit received for the question
(probably a number between 0.0 and 1.0) and returns the score for
the questions as the number of points the question is worth times
the amount of credit awarded. For instance a question worth 2.0
points for which a student earned 0.75 credit, should yield a score
of 1.5.
Write a method copy
that takes a
String
and an int
and returns a new
TestQuestion
with the question and points copied from
the current object but with the test name and question number given
by the method arguments.