Yodafied random numbers i have

This commit is contained in:
Sage Burger 2023-08-15 19:23:00 +02:00
parent 74ec2636b8
commit 642b642e47
2 changed files with 26 additions and 6 deletions

Binary file not shown.

View file

@ -1,7 +1,27 @@
public class App {
public static void main(String[] args) throws Exception {
System.out.println("Hello, World!");
}
}
import java.util.Random;
/* TEsts */
public class App {
public static void main(String[] args) {
System.out.println("A code request you have made,");
System.out.println("Fear not, for I am here to aid.");
System.out.println("In Java, a language so grand,");
System.out.println("I'll lend you a helping hand.");
// Creating a Random object
Random random = new Random();
// Define the range for x and y
int minRange = -1000;
int maxRange = 1000;
// Generate random values for x and y within the specified range
int x = random.nextInt(maxRange - minRange + 1) + minRange;
int y = random.nextInt(maxRange - minRange + 1) + minRange;
int sum = x + y;
System.out.println("The sum of " + x + " and " + y + " is: " + sum);
System.out.println("May the code be with you!");
}
}