Sprint challenges are a way for you to demonstrate that you have mastered the skills you learned this week. The sprint challenge will test you on each of the week's objectives. If you want to spend some more time preparing for the sprint challenge this week, below you will find a list of notes and challenges to give you more practice with the objectives we have covered.
The Sprint Challenge will assess your understanding of the key concepts covered in this unit's modules:
The challenge will involve practical coding tasks that require you to apply these concepts to solve real problems. You'll need to demonstrate your ability to write, test, and debug Java code using the tools and techniques covered in the modules.
// Variable declaration and initialization
int count = 10;
double price = 29.99;
String name = "Java";
// Arithmetic with type casting
double result = (double) count / 3; // 3.33... not 3
// String manipulation
String greeting = "Hello, " + name + "!";
String lowercase = greeting.toLowerCase();
boolean containsHello = greeting.contains("Hello");
// Console input/output
System.out.println("Enter your name:");
Scanner scanner = new Scanner(System.in);
String userName = scanner.nextLine();
System.out.println("Welcome, " + userName + "!");
Clone Project
Open the project with Github classroom, copy the url, and use git clone to bring it down to your machine.
Create Branches
Each Sprint should be worked on with a separate branch. It is recommended you branch off of main into a new branch, sprint-1, and complete all of the mastery tasks in order for sprint-1. When finished you may choose to merge sprint-1 onto main or not. Create a new branch off of either sprint-1 or main(only if you merged onto main) called sprint-2 for work on the second set of mastery tasks. Repeat for sprint-3.
Pushing Branches
Each Sprint should have its own branches. As you push changes, make sure they are being pushed to the correct branches on GitHub.
Here's a step-by-step guide to working on your sprint project:
# Clone the repository
git clone https://github.com/your-username/bd-java-fundamentals-project.git
cd bd-java-fundamentals-project
# Create a branch for sprint-1
git branch sprint-1
git checkout sprint-1
git add .
git commit -m "Complete Task 1: Add variable declarations"
git push --set-upstream origin sprint-1
When you're ready to move to the next sprint:
# Option 1: Create sprint-2 from sprint-1
git checkout sprint-1
git branch sprint-2
git checkout sprint-2
# Option 2: Create sprint-2 from main
git checkout main
git branch sprint-2
git checkout sprint-2