Code-Alongs - BD Unit 1 Sprint 2
Overview
Welcome to the code-alongs for BD Unit 1 Sprint 2! In these sessions, you'll work alongside instructors to apply the concepts you've learned in the modules. These hands-on exercises are designed to reinforce your understanding of classes, objects, design principles, conditionals, and exception handling.
Code-Along: Building a Library Management System
In this code-along, you'll build a simple Library Management System that demonstrates object-oriented programming concepts.
What You'll Build
You'll create a system with the following components:
- A Book class with properties for title, author, ISBN, and available status
- A Library class that manages a collection of books
- Methods for checking out and returning books
- Proper encapsulation and access control
- Exception handling for various error conditions
Key Concepts Applied
- Creating classes with instance variables
- Implementing constructors with validation
- Using proper access modifiers
- Defining methods that modify object state
- Object composition (Library has Books)
- Custom exceptions for domain-specific errors
Getting Started
To follow along with this code-along:
- Create a new Java project in IntelliJ IDEA
- Create a package called
library
- Create classes for
Book
,Library
, andBookNotFoundException
- Follow along with the video to implement the functionality
Code-Along: Creating a Banking Application
In this code-along, you'll develop a banking application that demonstrates conditional logic, enum types, and exception handling.
What You'll Build
You'll create a system with the following components:
- An Account class with different types (using enums)
- Methods for deposit, withdraw, and transfer
- Conditional logic for transaction approval
- Custom exceptions for insufficient funds
- Transaction history tracking
Key Concepts Applied
- Enum types for account categories
- Boolean expressions for transaction validation
- Conditional statements to control program flow
- Exception handling with try-catch blocks
- Custom exceptions for domain-specific errors
- Implementation of multiple classes that work together
Getting Started
To follow along with this code-along:
- Create a new Java project in IntelliJ IDEA
- Create a package called
banking
- Create classes for
Account
,Transaction
, andInsufficientFundsException
- Create an enum called
AccountType
- Follow along with the video to implement the functionality
Additional Resources
Prepare for the Sprint Challenge
After completing these code-alongs, you should be well-prepared for the sprint challenge. Make sure to review the following:
- Class design principles and proper encapsulation
- Implementation of constructors and methods
- Use of appropriate access modifiers
- Working with enums and conditional logic
- Implementing effective exception handling
- Creating custom exceptions for specific error scenarios
If you have any questions or need clarification on any concepts, please reach out to your instructor or peers for assistance before the sprint challenge.