If you’re learning Java for the first time, you already know enough to build a virtual pet 🐾 This week’s lab: name your pet, start it at 100 energy, and track how sleep, exercise and meals change it. The trick? Only full blocks count, and Java’s int division handles that for you. 45 minutes of sleep ÷ 10 = 4 full blocks. Not 4.5. Java drops the decimal, and that’s exactly what we want. Try it yourself: what numbers get your pet to exactly 100 energy? Drop them in the comments 👇 The full lab and a free lecture series are on learn.java. New lecture every Monday, lab solution every Friday. • • •
#java #learnjava #computerscience #learntocode computer science csstudents programming coding programming for beginners