Posts by Marcio.Rezende • 217 points
9 posts
-
0
votes2
answers530
viewsA: How to make an SQL query with some blank criteria?
One way to achieve this is: select codigo, despesa, data, estabelecimento, valor from financeiro where codigo = 603 and LTRIM(RTRIM(estabelecimento)) = '' So if you have spaces you will also be…
-
2
votes2
answers1983
viewsQ: Based on a date, know what is the week of the year
Considering that 1 year has 12 months and that each month has 30 days (same February), and that 1 January belongs to week 1 and 30 December to week 52, create a method that when receiving a date (in…
javaasked Marcio.Rezende 217 -
2
votes2
answers140
viewsQ: Public method where a date is passed as a parameter, a parameter only
I need to create a public method called mostraData where a date is passed as a parameter (a parameter, not a separate day, month and year) and the date is returned in the following format: dd / mm…
-
0
votes1
answer2443
viewsQ: Battleship Java
Good morning, you guys, I’m doing an exercise in java on the game Battleship, I have a good part of the code but I’m locked on the part of validating the position of the boats. The exercise asks…
-
0
votes1
answer793
viewsQ: Code structure problem within switch case
When choosing option 1 (easy) the program enters case 1 correctly, but when I choose the port (0, 1 or 2) it goes back to the menu, the goal is that if the port is the right one it passes to the…
-
3
votes2
answers7097
viewsA: How to create a trigger in Mysql?
delimiter // CREATE TRIGGER nomedoTrigger after INSERT ON usuario_voto FOR EACH ROW BEGIN Aqui você coloca a estrutura do trigger. END // delimiter ; I think you should create a variable that takes…
-
-1
votes1
answer6781
viewsQ: How to sum the values of each row of a matrix?
How to sum the values of each row of a matrix and store the sum in one array? Example: 3 3 3 2 3 4 2 2 2 Results in: 9 9 6
-
0
votes1
answer263
viewsQ: Set of 3 Java ports
I have to do an exercise in Java that consists in creating a matrix [3][3] and each line would be a phase of the game. The user should guess which door the prize is in. For this I need to make a…
-
1
votes2
answers1044
viewsQ: How to invert the values of the main diagonal of a 5x5 matrix?
Input example: 1 3 6 8 7 3 7 8 0 3 2 4 3 6 7 8 9 1 3 5 5 6 7 8 5 Output example: 5 3 6 8 7 3 3 8 9 3 2 4 3 6 7 8 0 1 7 5 5 6 7 8 1 I have so far this: BufferedReader in = new BufferedReader(new…