Saturday, December 6, 2014

How to Initialize ArrayLists (not like Array initialization)

Here are two ways to initialize an array:

int [] x = { 1, 2, 3, 5 };

Of course, you can also initialize Arrays manually, like this:

int [] x = new int[4];
x[0]=1;
x[1]=2;
x[2]=3;
x[4]=5;

Now lets look at the comparable ways to initialize an ArrayList of Integers:

Here is the manual way:

ArrayList<Integer>  x = new ArrayList<Integer>();
x.add(1);
x.add(2);
x.add(3);
x.add(5);

If you try to use the {} to initialize an ArrayList, it will not work:

Arraylist<Integer> x = {1, 2, 3, 5}; // this will not compile

The above will not work because this syntax is not supported by java.

Here is the proper way to initialize an ArrayList in a single line of code:

ArrayList<Integer>  x = new ArrayList<>(Arrays.asList(1, 2, 3, 5));

What is happening in the above line of code is that the Arrays class is providing a static method called asList(), which is taking the numbers and converting them to an ArrayList. The variable x is then used to point to the newly created list.
This latter (more sophisticated) method of initializing an ArrayList is NOT tested on the AP exam (or my exams) but is handy. I am showing it to you here because I have used it in your ArrayList Intro Lab and did not want you to get confused by it.

mr. sarkar

Monday, November 17, 2014

Test Friday on Strings

The test will consist of 20 or so multiple choice questions (3 points each) followed by one or two long answer String problems. The long answer problems will be on the same level of difficulty as String-1 and String-2 in coding bat. mr. sarkar

Thursday, November 6, 2014

Coin Game Now Due Wednesday

The coin game project due date has been moved to wednesday (11/12) because the class does not meet on monday due to the rotation. tuesday is a holiday.

Friday, October 24, 2014

Array exam will be Thursday, October 30th

The exam on Arrays will be on Thursday October 30th. It will feature multiple choice questions similar to those seen on the AP Computer Science exam but somewhat easier in difficulty. Since this exam is taking place during first block, please do not be late for class on this important date. mr. sarkar

Monday, October 6, 2014

Extra Help After SChool Today (Monday 10/6/14) from 2:30-3:30 in the Lab (414)

Normally, extra help after school is from 2:10 to 3:10 but due to a parent-teacher meeting, extra help today will take place from 2:30 to 3:30. You are also welcome to use the lab from 2:05 to 2:30.

Friday, September 26, 2014

AP Comp Sci: Java Fundamentals Exam Tentatively Scheduled for October 9, 2014

If you go on JupiterGrades.com, you will find a practice exam as well as a study guide for this upcoming exam.

We repeat the study guide, here, for your convenience:

Test 1: Study Guide - It is recommended that you print this study guide and place a copy in your notebook for reference.

The following topics will be covered on your first exam:

1. Data types - you must know how to create and use the following data types: int, boolean, double. Know the dangers of floating point operations and integer division. Understand that classes are capitalized whereas primitive data types are small letters.

2. Boolean Logic - you must know how to evaluate a boolean expression and tell if two boolean expressions are equal.

3. Compound operators - know how to use and evaluate all of these. Review a video on java compound operators if you are not sure.

4. If statements - evaluate them.

5. For loops - know how many times a for loop will run. Know how to create and use for loops.

6. Order of operations - I realize this can get nasty so I will only ask relatively simple questions on the test on this topic. At a minimum, you should know traditional PEMDAS and also the order of operations for java's conditional operators.

7. instanceof operator - know everything about this.

8. Inheritance - know how to define classes that inherit from other classes. Know what it means to inherit and override methods. Understand what you did on MonotoneBug to turn off the setColor() method.

9. Random - Know how to use Math.random(). What range of values does Math.random() return? Can it return 0.00? Can it return 1.00? Can it return something larger? Use Math.random() to pick an integer in a given range - for example, use it to pick an integer from 3 to 9 inclusive.

10. GridWorld - be familiar with how the various actors work and how to change their behavior. (Review what you did in the "Something Buggy" Lab);

