Home of real teaching & learning
  • Full support for teachers
  • Focus on critical thinking
  • Engaging classroom activities
  • Integrated student eBook
  • Assessed tasks / qBank
  • Practice exam questions

The InThinking Guarantee: Our sites are written by expert practitioners and not by AI

See our AI policy

Disclaimer: InThinking subject sites are neither endorsed by nor connected with the International Baccalaureate Organisation.

Don't miss out, find out!

B2.1 Broken Code challenges - Java

B2.1.1: Data Types & Variables/* Topic B2.1.1: Variables & Data Types CHALLENGE: We are calculating the area of a circle. But we get a "possible lossy conversion" error. You cannot store a decimal (double) inside an integer (int). Fix the data type of the 'area' variable. */ public class Main { public static void main(String[] args) { int radius = 5; double pi = 3.14159; int area = pi * radius * radius;...

Help