Learn Java Easy. Chapter 7 Exercises

Chapter 7 Exercises Chapter 7 Exercises Exercise 1. Create an array that contains the numbers from 0 to 9. Then make them display on the screen in reverse order. Solution: public class Main { public static void main(String[] args) { int a[] = new int[10]; for (int i=0;i<=9;i++) { a[i] = i; } for (int … Read more

Did you like it? Don’t keep it to yourself — share it like juicy gossip! 😏

Learn Java Easy. Chapter 7. Rich’s Cousin’s Visit. Random Arrays

Chapter 7 Exercises – Rich’s Cousin’s Visit. Random Arrays Chapter 7. Rich’s Cousin’s Visit. Arrays Today I received an unexpected visit. I’m still a bit stunned. Around 12 in the morning, a prison guard came to get me and took me to the visiting room. I thought it would be my mother or maybe the … Read more

Did you like it? Don’t keep it to yourself — share it like juicy gossip! 😏

Learn Java Easy. Chapter 6 Exercises

🎲 Random Number Exercises in Java | Solved Topic 6 Topic 6 Exercises Exercise 1. Create a program that calculates the roll of twenty dice and the sum of the results. Solution: public class Main { public static void main(String[] args) { int sum =0; //First we will create a loop for the 20 dice. … Read more

Did you like it? Don’t keep it to yourself — share it like juicy gossip! 😏

Learn Java Easy. Chapter 6. Helping Bud. Random Numbers

Chapter 6: Helping Bud and Using Random Numbers in Java Chapter 6. Helping Bud. Random Numbers I have news from my lawyer and it is not good at all. My computer was used to access a criminal website that provided services to hack the security systems of companies. But that’s not all, this software is … Read more

Did you like it? Don’t keep it to yourself — share it like juicy gossip! 😏

Learn Java Easy. Chapter 5 Exercises

🔁 Java Loop Exercises Solved Step by Step | Topic 5 Topic 5 Exercises Exercise 1. Create a program that shows multiples of 5 between numbers 0 and 100 using a for loop. Solution: public class Main { public static void main(String[] args) { //We create a for loop //i = 0 since it’s our … Read more

Did you like it? Don’t keep it to yourself — share it like juicy gossip! 😏

Learn Java Easy. Chapter 5. Meeting Bud. Learning to use loops

Chapter 5: Meeting Bud and Learning Loops in Java Chapter 5. Meeting Bud. Learning to use loops I can’t stop thinking about how quickly life can change. Fernando and Rich have been quite lucky, but I haven’t been so fortunate. It seems that the police have found something on my computer, although they haven’t specified … Read more

Did you like it? Don’t keep it to yourself — share it like juicy gossip! 😏

Learn Java Easy. Chapter 4 Exercises

🧩 Practical Exercises with Conditionals in Java | Topic 4 Topic 4 Exercises Exercise 1. Write a day of the week on the keyboard and, depending on which one it is, we will show the activity that we have to do. The activities are: Yoga, Biking, Gym, Painting and Reading. Solution: import java.util.Scanner; public class … Read more

Did you like it? Don’t keep it to yourself — share it like juicy gossip! 😏

Learn Java Easy. Chapter 4. Spending Time at the Police Station / Working with Conditionals

Chapter 4: Working with Conditionals Chapter 4. Hanging Out at the Police Station / Working with Conditionals I don’t know how it happened, but I am at the police station. Specifically, locked in a room with Rich and his friend, who, by the way, is named Fernando. The story is quite simple to tell, although … Read more

Did you like it? Don’t keep it to yourself — share it like juicy gossip! 😏

Learn Java Easy. Chapter 3 Exercises

🎯 Exercises: Keyboard Input in Java | Topic 3 Topic 3 Exercises Exercise 1. Create a program where we can input an integer and then display it on the screen. Remember to import the Scanner class: import java.util.Scanner; Solution: Scanner exercise = new Scanner(System.in); System.out.println(“Enter a number”); int a = exercise.nextInt(); System.out.println(“The entered number is: … Read more

Did you like it? Don’t keep it to yourself — share it like juicy gossip! 😏

Learn Java Easy. Chapter 3. Rich’s Friend / Keyboard Data Input

Chapter 3: Rich’s Friend / Keyboard Data Input Chapter 3. Rich’s Friend / Keyboard Data Input Two days have passed since the party and it’s time to clean up. It can’t be said that it’s one of my favorite activities, but this time there’s no other option. I can’t stop thinking about how lucky Chani … Read more

Did you like it? Don’t keep it to yourself — share it like juicy gossip! 😏