Sunday, September 14, 2014

AP Computer Science: Identifier Exam On Wednesday (First Block)

This Wednesday, Septermber 17th, first block, we will have our first exam in AP Computer Science. You will be presented with a series of words. For each word, you will have to identify if the word is a valid identifier in java. Valid identifiers are those words which can be used as variables.

There are two possible reasons why a word may be disqualified from being used as an identifier. First, if it is one of java's 50 reserved words, it cannot be used as an identifier/variable name. An example of such a word is void.

Alternatively, a word may be disqualified because it contains an illegal sequence of characters. For example ab,cd is not a valid identifier because a comma is not permitted anywhere inside an identifier.

The test will count for 50 points, so it will only carry half the weight of the other tests you will take this year in AP Comp Sci. The test will likely not take you the entire period so bring some work for another class in case you finish early.

Sunday, July 6, 2014

Summer Assignment Now Available

Freshly back from Holiday, I have turned on your summer assignment. Please log into JupiterGrades (instructions on how to do this are provided in an earlier post, which can be seen by scrolling down, below) and go to the Tests and Lessons section to see the summer assignments.

My guess is that it will take you about 4 hours (or less) to complete the whole thing.

If you have any questions, please do not hesitate to email me.

Mr. Sarkar

Monday, June 23, 2014

Welcome to AP and CP Computer Science for the Academic Year 2014-2015

Welcome to my class. We will use this blog as one of many ways to communicate. Note the summer assignment in the following post. You can always contact me by email at csarkar@StamfordCT.gov

Summer Assignment for AP Computer Science for Summer 2014 (For Students Taking Computer Science in 2014-2015 Academic Year)

Here is  a list of four tasks you have to do over this summer to get ready for our AP Computer Science class in the fall:
  1. Register for this blog (follow it by email). Look for instructions on the bottom of this page.
  2. Post a comment on this blog introducing yourself, letting your peers know you have successfully registered.
  3.   We will use JupiterGrades.com for most of our on-line homework assignments throughout the year. Log into your already-created JupiterGrades.com account using the temporary login and password found on the post titled "Temporary Passwords for JupiterGrades.com," on this blog. Update your password as required the first time you log into JupiterGrades.com. Then do all the summer assignments listed on Tests and Lessons section of the site.  Hint: Although JupiterGrades works with Internet Explorer, it works much better with Chrome, Firefox or Safari. I strongly suggest you use one of these browsers.
  4. You must also download and install Java and BlueJ (both free) on your home computer or laptop. Java is the programming language we will be using in the course. BlueJ is a set of development tools we will use to help you learn Java. Both pieces of software work on both Windows and Apple machines. Instructions for downloading the software may be found on the following YouTube videos.
The first two videos, below, demonstrate how to download Java and BlueJ, respectively, on Windows machines. The third video teaches you how to download BlueJ on a Mac (Java already comes preinstalled on Macs).

            This first video will show you how to download Java on to your Windows PC or laptop:



       
             Also follow these instructions to download BlueJ if you own a Windows PC or laptop:





            Follow the following instructions for downloading BlueJ if you own an Apple PC or laptop:




All of the above need to be done before the first day of class or you will already be behind. Feel free to email me at csarkar@StamfordCT.gov if you have any questions.

I am excited about teaching this course starting in the Fall of 2014. Looking forward to meeting all of you.

Mr. Sarkar
csarkar@StamfordCT.gov
Westhill High School

Temporary Passwords for JupiterGrades.com

To log into JupiterGrades, go to www.jupitergrades.com and enter the information requested. Your temporary password can be found below. If it says RESET under your name, you already have a JupiterGrades password (likely from a previous class with me or another teacher). If you cannot remember this password, email me and I will reset it for you.

After you log into JupiterGrades.com and change your password, you should go to the homework/assignment portion of the website to view your summer work.

StudentIDPasswordLoginsParent/ContactPasswordLogins
Brabham, Jackie10300356
Reset
 
Parent 1
Parent 2
ig83
89bp
 
 
 
Chase, Justin10300818
a6r7
 
