Practice Assignments | CodeHS
https://codehs.com/practice/java • 338 KB fetched Open original page
Practice Assignments | CodeHS
Toggle navigation
*
Products
Elementary | Middle
CodeHop
Standards aligned coding for districts
Tynker
Gamified coding and apps
Typing
Easy to use typing for schools
Middle | High
CodeHS Pro
Comprehensive CS platform
Certifications
Industry based credentials for CTE
Cyber Range
Interactive environment for cybersecurity labs
AI
AI Creator
Easily create lessons with AI
Vibe Coding
Guided AI coding for students
Bool
AI coding and prototyping
Use Cases
Districts
Schools
Teachers
View All Products
*
Products
Explore what CodeHS has to offer for districts, schools, and teachers
*
Elementary | Middle
*
CodeHop Standards aligned coding for districts
*
Tynker Gamified coding and apps
*
Typing Easy to use typing for schools
*
Middle | High
*
CodeHS Pro Comprehensive CS platform
*
Certifications Industry based credentials for CTE
*
Cyber Range Interactive environment for cybersecurity labs
*
AI
*
AI Creator Easily create lessons with AI
*
Vibe Coding Guided AI coding for students
*
Bool AI coding and prototyping
*
Use Cases
*
Districts Comprehensive solutions for districts
*
Schools Tools and resources for schools
*
Teachers Empower educators in the classroom
*
View All Products
*
Platform
Teaching
Assignments
Create & configure your course assignments
Classroom
Manage & organize your class
Grading
Streamline your grading workflow
Academic Integrity
Build a culture of honesty in your classroom
QuizBuzz
Run gamified, interactive quizzes with your class
Tools
Data
Track & analyze student progress data
Write Code
Write, run, & debug code in a web-based IDE
Integrations
Connect CodeHS to your district's platform
AI Tools
The most complete AI toolkit in CS education
LOGIC
Measure student growth with pre- & posttests
*
Platform
*
Assignments
Create & configure your course assignments
*
Classroom
Manage & organize your class with customizable settings
*
Grading
Streamline your grading workflow.
*
Data
Track & analyze student assessments & progress data
*
Write Code
Write, run, & debug code all in a web-based IDE
*
Integrations
Connect CodeHS to your district’s educational platform
*
AI Tools
The most complete AI toolkit in CS education
*
Academic Integrity
Build a culture of honesty in your classroom
*
QuizBuzz
Run gamified, interactive quizzes with your class
*
LOGIC
Measure student growth with pre- & posttests
*
Curriculum
Computer Science Curriculum
Customizable K-12 CS curriculum
Overview
Course Catalog
* AP Courses
* AI Courses
* Interdisciplinary
* Spanish Courses
* AI Literacy
* Digital Literacy
* Cybersecurity
K-12 Pathways
* Elementary School
* Middle School
* High School
Standards
States
Supplemental
* Practice
* Tutorials
* Digital Textbooks
*
Curriculum
Customizable K-12 Computer Science Curriculum
* Course Catalog
*
* AP Courses
* Interdisciplinary
* AI Courses
* Spanish Courses
* AI Literacy
* Digital Literacy
* Cybersecurity
* K-12 Pathways
*
* Elementary
* Middle School
* High School
* States
* Standards
* Practice
* Tutorials
* Digital Textbooks
*
Professional Development PD
Professional Development
Online & in-person training to help teachers grow.
Overview
Online PD Courses
In-Person & Virtual Workshops
AI PD
Free PD Events
PD Cohorts
Teacher Certification Prep
Microcredentials
PD Membership
*
Professional Development
Online & In-Person Training for Teachers
* Professional Development
* Online PD Courses
* In-Person & Virtual Workshops
* AI PD
* PD Cohorts
* Free PD Events
* Teacher Certification Prep
* Microcredentials
* PD Membership
*
Online IDE
Online IDE
Write, run, & debug code right in your browser — no setup required.
Overview
Explore our languages
* JavaScript
* Python
* Java
* C++
* SQL
* HTML
* Tracy
* Blocks
* p5.js
Start a new project
Open a blank sandbox in any language.
New project
*
Online IDE
Write, Run, & Debug Code in an Online IDE
* Online IDE
* JavaScript
* Python
* Java
* HTML
* C++
* SQL
* Karel
* Tracy
* Blocks
* p5.js
*
Resources
Company
About
Learn about the CodeHS mission
Privacy Center
Our privacy & security practices
Case Studies
How schools succeed with CodeHS
Testimonials
What educators say about CodeHS
Community
Read Write Code Blog
News & stories from CodeHS
Coding in the Wild
Real world coding stories
CodeHS on X
Posts & highlights from our feed
Student Projects
Explore projects built by students
Explore
States
CS resources for your state
Knowledge Base
Help articles & how-tos
Career Center
Explore careers in tech
*
Resources
* About
* Privacy Center
* Case Studies
* States
* Testimonials
* CodeHS on X
* Read Write Code Blog
* Coding in the Wild
* Knowledge Base
* Student Projects
* Career Center
*
*
Request a Quote
* Log In
*
Sign Up
New Sandbox Program
Click on one of our programs below to get started coding in the sandbox!
Java
JavaScript
Python 3
HTML
Karel
Turtle
View All
CodeHS Practice Problems
Get familiar with coding using our Practice Problems.
Languages
Java
Javascript
Python
C++
SQL
Java
Practice Problems
Basics
LEVEL 1
Area of a Circle w/ Radius
Square a Double Type
Cube of a Number
Weight of a Car Carrier Trailer
Purchase Calculator
Address Number Combinations
Area of a Triangle
Print a Greeting
Cupcake Calculator
Sum of Two Numbers
Sum of Even Numbers
Strings
LEVEL 1
Add Three Strings
Screaming
Double Phrase
Lowercase
Find the Key
Find the Key, Part 2
Salutation
**emphasize**
Combine Two Strings
Bake the Cake Name!
Reverse a String
Count Successful Free Throws
Math
LEVEL 1
Sum Numbers
Product Range
Average
Area of a Circle w/ Diameter
Area of a Trapezoid
Celsius to Fahrenheit
Shooting Percentage
Find Product
Basic Math Operation
Spring Tulips
Sum of Two Numbers
Booleans
LEVEL 1
Is Divisible
At Capacity
Heart Rate
Enough Paint
Sum Evens
Nums in Order
isEven
Password Length
Can we Make it?
Boolean Check
Soccer Goal Check
Simple Calculator
Check Even or Odd
Check Movie Eligibility
Early Dismissal Check
Arrays
LEVEL 1
Array First Element
Array Last Element
Array Middle Element
Password Mask
Countdown Timer
Creating an Array
Initializing an Array
Array Sum
Array Multiply
Find Min Value
Sum of Array Elements
Coin Counter
Count Vowels in a String
Total Bases Calculator for At Bats
Sum of Array Elements
2D Array
LEVEL 1
Sum All
isSquare
Multiplication Table
Value in Row
Max Value
2D Array Creator
Checkers
Sum a 2D Array
ArrayLists
LEVEL 1
ArrayList First Element
ArrayList Last Element
ArrayList Middle Element
Initializing an ArrayList
ArrayList Sum
ArrayList Multiply
Java: Sum of ArrayList Elements
Basic ArrayList Operations
ArrayList Basics
Finding the Maximum in an ArrayList
Strings
LEVEL 2
Make even
Like Totally Awesome
Replace Meat
Find the Second Instance
A or An?
Switch the Words
Reverse the String
Just First and Last
String Manipulation
Soccer Player Initials
Reverse a String
Math
LEVEL 2
Repeat Last 2 Characters
Digit of Square Root of 2
Effective Field Goal Percentage
True Shooting Percentage
Payday
Monthly Pay
Factorial Calculation
Weight Conversion: Ounces to Pounds
Calculate the Area of a Circle
Booleans
LEVEL 2
Tax Rate
Lucky 13
Enough Paint 2
Multiple A's
Contains Vowels
How Tired Am I?
Construction Site Safety Check
Theme Park Ride Eligibility
Boolean Expression Evaluation
Arrays
LEVEL 2
Array Max
Array Min
Array Average
Reverse Array
Array Swap First Last
Array Repeat
Array Search
Alien Signal Strength Detector
2D Array
LEVEL 2
Invert Array
Reverse
Split
Team +/-
Magic Square
Consecutive Values
Find Maximum
Weekly Weather Report
Sum of Row Elements
ArrayLists
LEVEL 2
ArrayList Max
ArrayList Min
Reverse ArrayList
ArrayList Swap First Last
ArrayList Repeat
ArrayList Element Repeat
ArrayList Search
Basketball Team's Highest Scorer
Filtering Even Numbers
Movie Night Genre Counter
Adding and Accessing Elements
Recursion
Reverse String
Binary Search
Greatest Common Divisor
Least Common Multiple
Recurring Letters
Sum
Sum of Array Using Recursion
Magic Mirror Word Reverser
Recursive Factorial Calculation
String
More Karel Letters
Valid Password
How many Dogs?
Replace All Plates
Count Your Spaces
Start with a Capital
Even Up, Odd Down
Strings
LEVEL 3
Fix the Bad Apples
Replace Like
Split the String
Double a Word
Finding a Word
Palindrome Checker
Reversing a String
Initials
Nickname Maker
Reverse a String
Objects
LEVEL 1
Getting the Width
Update the Circle
Area of a Triangle
Max Student
Create a Room
Increase the Radius
Cake Class
Pet Object Printer
Creating a Simple Object in Java
Objects
LEVEL 2
Create a Class
Only Blue
Turtles are Pets Too!
Animal Sounds
Test average
Words
Car Speed Tracker
Creating a Simple Car Object
Arrays
LEVEL 3
Shift Elements to the Left
Compute Mode
All Cats
Consecutive Pairs
Duplicates
Count Evens
Longest Bird Name
ArrayLists
LEVEL 3
Average Value
Shift Elements to the Right
Compute Mode
All Dogs
Consecutive Pairs
Duplicates
Count Odd
Longest Bird Name with ArrayLists
CodeHS Practice FAQ
Still have questions? We’re happy to answer them, just reach out to [email protected] !
What is a CodeHS Practice problem?
CodeHS Practice is a curated list of practice problems to help students gain a stronger understanding of basic programming skills. Each Practice problem is autograded meaning students' code will be run through a series of Test Cases to ensure that their code is functionally and stylistically sound, and accomplished the goals of a given exercise.
Who can access CodeHS Practice problems?
Anyone can access the CodeHS Practice problems for free—no CodeHS account required! Simply go to codehs.com/practice and start coding. Note: If you want to track progress, you’ll need to create a CodeHS account.
What programming languages are available?
CodeHS Practice has the most robust coding problems in a variety of programming languages including:
* JavaScript
* Java
* Python
* C++
* SQL
What are the different types of practice problems?
We offer two types of practice problems.
Coding Practice - Students write code for a single method or function that should match the expected output.
Parsons Problems - Students drag the lines of code into the correct order to match the expected output.
What do the status colors mean?
Grey/Unopened - the student has not yet opened the activity
Yellow/Started - the student has opened and worked on the activity, but has not completed it
Green/Completed - the student has completed the exercise
What do the points mean?
The point value for each problem indicates the difficulty level. (1 = easy; 10 = difficult). You can see the points by hovering over the dot next to the exercise.
Products
* All Products
* Coding LMS
* Online IDE
* CodeHS Pro
* CodeHS Free
* Computer Science Curriculum
* Certifications
* Professional Development
* AI Creator
* Typing
* Cyber Range
Plans
* CodeHS Pro
* Start for Free
* Get a Quote
Use Cases
* District
* Schools
* Teachers
* CTE
Platform
* Assignments
* Classroom Management
* Grading
* Data
* Write Code
* Integrations
* AI Tools
* Academic Integrity
Curriculum
* Course Catalog
* Project Catalog
* K-12 Pathways
* AP Courses
* Elementary
* State Courses
* Spanish Courses
* Standards
* Hour of Code
* Practice
* Tutorials
* Digital Textbooks
* AP CSA Hub
* AI Curriculum
* Digital Literacy Curriculum
PD
* Online PD Courses
* In-Person PD Workshops
* Virtual PD Workshops
* Free PD Workshops
* PD Cohorts
* Teacher Certification Prep
* Microcredentials
* PD Membership
Programming Languages
* New Sandbox Program
* Javascript
* Python
* Java
* HTML
* C++
* SQL
* Karel
Resources
* Why Computer Science
* Why Cybersecurity
* Why Learn AI
* Why Digital Literacy
* Back to School Checklist
* Case Studies
* States
* Testimonials
* Tweets
* CodeHS Blog
* Read Write Code Book
* Knowledge Base
* Webinars
* Student Projects
* Career Center
* Student Alumni
CodeHS Has Everything
* AI
* Grading
* Differentiation
* Elementary
* Assessments
* Academic Integrity
* Online IDE
* Physical Computing
* AP Courses
* Vibe Coding
* Yes
Company
* About
* Team
* Careers
* Privacy Center
* AI Center
* Terms
* Privacy Policy
* Security
* Accessibility
Products
* All Products
* Coding LMS
* Online IDE
* CodeHS Pro
* CodeHS Free
* Computer Science Curriculum
* Certifications
* Professional Development
* AI Creator
* Typing
* Cyber Range
Plans
* CodeHS Pro
* Start for Free
* Get a Quote
Platform
* Assignments
* Classroom
* Grading
* Data
* Write Code
* Integrations
* AI Tools
* Academic Integrity
PD
* Online PD Courses
* In-Person PD Workshops
* Virtual PD Workshops
* PD Cohorts
* Teacher Certification Prep
* Microcredentials
Resources
* Why Computer Science
* Why Cybersecurity
* Why Learn AI
* Why Digital Literacy
* Back to School Checklist
* Case Studies
* States
* Testimonials
* Tweets
* CodeHS Blog
* Read Write Code Book
* Knowledge Base
* Webinars
* Student Projects
* Career Center
* Student Alumni
Use Cases
* District
* Schools
* Teachers
* CTE
Curriculum
* Course Catalog
* Project Catalog
* AP Courses
* Elementary
* State Courses
* Spanish Courses
* Standards
* Practice
* Tutorials
* Digital Textbooks
* AP CSA Hub
Programming Languages
New Sandbox Program
* Javascript
* Python
* Java
* HTML
* C++
* SQL
* Karel
CodeHS Has Everything
* AI
* Grading
* Differentiation
* Elementary
* Assessments
* Academic Integrity
* Online IDE
* Physical Computing
* AP Courses
* Vibe Coding
* Yes
Company
* About
* Team
* Careers
* Privacy Center
* AI Center
* Terms
* Privacy Policy
* Security
* Accessibility
CodeHS Certified Educators
CodeHS Educator Facebook Group
CodeHS Store
Links found on this page
- Products [direct]
- CodeHop
Standards aligned coding for districts [direct]
- Tynker
Gamified coding and apps [direct]
- Typing
Easy to use typing for schools [direct]
- CodeHS Pro
Comprehensive CS platform [direct]
- Certifications
Industry based credentials for CTE [direct]
- Cyber Range
Interactive environment for cybersecurity labs [direct]
- AI Creator
Easily create lessons with AI [direct]
- Vibe Coding
Guided AI coding for students [direct]
- Bool
AI coding and prototyping [direct]
- Districts [direct]
- Schools [direct]
- Teachers [direct]
- View All Products [direct]
- Assignments
Create & configure your course assignments [direct]
- Classroom
Manage & organize your class [direct]
- Grading
Streamline your grading workflow [direct]
- Academic Integrity
Build a culture of honesty in your classroom [direct]
- QuizBuzz
Run gamified, interactive quizzes with your class [direct]
- Data
Track & analyze student progress data [direct]
- Write Code
Write, run, & debug code in a web-based IDE [direct]
- Integrations
Connect CodeHS to your district's platform [direct]
- AI Tools
The most complete AI toolkit in CS education [direct]
- LOGIC
Measure student growth with pre- & posttests [direct]
- Overview [direct]
- Course Catalog [direct]
- AP Courses [direct]
- AI Courses [direct]
- Interdisciplinary [direct]
- Spanish Courses [direct]
- AI Literacy [direct]
- Digital Literacy [direct]
- Cybersecurity [direct]
- K-12 Pathways [direct]
- Elementary School [direct]
- Middle School [direct]
- High School [direct]
- Standards [direct]
- States [direct]
- Supplemental [direct]
- Tutorials [direct]
- Digital Textbooks [direct]
- K-12 Pathways [direct]
- Standards [direct]
- Tutorials [direct]
- Overview [direct]
- Online PD Courses [direct]
- In-Person & Virtual Workshops [direct]
- AI PD [direct]
- Free PD Events [direct]
- PD Cohorts [direct]
- Teacher Certification Prep [direct]
- Microcredentials [direct]
- PD Membership [direct]
- JavaScript [direct]
- Python [direct]
- Java [direct]
- C++ [direct]
- SQL [direct]
- HTML [direct]
- Tracy [direct]
- Blocks [direct]
- p5.js [direct]
- Karel [direct]
- About
Learn about the CodeHS mission [direct]
- Privacy Center
Our privacy & security practices [direct]
- Case Studies
How schools succeed with CodeHS [direct]
- Testimonials
What educators say about CodeHS [direct]
- Read Write Code Blog
News & stories from CodeHS [direct]
- Coding in the Wild
Real world coding stories [direct]
- CodeHS on X
Posts & highlights from our feed [direct]
- Student Projects
Explore projects built by students [direct]
- Knowledge Base
Help articles & how-tos [direct]
- Career Center
Explore careers in tech [direct]
- Request a Quote [direct]
- Log In [direct]
- Sign Up [direct]
- Java [direct]
- JavaScript [direct]
- Python 3 [direct]
|
|