← all categories
Java Basics
-
Fix the missing semicolon 1.1 🌶️
The program below is supposed to print "Hello, World!" but it has a bug! Try running it e…
-
Fix the wrong data type 1.2 🌶️
The program below is supposed to track whether it's raining and print that value. It does…
-
Declare a student record 1.2 🌶️
A student is taking 6 courses, has a GPA of 3.5, is currently enrolled, and is named Mari…
-
Fahrenheit to Celsius 1.2 🌶️
The program below is supposed to convert a Fahrenheit temperature to Celsius using the fo…
-
Print a phrase with quote marks 1.3 🌶️
Write code in the box so that the program prints the exact phrase: She said "Hello!" to m…
-
Print two lines with one statement 1.3 🌶️
Write code in the box that prints these two lines, using a single System.out.println stat…
-
Rectangle perimeter and area 1.3 🌶️
The program below gives you a rectangle's width and length, and its last two lines (locke…
-
Seconds to minutes and seconds 1.3 🌶️🌶️
The variable totalSeconds holds a length of time in seconds. The three locked lines at th…
-
Split a two-digit number 1.3 🌶️
The variable number holds a two-digit whole number. The two locked lines at the bottom pr…
-
Swap two values 1.4 🌶️🌶️
The program below gives first and second their starting values, and its last two lines (l…
-
Update an account balance 1.4 🌶️
The variable balance holds the amount in an account, deposit is a deposit being made, and…
-
Rotate three values 1.4 🌶️🌶️🌶️
The int variables first, second and third have starting values, and the three locked line…
-
Whole dollars 1.5 🌶️
The program below is supposed to figure out how many whole dollars are in a price, then p…
-
Round to the nearest whole number 1.5 🌶️🌶️
The variable temperature holds a positive temperature with a decimal part, like 71.6. The…
-
Round a negative number 1.5 🌶️🌶️
change holds a negative decimal number, like -3.6. The locked line at the bottom prints a…
-
printAverage 1.5 🌶️
The method below is supposed to calculate the average number of points scored per game an…
-
Average of four test scores 1.5 🌶️🌶️
test1, test2, test3 and test4 are four whole-number test scores. The locked line at the b…
-
Cash drawer 1.5 🌶️🌶️🌶️
A cash drawer has to make change. `cents` holds an amount of money in cents (41 means 41 …
-
Score updates 1.6 🌶️
score holds a player's starting points, and the locked line at the bottom prints the fina…
-
announcePurchase 1.9 🌶️
Write a void method named announcePurchase that takes two parameters: a String named item…
-
printTotalCost 1.9 🌶️
Write a void method named printTotalCost that takes three parameters: a String named item…
-
sumTwo 1.9 🌶️
Write a method that takes two int parameters, a and b, and returns their sum.
-
printTemperatureReport 1.9 🌶️
Write a void method named printTemperatureReport that takes one int parameter, celsius. U…
-
weightedSum 1.9 🌶️
Write a method that takes two int parameters, a and b, and returns a plus five times b. (…
-
averageThreeInts 1.9 🌶️🌶️
Write a method that takes three int parameters, a, b, and c, and returns their average as…
-
roundPositive 1.9 🌶️🌶️
Write a method that takes one positive double parameter, value, and returns it rounded to…
-
totalWithTip 1.9 🌶️🌶️
Write a method that takes two int parameters, billCents (a bill amount, in cents) and tip…
-
Scoreboard.reportBonus 1.9 🌶️
Below is a partially written Scoreboard class. It already has a method, bonusFor, that ad…
-
WeatherDesk.describeTemperature 1.9 🌶️🌶️
Below is a partially written WeatherDesk class. It already has two overloaded versions of…
-
BonusDesk.comboBonusReport 1.9 🌶️🌶️🌶️
Below is a partially written BonusDesk class. It already has two methods: addAmount(n, am…
-
circleArea 1.11 🌶️
Write a method that takes one double parameter, radius, and returns the area of a circle …
-
hypotenuseLength 1.11 🌶️
Write a method that takes the lengths of the two legs of a right triangle, legA and legB,…
-
absoluteDifference 1.11 🌶️
Write a method that takes two double parameters, a and b, and returns the absolute differ…
-
largerRoot 1.11 🌶️🌶️
Write a method that takes the three coefficients of a quadratic equation, a, b, and c (re…
-
compoundInterest 1.11 🌶️🌶️
Write a method that takes a double parameter principal (a starting amount of money), a do…
-
Fix cubeVolume 1.11 🌶️
The method below is supposed to return the volume of a cube with the side length `side`. …