SOLFIND
Web Lens
Portal home

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

  1. Products [direct]
  2. CodeHop Standards aligned coding for districts [direct]
  3. Tynker Gamified coding and apps [direct]
  4. Typing Easy to use typing for schools [direct]
  5. CodeHS Pro Comprehensive CS platform [direct]
  6. Certifications Industry based credentials for CTE [direct]
  7. Cyber Range Interactive environment for cybersecurity labs [direct]
  8. AI Creator Easily create lessons with AI [direct]
  9. Vibe Coding Guided AI coding for students [direct]
  10. Bool AI coding and prototyping [direct]
  11. Districts [direct]
  12. Schools [direct]
  13. Teachers [direct]
  14. View All Products [direct]
  15. Assignments Create & configure your course assignments [direct]
  16. Classroom Manage & organize your class [direct]
  17. Grading Streamline your grading workflow [direct]
  18. Academic Integrity Build a culture of honesty in your classroom [direct]
  19. QuizBuzz Run gamified, interactive quizzes with your class [direct]
  20. Data Track & analyze student progress data [direct]
  21. Write Code Write, run, & debug code in a web-based IDE [direct]
  22. Integrations Connect CodeHS to your district's platform [direct]
  23. AI Tools The most complete AI toolkit in CS education [direct]
  24. LOGIC Measure student growth with pre- & posttests [direct]
  25. Overview [direct]
  26. Course Catalog [direct]
  27. AP Courses [direct]
  28. AI Courses [direct]
  29. Interdisciplinary [direct]
  30. Spanish Courses [direct]
  31. AI Literacy [direct]
  32. Digital Literacy [direct]
  33. Cybersecurity [direct]
  34. K-12 Pathways [direct]
  35. Elementary School [direct]
  36. Middle School [direct]
  37. High School [direct]
  38. Standards [direct]
  39. States [direct]
  40. Supplemental [direct]
  41. Tutorials [direct]
  42. Digital Textbooks [direct]
  43. K-12 Pathways [direct]
  44. Standards [direct]
  45. Tutorials [direct]
  46. Overview [direct]
  47. Online PD Courses [direct]
  48. In-Person & Virtual Workshops [direct]
  49. AI PD [direct]
  50. Free PD Events [direct]
  51. PD Cohorts [direct]
  52. Teacher Certification Prep [direct]
  53. Microcredentials [direct]
  54. PD Membership [direct]
  55. JavaScript [direct]
  56. Python [direct]
  57. Java [direct]
  58. C++ [direct]
  59. SQL [direct]
  60. HTML [direct]
  61. Tracy [direct]
  62. Blocks [direct]
  63. p5.js [direct]
  64. Karel [direct]
  65. About Learn about the CodeHS mission [direct]
  66. Privacy Center Our privacy & security practices [direct]
  67. Case Studies How schools succeed with CodeHS [direct]
  68. Testimonials What educators say about CodeHS [direct]
  69. Read Write Code Blog News & stories from CodeHS [direct]
  70. Coding in the Wild Real world coding stories [direct]
  71. CodeHS on X Posts & highlights from our feed [direct]
  72. Student Projects Explore projects built by students [direct]
  73. Knowledge Base Help articles & how-tos [direct]
  74. Career Center Explore careers in tech [direct]
  75. Request a Quote [direct]
  76. Log In [direct]
  77. Sign Up [direct]
  78. Java [direct]
  79. JavaScript [direct]
  80. Python 3 [direct]