Mother
Parent 2
th84
93sx
 
 
 
Deluca, Jesse10300819
d3h3
 
Parent 1
Parent 2
bc32
46sz
 
 
 
Fiore, Nicholas1018643
Reset
 
Parent 1
Parent 2
aq57
39zv
 
 
 
Getman, Daniel1040713
w4v7
 
Parent 1
Parent 2
dk55
96hj
 
 
 
Inabathini, Meghana1180003
Reset
 
Mother
Parent 2
Reset
82ur
 
 
 
Joseph, Joel10300820
z8f6
 
Parent 1
Parent 2
qn87
26iu
 
 
 
Lebedev, Peter1032021
Reset
 
Parent 1
Parent 2
Reset
92rb
 
 
 
MacDonald, Calvin1035656
Reset
 
Mother
Father
Reset
56ir
 
 
 
Maitan, Amanda1019501
j4z4
 
Mother
Parent 2
Reset
97rt
 
 
 
Malhotra, Michael10300821
v3b8
 
Parent 1
Parent 2
ku76
29tb
 
 
 
Nekritz, Jason10300822
b8d5
 
Parent 1
Parent 2
jw55
77yf
 
 
 
Patni, Abhinav1023500
Reset
 
Parent 1
Parent 2
vk47
98hy
 
 
 
Rough, Christopher10300823
d8x3
 
Parent 1
Parent 2
hf93
52xy
 
 
 
Russell, Sophia10300824
v6n8
 
Parent 1
Parent 2
ng96
22zn
 
 
 
Schlessinger, Joseph10300825
w4y5
 
Parent 1
Parent 2
zx72
77hz
 
 
 
Schwartz, Jacob10300826
x4d4
 
Parent 1
Parent 2
ia43
68ac
 
 
 
Sieminski, Sebastian10300198
t2w4
 
Parent 1
Parent 2
bz47
83ig
 
 
 
Sottile, Michael1017326
Reset
 
Parent 1
Parent 2
jh86
64ay
 
 
 
Yang, Xiaojian10300827
a9r3
 
Parent 1
Parent 2
yq78
96hy
 
 
 

Sunday, April 27, 2014

Grading Scale for Free Response Question Portion of Exam

There were two questions on your FRQ exam. Each question is worth 9 points so the maximum total raw score possible is 18. Here is the conversion scale from errors to a score out of 5:

Score       Major Errors
5.0           0 or 1
4.5           2
4.0           3
3.5           4 or 5
3.0           6 or 7
2.0           8 or 9
1.0           More than 9

To get a score out of 100, use the following table:

Final Score    Score
100                5.0
93                  4.5
90                  4.0
85                  3.5
80                  3.0
70                  2.5
60                  2.0
50                  1.5
40                  1.0

Overall, the class did well.

Monday, April 7, 2014

Getting your AP Scores During the Summer

Dear Colleague:
AP® Students Will Get Scores Online in July
To ensure that students are prepared to access their scores, they must follow the steps outlined below. We ask that you help your students get ready, particularly those who have never taken an AP Exam before.
Please share these important steps with your students:
At exam time or during a preadministration session, fill inAP answer sheets carefully and consistently. Especially important are name, date of birth, sex, mailing address, and email address.
As early as possible, sign up for a College Board account at apscore.org. Students must have an account to access their scores.
 
Some students may already have an account. Have them confirm this by signing in.
Remember the following information, which will be required to see their scores in July:
 
College Board account username and password
 
2014 AP number (or student ID number if they provided it on their AP answer sheet)
Score Release Schedule
The score release schedule will be available at apscore.org in early May, and students will receive an email in early July at the email address they put on their AP answer sheet reminding them when they can access their scores.
Tips to Help Students Get Ready
Spread the word with posters and flyers, available in our downloadable awareness toolkit.
Give your students a homework assignment of creating a College Board account by April 30.
Encourage students to visit apscore.org, where they can sign up for their account and access FAQs, AP Exam practice, study tips, and more.
Learn more
Thank you for your support in helping students get ready for their scores in July.
Sincerely,
Advanced Placement Program