Please enable JavaScript to use CodeHS


AP Computer Science A Labs

Units

Unit Description
Receipt Lab: Students will write a program that incrementally builds the functionality to generate receipts, similar to those received from stores and restaurants. They will start with a simple snack bar receipt and later develop a more advanced version that collects user input to produce customized receipts. This lab can be used after Unit 1: Using Objects and Methods in Cortado, Unit 2: Using Objects in Nitro, and Unit 3: Methods in Mocha.
Magpie 2.0 Lab: Students explore the foundations of chatbot technology by learning about natural language processing (NLP) and analyzing different types of chatbot interactions. They then progressively build and refine a chatbot in Java, enhancing it with random responses, keyword detection, string transformation, and arrays to simulate increasingly sophisticated conversation behaviors. All but Activity 5 of this lab can be used after Unit 2: Selection and Iteration in Cortado, Unit 4: Iteration in Nitro, and Unit 2: Basic Java in Mocha. Activity 5, which includes arrays, can be used after completing basic array creation lessons.
Virtual Pet Lab: Students explore the design and implementation of a virtual pet by first analyzing existing digital pets and brainstorming desirable features. They then apply object-oriented programming principles in Java to design a VirtualPet class, implement and test methods for interaction and status management, and extend functionality through additional classes like Food and Game. Finally, students enhance their pet simulation with creative features such as health monitoring and environmental interactions, reinforcing class composition and encapsulation. This lab can be used after Unit 3: Class Creation in Cortado, Unit 5: Writing Classes in Nitro, and Unit 4: Classes and Object-Oriented Programming in Mocha.
Data Set Lab: Students explore how real-world data sets can be modeled, processed, and analyzed through programming. In this lab, they begin by reflecting on data collection, privacy, and reliability, then move on to building a Cereal class to represent entries from a cereal data set. They practice reading data from files into an ArrayList, create objects to store and organize that data, and write methods to analyze nutritional values. Additionally, students have the chance to extend their work by using JavaFX library to validate data quality and visualize patterns. This lab can be completed after Unit 4: Data Collections in Cortado, Unit 7: ArrayList in Nitro (with Using Text Files lesson from Cortado), Unit 5: Data Structures in Mocha (with Using Text Files lesson from Cortado).
2048 Lab: Students develop a complete version of the popular puzzle game 2048 by incrementally building its core functionality in Java. They begin by exploring the game mechanics and writing methods to place initial tiles on the board. Next, they implement movement logic to slide and merge tiles in all four directions while updating the score. Students then add a method to detect when the game is over and an optional feature to track and save high scores. Throughout the lab, they reinforce skills in 2D array traversal, control structures, and algorithmic problem-solving while applying object-oriented programming principles to manage game state and user interaction. This lab can be completed after Unit 4: Data Collections in Cortado, Unit 7: ArrayList in Nitro (with Using Text Files lesson from Cortado), Unit 5: Data Structures in Mocha (with Using Text Files lesson from Cortado).
Consumer Review Lab: The persuasive power of words can be seen in a variety of places such as entertainment, news, social media, and even reviews and comments. Students learn about sentiment value and how this can be used to construct or modify a review to be more positive or negative using String manipulation. This lab can be used after Unit 2: Selection and Iteration in Cortado, Unit 4: Iteration in Nitro, and Unit 3: Methods in Mocha.
Steganography Lab: Steganography is the practice of concealing messages or information within other non-secret text or data. Students explore the concepts of steganography and 2D arrays, hiding images or text inside of other images. This lab can be completed after Unit 4: Data Collections in Cortado, Unit 8: 2D Arrays in AP CS A (Nitro), Unit 5: Data Structures in AP CS A (Mocha).
Celebrity Lab: Students learn how to discuss class design as it relates to the game Celebrity, where a person or team tries to guess the name of a celebrity from a given clue or set of clues. This lab includes inheritance as the basis for one of the activities and also includes a Graphical User Interface. Note: this lab contains topics (inheritance) that are now considered out-of-scope for the AP CSA exam. In order to complete this lab, students will need to learn about those topics beforehand, in addition to completing the recommended units below. This lab can be completed after Unit 4: Data Collections in Cortado, Unit 9: Inheritance in AP CS A (Nitro), and Unit 4: Classes and Object-Oriented Programming in AP CS A (Mocha).
Elevens Lab: Students learn how to use Object-Oriented design to create a solitaire card game. At the end of the lab, students use a Graphical User Interface to play the game they create! Note: this lab contains topics (inheritance, abstract classes and methods, and interfaces) that are now considered out-of-scope for the AP CSA exam. In order to complete this lab, students will need to learn about those topics beforehand, in addition to completing the recommended units below. Students can complete this assignment after finishing Unit 4: Data Collections in Cortado, and Unit 6: Data Structures in AP CS A (Mocha).
Magpie Lab: Students learn how to use String methods and pattern matching to create a chatbot that they can have a conversation with. Students can complete this assignment after finishing Unit 3: Class Creation in Cortado, Unit 5: Writing Classes in AP CS A (Nitro) and Unit 4: Classes and Objects in AP CS A (Mocha).
Picture Lab: Students learn how to write methods to modify pictures and explore how images are stored in memory. This lab introduces concepts such as nested loops, interfaces, and inheritance. Note: this lab contains topics (inheritance and interfaces) that are now considered out-of-scope for the AP CSA exam. In order to complete this lab, students will need to learn about those topics beforehand, in addition to completing the recommended units below. This lab can be completed after Unit 4: Data Collections in Cortado, Unit 9: Inheritance in AP CS A (Nitro), or Unit 5: Data Structures in AP CS A (Mocha).
Battleship Lab: Students learn how to use Object-Oriented design to implement the board game Battleship. Students can complete this assignment after finishing Unit 4: Data Collections in Cortado, Unit 8: 2D Arrays in AP CS A (Nitro), Unit 5: Data Structures in AP CS A (Mocha).
Pokemon Simulation Lab: Students learn how to create a Pokémon battle game using Object-Oriented programming to implement Pokémon, trainers, and moves! Note: this lab contains topics (inheritance) that are now considered out-of-scope for the AP CSA exam. In order to complete this lab, students will need to learn about those topics beforehand, in addition to completing the recommended units below. Students can complete this assignment after finishing Unit 4: Data Collections in Cortado, Unit 9: Inheritance in AP CS A (Nitro), and Unit 5: Data Structures in AP CS A (Mocha).
Blackjack Lab: Students learn how to use basic data structures in Java including arrays, ArrayLists, 2-dimensional arrays, and HashMaps to create a game of Blackjack. Note: this lab contains topics (HashMaps) that are now considered out-of-scope for the AP CSA exam. In order to complete this lab, students will need to learn about those topics beforehand, in addition to completing the recommended units below. Students can complete this assignment after finishing Unit 4: Data Collections in Cortado, and Unit 7: ArrayLists in AP CS A (Nitro), Unit 5: Data Structures in AP CS A (Mocha).
Mad Libs Lab: Students learn how to write a program that allows users to create their own Mad Lib stories! Students can complete this assignment after finishing Unit 4: Data Collections in Cortado, Unit 7: ArrayLists in AP CS A (Nitro), and Unit 5: Data Structures in AP CS A (Mocha).