Monday, March 16, 2015

Playing Card Lab Now Due Day Before Break

The due date of the playing card lab has again been pushed out. It is now due the Friday before break.

mr. sarkar

Friday, March 13, 2015

How to pass a filename to a program

The code below assumes that the filename to be used by the progam is contained in args[0]

public class FileNameDemo
{
    public static void main(String [] args) {
        String fileName = args[0];
        FileReader reader = new FileReader(fileName);
        Scanner inputFile = new Scanner(reader);
    }
   
}

Friday, March 6, 2015

Playing Card Lab Due Date Pushed to 3/23

Given all the sorting code is due next week, the Playing Card Lab is now due on 3/23.

mr. sarkar

Friday, January 30, 2015

Wednesday, January 28, 2015

The top 25 jobs in America - Guess what is listed as #2?

Top 25 best jobs in America for 2015

The best jobs this year are in tech, professional services and healthcare, according to a recent report from Glassdoor.
Physician assistant earned the No. 1 spot on Glassdoor’s inaugural 25 best jobs in America list, thanks to its high pay, number of job openings and career opportunities. There are 45,484 physician assistant job openings posted on Glassdoor, with an annual average base pay of $111,376. Other top jobs are software engineer and business development manager. See all 25 top jobs above.
Glassdoor identified the top 25 jobs with the highest “Glassdoor Job Score,” a score from 1.0 to 5.0 determined by a position’s earning potential, career opportunities rating and number of open jobs listing. For a job title to be considered, it had to have at least 75 salary reports and at least 75 career opportunities ratings shared by U.S.-based employees from Jan. 10, 2014 to Jan. 9, 2015. The job openings number represents the number of jobs posted on Glassdoor from Oct. 21, 2014 to Jan. 20, 2015.
The highest paying job on this list is finance manager, with an average annual base salary of $122,865. The lowest paying is physical therapist, which has an average annual base salary of $64,806.
Software engineer has the most current job openings, with 104,828 in total.
If this list of jobs sounds familiar, it’s possibly because CareerBuilder’s top jobs of 2015 list features several of the same occupations. CareerBuilder worked with Economic Modeling Specialists Inc. to rank jobs by supply and demands. The list, released in November, names marketing executive as the top job of 2015, followed by software developer and registered nurse.

Wednesday, January 14, 2015

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