how do i find the values of A,B and C in java

given the following values X,Y,Z, such as (0≤X,Y,Z≤10000) with considering the following three equations : a+b+c = X abc = Y a^2 + b^2+ c^2 = Z i need to find values of a, b and c, I wrote …

Game Of Life game: Check 2D array 8 closest surroundings; ArrayIndexOutOfBoundsException issue

I have encountered this problem and i couldn’t find the solution. There is a 2D array with only zeros and ones in it (the size of the array doesnt really matter, i worked with 10×10). Zero means dead …

How do I fix it to output what I want to output?

I recently started coding in Java, I just started a week ago. The previous post was deleted because I did not specify it enough, I am sorry for that. I’ve been having troubles with for, do and while …

Trying to output 0 1 2 3 8 5 6 14 8 9 using a for loop in Java [closed]

This is what I have so far: for (int i = 0; i<= 9; i++){ int output = i; if (i % 4 == 0){ output *= 2; } System.out.print(output + &…

How do i pass variables into methods – java [closed]

I need to use a variable from one method in another. Here is the code: public static void secondMain() { BufferedReader reader; var lines = new ArrayList(); var …

How to Flip the triangle?

How to flip this triangle? So i was making aritmethic sequance triangle. It was upside down. How do I turn it 180 degree? for example: 1=1 1+2=3 1+2+3=6 etc… my code: package javaapplication4; …

How to Find Index of a Duplicate in An Array (Java)

For this programming assignment, we are supposed to find the index of a duplicate in this array for one row of a sudoku puzzle. I have this method, static boolean equals(int[] a, int[] a2): boolean …

Print out the numbers from the for loop

The Return type is void No input parameters Print out the numbers calculated results separated by a space using current number add the next number from 0 to (a+b). An example would be if the numbers …

How to combine two lists from the same relation in Java-8

I have below entities Manager and Colleague Manager Entity @Entity @Table(name = “Manager”) @Data public class Manager implements java.io.Serializable { @Id @Column(name = “id&…

Program ignoring the last row in the file in calculation

I have a text file with data that looks like this (TestData.txt): Name|Test1|Test2|Test3|Test4|Test5|Test6|Test7|Test8|Test9|Test10 John Smith|82|89|90|78|89|96|75|88|90|96 Jane Doe|90|92|93|90|89|84|…