*** This course is designed to prepare students to take the AP Computer Science A Exam ***
*** Excerpts from the course overview was taken from AP CollegeBoard ***
AP Computer Science A is an introductory college-level computer science course that introduces one of the more popular programming languages to students. Fundamental topics in this course include the design of solutions to problems, the use of data structures to organize large sets of data, the development and implementation of algorithms to process data and discover new information, the analysis of potential solutions, and the ethical and social implications of computing systems. The course emphasizes object-oriented programming and design using the Java programming language.
The following big ideas serve as the foundation of the course, enabling students to create meaningful connections among concepts:
Modularity: Modularity in object-oriented programming allows us to use abstraction to break complex programs down into individual classes and methods.
Variables: Variables create data abstractions, as they can represent a set of possible values or a group of related values.
Control: Doing things in order, making decisions, and doing thesame process multiple times are represented in code by usingcontrol structures.
Impact of Computing: Computers and computing haverevolutionized our lives. To use computing safely and responsibly,we need to be aware of privacy, security, and ethical issues.
For this course we will be using various Integrated Development Environment (IDE) software to help you manage your programs, data files, & images. Coding Rooms will be our primary online IDE for this course. For your personal development and collaboration, you may want to use an online IDE that will allow you to collaborate with peers. If you are using a personal laptop, a good desktop IDE to install is VS Code.
Click Here
- Be on time for class. This includes but is not limited to having you log into your Canvas course, course website, and notebook. Students should be seated within the first five minutes of class to avoid being marked tardy or absent
- Be prepared for class. This includes having your notebook, assignments, pen/pencil, and paper.
- Have a good attitude about learning. Be prepared to actively participate in class. Accept feedback with a positive attitude.
- Be respectful of others and their property.
- Take care of the learning environment. Keep your area neat and clean. Always clean your space before you leave for the day. Put materials away in their proper place.
- Report any damaged equipment.
- Do not change any of the settings on the computers.
- Do not download/ install any programs (including games) to the computer.
- Do not access inappropriate content on the internet.
- I encourage students to work with a peer on assignments. It can make learning fun! YOu may help with general problem-solving strategies, ideas, and algorithms, but all solutions should be your own. In practice, this means that, while students can discuss programs and questions, all lines of code should originate from your own mind. This course uses technology in ways no other course does. If you are unsure about the ethical implications of what you are doing, you should ask. Claiming ignorance is not a reasonable excuse.
- If you use other sources for help (websites, LLM/ AI, friends, etc.), please cite them in the comments of your code indicating where you got help and whether certain sections of code came from that help. Please make sure you understand any code that you use from another source. I discourage you from copying my assignments into LLM/ AI tool to generate a complete solution. You can use LLM/ AI tools and other sources for idea generation, code debugging, and help with understanding or generating small parts of code to get you started, but you should not have them do the work for you. Be in charge of your own learning, and make sure you learn the goal(s) of the assignment is asking you to practice!
- Assignments that are designated as team/ group assignments must have each student’s name within the block header. Other assignments students may collaborate with another student, but each student must submit their own work and the assignment cannot be a facsimile of their peer’s work. Submitted assignments that has another student’s name on it and not your name will be considered as cheating and subject to the district’s policy regarding plagiarism/ cheating.
- Students should be engaged during class! From my experience, most students are using their electronic device(s) for activities not related to the class content. Thus, during instruction, assessment, classwork, discussions or group collaboration electronic devices should be placed in a secure location where it will not be a distraction. Specifically, students should not be accessing smart phones, tablets or any device during class without permission from the teacher. Phones should be set to silent or turned off in class.
- CAMS provides Windows Laptops for student use. Personal Laptops are a privilege on our campus and not a right. Parent(s)/guardian(s) will be notified and conferences will be held should a student persist in using laptops for entertainment purposes.
- Earphones, headphones, or other listening tools (excluding medically approved listening devices) should not be used during instruction or collaboration time.
Each student will be responsible for taking, organizing, and maintaining Unit notes (Purpose of Note-Taking). Notes should be hand-written. The method of note-taking will be Cornell Notes. Students will be provided with the formatted Cornell Notes document for each subsection of the Unit. Additional pages will be provided as needed. Students are encouraged to keep their notebooks up-to-date and organized.
- Before school – 7:30 am – 8:30 am - please contact me prior to the date you need assistance as I may be meeting with another student or have a meeting
- After school – Tuesday – Thursday: 3:45 pm – 4:15 pm
- the DEN Peer Tutoring (Monday - Friday/ before and after school)
Grades are posted online using Canvas. Grades are weighted and assigned as detailed below. Each item is scaled on a point system.
Grading | Percentage |
---|---|
Projects (IDP, Final Project) | 50% |
Test/ Quizzes | 30% |
Classwork/ Portfolio | 15% |
Notes (students may use the current unit hand-written notes for tests) | 5% |
All projects, presentations, tests, quizzes, classwork, portfolio & notes will be used to calculate your final grade.
Projects, classwork, portfolio, and notes grading will follow this scale:
- 4 - Exceeded Expectations - The program is fully functional and the student has added functionality that exceeds the brief. (A)
- 3 - Met Expectations - All program functionality is evident. (B)
- 2 - Approaching Expectations - Most of the program is functional but there are still some functionality issues. (C).
- 1 - Below Expectations - Some of the work was completed but the program is not near functional standards. (D)
- 0 - Little to no work was Completed (F)
Students who score below 75% on a project, test or quiz (excluding finals) may retake the project, test, or quiz for up to a 75%. Students will have 1 week to review any feedback and/ or answers and schedule a time to retake the project, test, or quiz.
Grade Letter | Percentage |
---|---|
A | 90% - 100% |
B | 80% - 89% |
C | 70% - 79% |
D | 60% - 69% |
F | 50% - 59% |
M(issing) | 45% |
It is crucial that students consistently attend class. Most classes will consist of activities and projects where students are learning the structure and implementation of a language. Consistent attendance is important to this class and poor attendance will affect their understanding and overall performance in this class. This grade is inclusive of attendance, participation, and behavior within the classroom. The items are additive.
Tardies, Sleeping, Playing Games, doing other classes' assignments |
---|
0-5 Excellent(E) |
6-10 Satisfactory(S) |
11–15 Needs Improvement(N) |
16+ Unsatisfactory(U) |
- Students are responsible for makeup work when absent. Please refer to the district policy regarding make up work when students are absent.
- To make up a quiz or a test, it is the student’s responsibility to contact the teacher with two weeks upon their return to set an agreed upon date & time.
- Make-ups or retakes will be done either before or after school
- Handouts will be placed in a makeup folder with the student's name and it is the student’s responsibility to check this folder when they return before consulting the instructor.
Click Here
Units | Topics | MCQ | FRQ | Project |
---|---|---|---|---|
Orientation & Structure | ||||
Unit 1 | 1.1 Why Programming? Why Java? | MCQ | ||
Unit 1 | 1.2 Variables and Data Types? | MCQ | ||
Unit 1 | 1.3 Expressions and Assignment Statements | MCQ | ||
Unit 1 | 1.4 Compound Assignment Operators | MCQ | ||
Unit 1 | 1.5 Casting and Ranges of Variables | MCQ | ||
TBD | Unit Exam | MCQ | Yes | |
Unit 3 | 3.2 if Statements and Control Flow | MCQ | ||
Unit 3 | 3.3 if-else Statements | MCQ | ||
Unit 3 | 3.4 else if Statements | MCQ | ||
Unit 3 | 3.1 Boolean Expressions | MCQ | ||
Unit 3 | 3.5 Compound Boolean Expressions | MCQ | FRQ | |
Unit 3 | 3.6 Equivalent Boolean Expressions | MCQ | ||
Unit 3 | 3.7 Comparing Objects | MCQ | FRQ | |
TBD | Unit Exam | MCQ | FRQ | Yes |
Unit 2 | 2.1 Objects: Instances of Classes | MCQ | ||
Unit 2 | 2.2 Creating and Storing Objects (Instantiation) | MCQ | ||
Unit 2 | 2.3 Calling a Void Method | MCQ | ||
Unit 2 | 2.4 Calling a Void Method with Parameters | MCQ | ||
Unit 2 | 2.5 Calling a Non-Void Method | MCQ | ||
Unit 2 | 2.6 String Objects: Concatenation, Literals, and More | MCQ | ||
Unit 2 | 2.7 String Methods | MCQ | ||
Unit 2 | 2.8 Wrapper: Classes Integer and Double | MCQ | ||
Unit 2 | 2.9 Using the Math Class | MCQ | FRQ | |
TBD | Unit Exam | MCQ | FRQ | Yes |
Unit 4 | 4.1 while Loops | MCQ | ||
Unit 4 | 4.2 for Loops | MCQ | ||
Unit 4 | 4.3 Developing Algorithms Using Strings | MCQ | FRQ | |
Unit 4 | 4.4 Nested Iteration | MCQ | FRQ | |
Unit 4 | 4.5 Informal Code Analysis | MCQ | ||
TBD | Unit Exam | MCQ | FRQ | Yes |
Unit 5 | 5.1 Anatomy of a Class | MCQ | ||
Unit 5 | 5.2 Constructors | MCQ | ||
Unit 5 | 5.3 Documentation with Comments | MCQ | ||
Unit 5 | 5.4 Accessor Methods | MCQ | ||
Unit 5 | 5.5 Mutator Methods | MCQ | FRQ | |
Unit 5 | 5.6 Writing Methods | MCQ | ||
Unit 5 | 5.7 Static Variables and Methods | MCQ | ||
Unit 5 | 5.8 Scope and Access | MCQ | FCQ | |
Unit 5 | 5.9 this Keyword | MCQ | ||
Unit 5 | 5.10 Ethical and Social Implications of Computing Systems | |||
TBD | Unit Exam | MCQ | FRQ | Yes |
Unit 9 | 9.1 Creating Superclasses and Subclasses | |||
Unit 9 | 9.2 Writing Constructors for Subclasses | MCQ | ||
Unit 9 | 9.3 Overriding Methods | MCQ | ||
Unit 9 | 9.4 super Keyword | MCQ | ||
Unit 9 | 9.5 Creating References Using Inheritance Hierarchies | MCQ | ||
Unit 9 | 9.6 Polymorphism | MCQ | FRQ | |
Unit 9 | 9.7 Object Superclass | MCQ | FRQ | |
TBD | Unit Exam | MCQ | FRQ | Yes |
Unit 6 | 6.1 Array Creation and Access | MCQ | ||
Unit 6 | 6.2 Traversing Arrays | MCQ | ||
Unit 6 | 6.3 Enhanced for Loop for Arrays | MCQ | FRQ | |
Unit 7 | 6.4 Developing Algorithms Using Arrays | MCQ | FRQ | |
TBD | Unit Exam | MCQ | FRQ | |
----------------------- Semester 1 Ends ----------------------- | ||||
Unit 7 | 7.1 Introduction to ArrayList | MCQ | ||
Unit 7 | 7.2 ArrayList Methods | MCQ | ||
Unit 7 | 7.3 Traversing ArrayLists | MCQ | ||
Unit 7 | 7.4 Developing Algorithms Using ArrayLists | MCQ | ||
Unit 7 | 7.5 Searching | MCQ | FRQ | |
Unit 7 | 7.6 Sorting | MCQ | ||
Unit 7 | 7.7 Ethical Issues Around Data Collection | |||
TBD | Unit Exam | MCQ | FRQ | Yes |
Unit 8 | 8.1 2D Arrays | MCQ | ||
Unit 8 | 8.2 Traversing 2D Arrays | MCQ | FRQ | |
TBD | Unit Exam | MCQ | FRQ | Yes |
Unit 10 | 10.1 Recursion | MCQ | FRQ | |
Unit 10 | 10.2 Recursive Searching and Sorting | MCQ | ||
TBD | Unit Exam | MCQ | FRQ | |
White Tower Final Project | Yes | |||
Practice Exam 2014 | MCQ | FRQ | ||
Practice Exam 2015 | MCQ | FRQ | ||
Practice Exam 2020 | MCQ | FRQ |
Click Here
- So, you have the powerpoint, video, textbook, website and/ or whatever other resources were provided to you for this particular lesson. Do you need to take notes as well?
Despite the vast amount of information available in electronic formats, taking notes is an important
learning strategy. In addition, the way that you take notes matters, and not all note-taking strategies lead to equal results. By considering your note-taking strategies carefully, you will be able to create a set of notes that will help retain the most important concepts from lectures and tests, and that will assist you in your exam preparation.
People take notes for two main reasons:
- To keep a record of the information that was heard. This is also called the external storage function of note-taking.
- To facilitate learning that you are currently studying.
The availability of information on the internet may reduce the importance of the external storage function of note-taking. When the information is available online, it may seem logical to stop taking notes. However, by neglecting to take notes, you lose the benefits of note-taking as a learning tool.
Taking notes during class supports your learning in several important ways:
- Taking notes helps you to focus your attention and avoid distractions.
- As you take notes in class, you will be engaging your mind in identifying and organizing the main ideas. Rather than passively listening, you will be doing the work of active learning while in class, making the most of your time.
- Creating good notes means that you will have a record for later review. Reviewing a set of condensed and well-organized notes is more efficient than re-reading longer texts and articles.
Everybody takes notes, or at least everybody claims to. But if you take a close look, many who are claiming to take notes on their laptops are actually surfing the Web, and paper notebooks are filled with doodles interrupted by a couple of random words with an asterisk next to them reminding you that “This is important!” In college and university, these approaches will not work. Your instructors expect you to make connections between class lectures and reading assignments; they expect you to create an opinion about the material presented; they expect you to make connections between the material and life beyond school. Your notes are your road maps for these thoughts. Do you take good notes? Actively listening and note-taking are key strategies to ensure your student success.
Effective note-taking is important because it:
- supports your listening efforts.
- allows you to test your understanding of the material.
- helps you remember the material better when you write key ideas down.
- gives you a sense of what the instructor thinks is important.
- creates your “ultimate study guide.”
There are various forms of taking notes, and which one you choose depends on both your personal style and the instructor’s approach to the material. Each can be used in a notebook, index cards, or in a digital form on your laptop. No specific type is good for all students and all situations, so we recommend that you develop your own style, but you should also be ready to modify it to fit your needs of a specific class or instructor. To be effective, all of these methods require you to listen actively and to think; merely jotting down words the instructor is saying will be of little use to you.
Method | Description | When to Use |
---|---|---|
Lists | A sequential listing of ideas as they are presented. Lists may be short phrases or complete paragraphs describing ideas in more detail. | This method is what most students use as a fallback if they haven’t learned other methods. This method typically requires a lot of writing, and you may find that you are not keeping up with the professor. It is not easy for students to prioritize ideas in this method. |
Outlines | The outline method places most important ideas along the left margin, which are numbered with roman numerals. Supporting ideas to these main concepts are indented and are noted with capital letters. Under each of these ideas, further detail can be added, designated with an Arabic number, a lowercase letter, and so forth. | A good method to use when material presented by the instructor is well organized. Easy to use when taking notes on your computer. |
Concept Maps | When designing a concept map, place a central idea in the center of the page and then add lines and new circles in the page for new ideas. Use arrows and lines to connect the various ideas. Great method to show relationships among ideas. | Also good if the instructor tends to hop from one idea to another and back. |
Cornell Method | The Cornell method uses a two-column approach. The left column takes up no more than a third of the page and is often referred to as the “cue” or “recall” column. The right column (about two-thirds of the page) is used for taking notes using any of the methods described above or a combination of them. After class or completing the reading, review your notes and write the key ideas and concepts or questions in the left column. You may also include a summary box at the bottom of the page, in which to write a summary of the class or reading in your own words. | The Cornell method can include any of the methods above and provides a useful format for calling out key concepts, prioritizing ideas, and organizing review work. Most universities recommend using some form of the Cornell method. |
Example: The Cornell Method of Note-taking
The Cornell method was developed in the 1950s by Professor Walter Pauk at Cornell University. It is recommended by many universities because of its usefulness and flexibility. This method is simple to use for capturing notes, is helpful for defining priorities, and is a very helpful study tool.
The Cornell method follows a very specific format that consists of four boxes: a header, two columns, and a footer.
The header is a small box across the top of the page. In it you write identification information like the course name and the date of the class. Underneath the header are two columns: a narrow one on the left (no more than one-third of the page) and a wide one on the right. The wide column, called the “notes” column, takes up most of the page and is used to capture your notes using any of the methods outlined earlier. The left column, known as the “cue” or “recall” column, is used to jot down main ideas, keywords, questions, clarifications, and other notes. It should be used both during the class and when reviewing your notes after class. Finally, use the box in the footer to write a summary of the class in your own words. This will help you make sense of your notes in the future and is a valuable tool to aid with recall and studying.
“I used to tape my lecture classes so I could fill in my sketchy notes afterwards. Now that I’m using the Cornell system, my notes are complete and organized in much less time. And my regular five-minute reviews make learning almost painless. No more taping and listening twice.” — A student at Southern Methodist University
All note-taking methods end with the same step: reviewing your notes as soon as possible after class. Any review of your notes is helpful (reading them, copying them onto your computer, or even recasting them using another note-taking method). But THINK! Make your review of notes a thoughtful activity, not a mindless process. When you review your notes, think about questions you still have and determine how you will get the answers. (From the next class? Studying with a friend? Looking up material in your text or on the net?) Examine how the material applies to the course; make connections with notes from other class sessions, with material in your text, and with concepts covered in class discussions. Finally, it’s fun to think about how the material in your notes applies to real life. Consider this both at the very strategic level (as in “What does this material mean to me in relation to what I want to do with my life?”) as well as at a very mundane level (as in, “Is there anything cool here I can work into a conversation with my friends?”).
Some Teachers hand out or post their notes or their PowerPoint slides. These handouts should never be considered a substitute for taking notes in class. They are a very useful complement and will help you confirm the accuracy of your notes, but they do not involve you in the process of learning as well as your own notes do. After class, review your notes with highlighter in hand and mark keywords and ideas in your notes. This will help you write a summary of the class in your own words.
Regardless of what note-taking method you use, there are some note-taking habits you should get into for all circumstances and all courses:
-
Be prepared: Make sure you have the tools you need to do the job. If you are using a notebook, be sure you have it with you and that you have enough paper. Also be sure to have your pen (as well as a spare) and perhaps a pen with different-coloured ink to use for emphasis. If you are taking notes on your laptop, make sure the battery is charged! Select the application that lends itself best to your style of note-taking. Microsoft Word works very well for outline notes, but you might find taking notes in Excel to work best if you are working within the Cornell method. (It’s easier to align your thoughts in the cue or recall column to your notes in the right column. Just be sure you keep one idea per row!)
-
Write on only one side of the paper: This will allow you to integrate your reading notes with your class notes.
-
Label, number, and date all notes at the top of each page: This will help you keep organized.
-
When using a laptop, position it such that you can see the instructor and white board right over your screen: This will keep the instructor in your field of vision even if you have to glance at your screen or keyboard from time to time. Make sure your focus remains with the instructor and not on your laptop. A word of caution about laptops for note-taking: use them if you are very adept at keyboarding, but remember that not all note-taking methods work well on laptops because they do not easily allow you to draw diagrams and use special notations (scientific and math formulas, for example).
-
Don’t try to capture everything that is said: Listen for the big ideas and write them down. Make sure you can recognize the instructor’s emphasis cues and write down all ideas and keywords the instructor emphasizes. Listen for clues like “the four causes were…” or “to sum up.…”
-
Copy anything the instructor writes on the board: It’s likely to be important.
-
Leave space between ideas: This allows you to add additional notes later (e.g. notes on the answer to a question you or one of your classmates asked).
-
Use signals and abbreviations: The ones you use are up to you, but be consistent so you will know exactly what you mean by “att.” when you review your notes. You may find it useful to keep a key to your abbreviations in all your notebooks.
-
Use some method for identifying your own thoughts and questions to keep them separate from what the instructor or textbook author is saying: Some students use different colour ink; others box or underline their own thoughts. Do whatever works for you.
-
Create a symbol to use when you fall behind or get lost in your note-taking: Jot down the symbol, leave some space, and focus on what the instructor is covering now. Later you can ask a classmate or the professor to help you fill in what you missed, or you can find it in your textbook.
-
Review your notes as soon after class as possible (the same day is best): This is the secret to making your notes work! Use the recall column to call out the key ideas and organize facts. Fill in any gaps in your notes and clean up or redraw hastily drawn diagrams.
-
Write a summary of the main ideas of the class in your own words: This process is a great aid to recall. Be sure to include any conclusions from the lecture or discussion.
-
Use notes when preparing for a test or doing an assignment: Your notes usually have a summary of the most important points and are useful for making sure you incorporate important concepts in your assignments and for focusing on the main concepts when studying for tests and exams.
What If You Miss Class? Clearly the best way to learn class material is to be at the class and to take your own notes. Regular attendance is expected, but life happens. On occasion, you may miss a class. When this happens, here are some strategies you can use to make up for it:
- Never ask: “Did I miss anything important?” (Think about what that is saying and you’ll see it’s rather insulting.)
- If the notes or powerpoint is posted online... take notes. If the teacher uses PowerPoint slides, request a copy (or download them if posted) and review them carefully, jotting down your own notes and questions. Review your notes with a classmate who did attend.
- You may want to borrow class notes from a classmate. If you do, don’t just copy them and insert them in your notebook. They will not be very helpful. When you borrow notes from a classmate, you should photocopy them and then review them carefully and mark your copy with your own notes and questions. Use other provided resources to try and fill in the gaps. Finally, schedule a study session with the person who gave you the notes to review the material and confirm your understanding.
- If none of these options are available for you, use the course syllabus to determine what was covered in the class, then write a short paper (two pages or so) on the material using the class readings and reliable online sources. See your teacher during office hours to review your key findings and to answer any questions you still may have.
Groups within a class can take notes together using file-sharing software on the Cloud. The individuals in the group can add to the document in real time as different individuals are adding themselves. This creates a collaborative document that all can use, download, (or adapt). This won’t work for all situations but can be very useful especially in a fast-moving classroom.
Class is over, and you have a beautiful set of notes in your notebook or saved in your laptop. You have written the summary of the class in your own words. Now what? Start by organizing your notes. We recommend you use a three-ring binder for each of your subjects. Print your notes if you used a computer. If you used note cards, insert them in plastic photo holders for binders. Group all notes from a class or unit together in a section; this includes class notes, reading notes, and instructor handouts. You might also want to copy the instructor’s syllabus for the unit on the first page of the section.
Next, spend some time linking the information across the various notes. Use the recall column in your notes to link to related information in other notes (e.g. “See class notes date/page”). If you have had a quiz or test on the unit, add it to your binder, too, but be sure to write out the correct answer for any item you missed. Link those corrections to your notes, too. Use this opportunity to write “notes on your notes.” Review your summary to see if it still is valid in light of your notes on the reading and any handouts you may have added to your notes package. You don’t need to become a pack rat with your notes. It is fairly safe to toss them after the end of a course except in the following cases:
- If the course you took is a prerequisite for another course, or when the course is part of a standard progression of courses that build upon each other (this is very common in math and science courses), you should keep them as a reference and review for the follow-up course.
- If the course may pertain to your future major, keep your notes. You may not realize it now that they may have future value when you study similar topics or even the same topics in more depth.
- If you are very interested in the course subject and would like to get into the material through a more advanced course, independent study, or even research, keep your notes as a prep tool for further work.
Key Takeaways:
- Good note-taking is a key strategy for academic success.
- Choose among effective note-taking styles for what works best for you and modify it to meet the needs of a specific class or instructor.
- List notes are generally less effective and not prioritized.
- Outlines work well for taking notes on a laptop when the instructor is well organized.
- Concept map notes are good for showing the relationships among ideas.
- The Cornell method is effective for calling out key concepts and organizing notes for review.
- Instructor handouts and PowerPoint presentations help with—but do not replace the need for personal note-taking.
- If you miss a class, explore your options for replacing your missing notes.
- Keep your notes organized in a way that makes it easy to study for tests and other uses in the future.
Exercise: Note-taking
- Name two advantages of the Cornell system over the list method of note-taking.
- Describe the benefits of—and potential problems with—taking class notes on a laptop.
- List at least three ways to make up for missing notes because you miss a class.
Text Attributions
- This chapter was adapted from “Got Notes?” in University Success by N. Mahoney, B. Klassen, and M. D’Eon. Adapted by Mary Shier. CC BY-NC-SA.
- The first two paragraphs and text under the “Two Purposes for Taking Notes” heading are from “Take Notes from Lectures – That You’ll Actually Use” in University 101: Study, Strategize and Succeed by Kwantlen Polytechnic University. CC BY-SA.
Video Attributions
- “How to Take Great Notes” by watchwellclass. Standard YouTube Licence.
- Pauk, W. & Owens, R.J.Q. (2013). How to Study in College. Boston, MA: Wadsworth, Cengage Learning. ↵
Click Here
Practice 1: Program Design and Algorithm Development |
---|
1.A Determin an appropriate program design to solve a problem or accomplish a task (not assessed) |
1.B Determine code that would be used to complete code segments |
1.C Determine code that would be used to interact with completed program code |
Practice 2: Code Logic |
---|
2.A Apply the meaning of specific operators |
2.B Determine the result or ouput based on statement execution order in a code segment without method calls (other than output) |
2.C Determin the result or output based on the statement execution order in a code segment containing method calls |
2.D Determine the number of times a code segment will execute |
Practice 3: Code Implementation |
---|
3.A Write program code to create objects of a class and call methods |
3.B Write program code to design a new type by creating a class |
3.C Write program code to satisfy method specifications using expressions, conditional statements, and iterative statements |
3.D Write program code to create, traverse, and manipulate elements in 1D or ArrayList objects |
3.E Write program code to create, traverse and manipulate elements in 2D array objects |
Practice 4: Code Testing |
---|
4.A Use test-cases to find errors or validate results |
4.B Identify errors in program code |
4.C Determine if two or more code segments yield equivalent results |
Practice 5: Documentation |
---|
5.A Describe the behavior of a given segment of program code |
5.B Explain why a code segment will not compile or work as intended |
5.C Explain how the result of program code changes, given a change to the initial code |
5.D Describe the initial conditions that must be met for a program segment to work as intended or described |
Units | Exam Weighting |
---|---|
Unit 1: Primitive Types | 2.5 - 5% |
Unit 2: Using Objects | 5 - 7.5% |
Unit 3: Boolean Expressions and if Statements | 15 -17.5% |
Unit 4: Iteration | 17.5 - 22% |
Unit 5: Writing Classes | 5 - 7.5% |
Unit 6: Array | 10 - 15% |
Unit 7: ArrayList | 2.5 - 7.5% |
Unit 8: 2D Array | 7.5 - 10% |
Unit 9: Inheritance | 5 - 10% |
Unit 10: Recursion | 5 - 7.5% |
Click Here
Below is a comprehensive list of vocabulary words every AP Computer Science A student should be familiar with.
Did I miss a word? Please let me know...
Click Here
Please review the Java Style Guidelines
At the top of the file containing your program's main() block method, place an `external' block comment containing the following content.
/*=============================================================================
| Assignment: Program #[n]: [Assignment Title]
| Author: [Your Name ]
| Partner: [Partner's Name ]
|
| Course Name: [Course Name]
| Instructor: John Smith
| Due Date: [Due Date and Time]
|
| Description: [Describe the program's goal, IN DETAIL.]
|
| Language: [ Java version 8]
| Ex. Packages: [List names and sources of all external packages
| required by this program.]
|
| Deficiencies: [If you know of any problems with the code, provide
| details here, otherwise clearly state that you know
| of no unsatisfied requirements and no logic errors.]
*===========================================================================*/
An internal block comment belongs immediately ahead of each user-created method in your program, with two exceptions. First, main() is assumed to be covered by the Main() Block method/ external block comment. Second, if your class has a group of getters and setters, you may cover the entire group with one block comment.
/*---------------------------------------------------------------------
| Method [Method Name]
|
| Purpose: [Explain what this method does to support the correct
| operation of its class, and how it does it.]
|
| Pre-condition: [Any non-obvious conditions that must exist
| or be true before we can expect this method to function
| correctly.]
|
| Post-condition: [What we can expect to exist or be true after
| this method has executed under the pre-condition(s).]
|
| Parameters:
| parameter_name -- [Explanation of the purpose of this
| parameter to the method. Write one explanation for each
| formal parameter of this method.]
|
| Returns: [If this method sends back a value via the return
| mechanism, describe the purpose of that value here, otherwise
| state 'None.']
*-------------------------------------------------------------------*/
Each class you write, except the class containing main(), must have a block comment of this form ahead of it.
/*+----------------------------------------------------------------------
||
|| Class [Class Name]
||
|| Author: [Your Name]
||
|| Purpose: [A description of why this class exists. For what
|| reason was it written? Which jobs does it perform?]
||
|| Inherits From: [If this class is a subclass of another, name it.
|| If not, just say "None."]
||
|| Interfaces: [If any predefined interfaces are implemented by
|| this class, name them. If not, ... well, you know.]
||
|+-----------------------------------------------------------------------
||
|| Constants: [Name all public class constants, and provide a very
|| brief (but useful!) description of each.]
||
|+-----------------------------------------------------------------------
||
|| Constructors: [List the names and arguments of all defined
|| constructors.]
||
|| Class Methods: [List the names, arguments, and return types of all
|| public class methods.]
||
|| Inst. Methods: [List the names, arguments, and return types of all
|| public instance methods.]
||
++-----------------------------------------------------------------------*/
Examples of Good and Bad Block Comments
Contrary to popular student opinion, I don't require all of the commenting as an annoyance to you. It has been estimated that about 70% of programming effort is put into the maintenance of old code, and the rest into the development of new code. It is safe to assume that, should you do some programming in your career, you will be needing to modify someone else's code to fix an old bug or to extend the code's functionality. Commenting exists to help those unfortunate programmers who have to look at the code months or years after it was written. When you write comments for your code, keep that in mind and include useful information rather than details that are plainly obvious. The future programmers will know the language; you don't need to explain what "i ≤ j" means! Instead, explain why it's important that this condition be checked at this point in the code. Do you understand the difference?
As an example, let's imagine that you're going to write a subprogram that searches a list of earthquake intensities to find the most powerful quake. I am not going to show any code for this routine; this is intentional! The internal block comment is meant to give an overview of the construction and operation of the routine. If the reader wants more detail, he or she can move on to read the code, which will have its own comments about the code itself.
A Bad Internal Block Comment
Here's our first example of a block comment for our earthquake intensity search routine. This is not an actual example from a student program, but it does (I hope!) capture most of the mistakes students make when they wait until the last minute to write a comment:
/*---------------------------------------------------------------------
| Method FIND_BIGGEST_QUAKE
|
| Purpose: Find the biggest earthquake.
|
| Pre-condition: Earthquakes are available.
|
| Post-condition: We found the biggest one.
|
| Parameters:
| quakeList -- the quakes
| size -- size of the list
|
| Returns: The biggest quake
*-------------------------------------------------------------------*/
What's wrong with this comment? Most everything! Where to start?
- The description of the purpose of the function is useless; we could have figured as much from the name of the method alone! What we really need to know is exactly what job this method performs. For instance, it would be really nice to know what "biggest" means in this context. Largest measure on the Richter Scale? Most damage caused?
- Pre- and Post-conditions are supposed to tell us what needs to be true before (Pre-) and after (Post-) this method executes. They need to be clear and unambiguous, not wishy-washy. These are wishy-washy.
- The structure of the quake_list parameter is not even mentioned.
- How is the list size measured? By number of items or by index position of the last item?
- Exactly what about the biggest earthquake is being returned? Its position in the list? Its measured size? The entire entry from the list?
Again, the point is that anyone reading this comment will have learned almost nothing about this method. You are forcing the reader to wade through the code to learn anything of substance.
A Good Internal Block Comment
Compare the first attempt to this one:
/*---------------------------------------------------------------------
| Method FIND_BIGGEST_QUAKE
|
| Purpose: Identify the earthquake from the list of earthquake
| intensities (quakeList) that has the largest magnitude.
| It is assumed that the given list of quake intensities is
| an array-based list of unordered Richter Scale
| magnitudes; this function performs a simple sequential
| search through the array to locate the position of the
| largest magnitude (the largest value) in the list.
|
| Pre-condition: quakeList holds 1 or more intensities; the
| intensities are in no particular order; numEntries holds
| the exact number of entries currently in the list.
|
| Post-condition: quakeList and numEntries are unchanged; the
| list position of the entry with the largest magnitude has
| been identified; the position is within the boundaries
| of the array.
|
| Parameters:
| quakeList -- the array of earthquake magnitudes. This
| is an array of real numbers; the first magnitude
| is assumed to be at index 0.
| numEntries -- the quantity of magnitudes in quakeList.
|
| Returns: The index (position) of the largest earthquake
| magnitude in the quakeList array.
*-------------------------------------------------------------------*/
Java Style Guidelines
Here are guidelines for writing Java programs in this course.
Put spaces on both sides of arithmetic operators.
// Incorrect
a=(b*4+7.5/c);
// Correct
a = (b * 4 + 7.5 / c);
The keywords if, else, for, do, and while are always followed by a space. Put a space between a closing parenthesis and an opening brace. When a closing brace is on the same line as an else, follow it with a space.
// Incorrect
if(a < b){
for(int i = 0; i < 10; i++){
j += i * a;
}
}else{
j = b * 9;
}
// Correct
if (a < b) {
for (int i = 0; i < 10; i++) {
j += i * a;
}
} else {
j = b * 9;
}
Do not put spaces after an opening parenthesis or before a closing parenthesis:
// Incorrect
for ( int i = 0; i < 5; i++ ) {
sum = ( sum + i ) * Math.sqrt( 2 );
}
// Correct
for (int i = 0; i < 5; i++) {
sum = (sum + i) * Math.sqrt(2);
}
There are several ways of placing braces in your Java source code. One thing they all have in common: closing braces are always the first non-whitespace character on a line. They are never placed at the end of a line:
// Incorrect
if (a < b) {
result = 22; }
else
result = 99; }
Any of these are correct; the book we are currently using uses the third style:
// Correct
if (a < b) {
result = 22;
} else {
result = 99;
}
// Correct
if (a < b)
{
result = 22;
}
else
{
result = 99;
}
// Correct
if (a < b) {
result = 22;
}
else {
result = 99;
}
Always enclose the body of an if clause, else clause, or loop in braces, even when there is only one statement in the body:
// Incorrect
if (a < b)
result = 22;
else
result = 99;
for (int i = 0; i < 7; i++)
result += i * i;
// Correct
if (a < b) {
result = 22;
} else {
result = 99;
}
for (int i = 0; i < 7; i++) {
result += i * i;
}
You may indent either two or four spaces, and you may use the TAB character instead of spaces. You have to be correct and consistent in your indenting and placement of braces. Note how the if-else-if chain is aligned in the correct example:
//Incorrect
if (a < b) {
if (c >= d) {
result = 2;
} else if (e == f)
{
result = 99;
}
}
//Correct
if (a < b) {
if (c >= d) {
result = 2;
} else if (e == f) {
result = 99;
}
}
Variable names begin with lower case letters. If you have a multi-word variable name, prefer camelCase to snake_case. If you have a final (constant), use all upper case for its name, and, if it is a multi-word name, use SNAKE_CASE. Names of Java classes begin with a upper case letter:
// Incorrect
class example {
int Counter;
double unitprice;
final double salestaxrate = 0.075;
// ...
}
// Correct
class Example {
int counter;
double unit_price; // acceptable
double unitPrice; // preferred
final double SALES_TAX_RATE = 0.075;
// ..
}
Put only one declaration per line:
// Incorrect
double cut, clarity, caratWeight, color;
// Correct
double cut;
double clarity;
double caratWeight;
double color;
Limit line length to 75, no more than 79, characters. Many IDEs will let you display a “line length marker” and set its limit. They might also show the current column number in the status bar at the bottom of the editor window.
Prefer multiple println() calls to one print() or println() with multiple \n:
// difficult to read and edit
System.out.print("Weight: " + weight + "\nVolume: " + volume + "\nSurface Area: " + area + "\n");
// better
System.out.println("Weight: " + weight);
System.out.println("Volume: " + volume);
System.out.println("Surface Area: " + area);
If you break a formula across lines, you can break with the operator at the end of a line or beginning of the next line. Just be consistent.
// Either of these is correct
double first = (weight * volume) / (length + width / 2 *
height * height);
double second = (weight * volume) / (length + width / 2
* height * height);
The code tells you what the program does. Comments should tell you why or how. (The book will often have “what” comments because the book has to explain what a concept is.)
// "what" comment
month += 1; // add one to month
// "why" comment
/* System returns 0-11 for January-December,
* but people expect months to be 1-12.
*/
month += 1;
The exception to this guideline is the comments at the start of your program. These must have your name, the date, and a description of the purpose of the program. The description must be clear enough that someone who has not read the assignment will understand what the program does. These comments are incorrect:
/*
* Assignment 3
* J. Fulano - Oct 4, 2525
*/
/*
* Program uses if statements
* and while loops.
* J. Doe - Oct 4, 2525
*/
This one is correct:
/*
* Ask user to enter a positive integer, and print out whether
* that integer is prime or not.
* Program does this repeatedly until user enters zero as input;
* negative integers give an error message.
* J. Doe - Oct 4, 2525
*/
Avoid break and continue whenever possible; instead, carefully think through the loop condition. Do not use while (true) with break to substitute for thinking through the correct condition! Consider the following code to read into an array until it is full or the user enters zero:
// Very bad style
final int MAX = 4;
int [] ages = new int[MAX];
int value = -1;
int count = 0;
while (true) {
System.out.print("Enter age or 0 to quit: ");
value = input.nextInt();
if (value == 0) {
break;
}
ages[count] = value;
count++;
if (count == MAX) {
break;
}
}
// better
final int MAX = 4;
int [] ages = new int[MAX];
int value = -1;
int count = 0;
while (value != 0) {
System.out.print("Enter age or 0 to quit: ");
value = input.nextInt();
if (value != 0) {
ages[count] = value;
count++;
if (count == MAX) {
break;
}
}
}
// best
final int MAX = 4;
int [] ages = new int[MAX];
int value = -1;
int count = 0;
while (count < MAX && value != 0) {
System.out.print("Enter age or 0 to quit: ");
value = input.nextInt();
if (value != 0) {
ages[count] = value;
count++;
}
}
Do not put a space between the method name and the parameter list.
// Incorrect
static double cube ( double value ) {
return value * value * value;
}
// ...
double result = cube ( 12.0 );
// Correct
static double cube(double value) {
return value * value * value;
}
// ...
double result = cube(12.0);
It is a good idea to put comments before a method that describes the method’s purpose, inputs, and return value (if any):
/*
* Calculate monthly payment on a loan, given:
* principal: amount of the loan
* interestRate: annual percentage rate as a decimal (0.075 for 7.5%)
* years: number of years of the loan
* returns the monthly payment amount of the loan
*/
static double payment(double principal, double interestRate, int years) {
//...
}
When lining up output, prefer spaces and specific formatting over tabs:
// OK
System.out.printf("Height (cm):\t\t%.2f\n", height);
System.out.printf("Weight (kg):\t\t%.2f\n", weight);
System.out.printf("Blood alcohol:\t%.3f%%\n", bac);
Height (cm): 160.30
Weight (kg): 50.40
Blood alcohol: 0.032%
// Better
System.out.printf("Height (cm): %6.2f\n", height);
System.out.printf("Weight (kg): %6.2f\n", weight);
System.out.printf("Blood alcohol: %7.3f%%\n", bac);
Height (cm): 160.30
Weight (kg): 50.40
Blood alcohol: 0.032%