Unit 5 Quiz Coming Soon!
Welcome to the 5th unit of AP Computer Science! We’ve covered a lot this semester – from Jeroos and basic Java programs, to control structures and object oriented design. Next on the list though is a new tool for storing information that will make it much easier to store large groups of data in just a few variables. For this, we’ll use something called arrays. Arrays are data structures in programming that have the following characteristics:
- They have a single name for the entire array (list)
- They can reference each spot individually
- They start counting their spots at ‘location 0’
- They all have a non-negative length
As we practice with arrays and try to do various things with them, we’ll need to be able to do a few very specific tasks:
- Create arrays with the values we want
- Recall or change the values within an array
- Print an entire array using a ‘for’ loop
- Traverse an array to look at each spot
Once we’ve tackled these skills, we’ll be able to use arrays for all sorts of good things!
Here in the first part of the unit, we need to get used to something called a 1-dimensional array. The 1-dimensional arrays act like lists where you can have multiple (potentially a lot) of values stored within a single variable. This array is great if you need to store a lot of grades for a single student, a lot of names for a single high school course, or a lot of prices for goods within a single store. The uses for 1-dimensional arrays are many, and to get started we need to know how to make them, how to change them, and how to use the elements inside them!
GRADING & PROCESS
Take a page of notes on Arrays and the ideas presented in the videos below and in class
Complete the 8 Java tasks about arrays
Complete 8 challenges in the Java -> String 3 section on codingbat.com
Have Mr. Benshoof check off your completed tasks
Traversing 1-Dimensional Arrays
Classes & Arrays
The second part of our unit is all about making parts of the program repeat. These "loops" can cause a section of the program to repeat itself a different number of times. One of the challenges is to use a loop that gives you the kind of control that you want.
The WHILE loop (sometimes called sentinel controlled repetition) uses a counter to keep track of how often the program has run. Once the counter (or another variable) reaches a threshold, the loop finally stops.
The FOR loop (sometimes called counter-controlled repetition) uses a variable to count the number of times the loop has repeated. Once the counting variable reaches its limit, the loop ends and the program continues.
These two looping structures are the focus of this part of the unit, and will be important tools throughout the rest of the year!
GRADING & PROCESS
Watch the videos on loops and looping control structures. Take a full page of notes on these topics as you watch them.
Complete Java Task 16: Even/Odd
Complete Java Task 17: Sum & Average
Complete Java Task 18: Odd Counter
Complete Java Task 19: Multiplication Chart
Complete Java Task 20: Random Grid
Complete Java Task 21: 12x12 Grid
Complete Java Task 22: Alternating Grid
Complete Java Task 23: Small Rectangle
Have Mr. Benshoof check-off your completed Java challenges
Complete the short Control Structures Assignment
Nested For Loops
The final part of our unit is to use the control structures we've studied to make a working Gradebook program! The gradebook you make needs to meet the criteria listed in the unit paperwork. Specifically:
- Let the user enter a variety of assignment types (at least 2: quizzes and homework).
- Let the user enter a variety of assignment grades
- Let the user enter the grades and assignments in any order
- When the user is done entering assignments, the program should tell them some information:
- How many assignments were listed for each type (how many quizzes, how many homeworks, etc)
- How many of the total list of assignments were A’s, B’s, C’s, D’s, or F’s
- What the average score (based on either points OR percentages… whichever you like best) on all assignments was
- Assuming the upcoming final would be worth 15% of the course grade (and all entered assignments were the remainder of the grade), what grade would the student need on the final to earn their desired course grade.
- The program should be relatively easy to use and easy to understand.
Part 1 Resources
Part 2 Resources
Part 3 Resources