Posts by Lucas Módolo • 524 points
20 posts
-
1
votes1
answer103
viewsA: Accessing List of another class
In the class builder Armazen, you are using this.produto and not this.produtos, because the variable declared in that class is produtos, and not produto. In his method of retornaProdutos in class…
javaanswered Lucas Módolo 524 -
1
votes1
answer27
viewsA: Can the main method already be written when creating a new class?
Yes, it is possible. At the time of class creation, in the creation options, you can select the main method to be written when creating it:…
-
2
votes1
answer39
viewsA: Handle 2 json files with Javascript
You can use the method Sort Example: let json = { "data":{ "json_2":[ { "id":145, "name":"Estevam" }, { "id":123, "name":"Lucas" } ] } } json.data.json_2.sort((a, b) => a.id - b.id)…
-
0
votes1
answer24
viewsA: Make the image height exactly the same as the article?
For that, use Flexbox .flex-container{ display: flex; align-items: center; } And also, don’t leave the image height as fixed.…
-
1
votes3
answers68
viewsA: print a variable int in C
This happens because you are trying to print &a, which is the memory address of the variable a. To print what you want, as in the following example, remove the &: printf("Variável: %d", a);…
canswered Lucas Módolo 524 -
0
votes1
answer140
viewsA: for i in range(0, int(num[pos])): Typeerror: 'int' Object is not subscriptable
In the code for i in range(0, int(num[pos])):, more specifically here: int(num[pos]), you are trying to access position 0 of an integer number, in case that number is your variable num. That mistake…
python-3.xanswered Lucas Módolo 524 -
1
votes1
answer29
viewsA: Tag "a" is ignoring the css style of the image
As soon as you add the a, the property height: 100% begins to refer to the size of the a, which has no set size. So, what I recommend you do is set the image size before, or create a div to separate…
-
4
votes1
answer70
viewsA: Score in Javascript output
This problem is happening because in your code is added the . only when size is 3 or 7: if (cpf.length == 3 || cpf.length == 7). And the - only when size is 11: else if (cpf.length == 11). In other…
javascriptanswered Lucas Módolo 524 -
0
votes2
answers34
viewsA: Error in Javascript loop
const array = [[09, 13, 19, 24, 29, 46],[07, 15, 24, 41, 48, 50]] for(let i = 0; i < array.length; i++){ for(let j = 0; j < array[i].length; j++){ console.log(array[i][j]) } } As you can see,…
javascriptanswered Lucas Módolo 524 -
0
votes2
answers42
viewsA: Why am I getting Undefined on the return of this function?
I believe it’s because you defined the variable finalPrice 2 times. Once at the beginning, and a second time before Return. In the case of the second time you should do without the var, only by…
-
2
votes1
answer303
viewsA: can’t get value from javascript input
You can take the value of input through the document.getElementById('numero').value. As you can see, the id must be the input, that part you did right, missed just put inside the function enviar.…
javascriptanswered Lucas Módolo 524 -
0
votes2
answers326
viewsA: Problems with pi approximation algorithm in C
#IND means an indeterminate form. What you have there is known as 'Not a number' or Nan for short. To quote Wikipedia, the generation of this is made by: Operations with one Nan as at least one…
-
0
votes1
answer51
viewsA: how to position image accurately
Do it this way in css: canvas{ margin-left: auto; margin-right: auto; display: block; }
-
1
votes1
answer75
viewsA: When executing the code below, a "Syntax: invalid syntax" Syntax error appears. I cannot identify the error
You forgot to close the parentheses on lines 8 and 10, and put a dot in place of the comma on line 26. With the changes made, your code would look like this: from math import pi, sin, cos from math…
-
9
votes2
answers262
viewsA: CRUD is an architecture standard?
Not, CRUD (acronym of the English Create, Read, Update and Delete) are the four basic operations (creation, query, update and destruction of data) used in relational databases (RDBMS) provided to…
-
0
votes2
answers72
viewsA: Python does not advance and does not present an error after converting string to float, how to resolve?
The error does not occur when trying to convert, the number is converted to float normally. The problem is in these 2 prints: print('NUMERO DE ENTRADA :'+temperatura) and print('temperatura…
-
0
votes4
answers573
viewsA: how to create a list of multiples of numbers of 3, from another list of numbers?
Use the function .append() .append() is a method that attaches an element to the end of the list. So, if you create a list and use .append(c), it will add the c at the end of the list. Your code…
-
2
votes1
answer125
viewsA: Add onclick event in javascript button
The problem is that at the time you were adding the function goBack at the botao, was done wrong, can’t use parentheses () after the function as you did botao.onclick = goBack();, if not the…
-
3
votes2
answers61
viewsA: How could I implement this code so that if I type "a" as 0 the program stops immediately and the message "END" appears?
Add an Else. Your code will look like this: def conta(x,y,z): return (a**b)+c a = int(input('Infome a: ')) if a == 0: print('FIM') else: b = int(input('Infome b: ')) c = int(input('Infome c: '))…
pythonanswered Lucas Módolo 524 -
0
votes3
answers55
viewsA: How to use mouse events to create enter/out effect without the German inside the selected element interfering
You have a css property for this, the property :Hover In case your code would look like this: .block:hover{ border:1px solid #666; }