Most voted "logic" questions
Use this tag when the question primarily involves logical sense in the development or processing of an information-based application that, related to each other, imply an objective within an established rule.
Learn more…376 questions
Sort by count of
-
0
votes1
answer584
viewsError comparing two strings with float value
Good afternoon! I am trying to compare numbers with Jquery, they are values with decimals or not. when the value goes up to 999 everything works perfectly, but above this does not work as it should.…
-
0
votes0
answers21
viewsRule with list completion in Prolog
I must follow the rule "The teacher cannot teach more than one subject at the same time", among others. Today I have rules: :- [fatos]. ministra(PROFESSOR, MATERIA):-…
-
0
votes2
answers1132
viewsFunctions and procedures in Portugol
About functions and procedures, I have a big doubt in this matter. I know that a function will always return data and that procedure has no return, but every function has to fill in all parameters?…
-
0
votes0
answers18
viewsC# - How to make the program run something in certain days after execution?
I have a project that to start the . exe requests the registration of a company, but, need to renew the license in order to continue using, in case, how do I perform some action asking the customer…
-
0
votes0
answers45
viewsDifficulties with Logic A
Well the scenario is the following I am trying to develop an electronic point through my application but I locked in the logic of authentication of the dates and hours of work following in the logic…
-
0
votes1
answer23
viewsFilter texts without wordpress formatting
How could I filter only the text, that is what are outside of the tags, the ones that are in the html tags I want to remain, I just don’t want the ones that are in these [/et_pb_text] tag types or I…
-
0
votes1
answer119
viewsHow to reference an object from one Activity to the other?
Good evening, I am developing an application containing several buttons, in which you can drag a button and drop in a certain place already defined in the application, and each button has to open…
-
0
votes2
answers97
viewsHow to get neighboring values at the given offset of an array?
I’m having trouble extracting a portion of any sequentially indexed array, such as a single crease(). The problem is that I need to specify a starting offset and a limit greater than or equal to 1.…
-
0
votes2
answers112
viewsWhat is the logic behind this challenge?
QUESTION: In football, teams fight over field space and score points in two different ways: through the touchdown, which can be worth 6 or 7 points and through the goal kick, which is worth 3…
-
0
votes1
answer935
viewsHow to inform the largest consecutive sequence?
Guys I’m hooked on this algorithm where I create an integer vector with n positions and need to show the longest consecutive sequence. I will leave the statement to try to be more specific.…
-
0
votes1
answer123
viewsHow to work with if in a Vue.js application
I am new as Javascript programmer and I’m having a difficulty that maybe for some is no problem. observe the HTML code well; <tbody> <tr v-for="bancodedado in filteredBancodedaos ">…
-
0
votes3
answers101
viewsRun a script once yes and once no
I’m having a hard time creating a logic and/or code. I have a Landing page that I need in a simple way, preferably without using database, run a script once yes and another no. For example: User 1…
-
0
votes1
answer1100
viewsConvert Roman Numerals
I know I’ve asked a question on the same subject, but another question has arisen. I am developing an application that converts whole numbers to Roman numbers, as you can see in the code below ...…
-
0
votes1
answer273
viewsEquals and Hashcode
Hello! I have a conceptual question. I have a method readDao(table) within the Object (access to the database) that returns a Hashset called resultRead with all objects in the database of that…
-
0
votes0
answers49
viewsHow to check if a condition is met twice?
Hello, I have the following question... Is there a way for me to check if a condition has been answered more than 1 time in an array? For example, I have an array of people, and each person can have…
-
0
votes1
answer340
viewsInsertion Sort in pascal
I have to implement the ordering method Insertion Sort in Pascal. The problem is that in my algorithm I’m having to do several ifs. One for each possibility. I wonder if there is a better method to…
-
0
votes1
answer752
viewsHow to use model variables in a view in Django
I need to calculate the average of a school report where the data are filled in in Django Admin, I would like to take each value make the media and play on a table in View. Code: MODEL class…
-
0
votes1
answer57
viewshow to index an object numerically in Node.js?
I’m getting a . csv like this: animal, branco animal, preto inseto, branco inseto, preto animal, cinza I want to be able to use that mass of data this way: // obj = { animal : [branco, preto, cinza]…
-
0
votes1
answer1119
viewsHow to check if the matrix is symmetrical?
I’m doing a college activity where you ask to check whether the matrix typed by the user is symmetric or not. Here is my code: #define TAMANHO 4 #include <stdio.h> #include <stdlib.h>…
-
0
votes1
answer80
viewsLogic of a Likes table
In a PHP + Mysql application in which I need to store how many Likes + id’s of who gave like in a publication, I came up with a question about the logic. Assuming that 2 users give like in the same…
-
0
votes1
answer42
viewsSave information from an array to each function call
have a function in my javascript code, in this function is filled information in a variable that will be added at the position of a vector, I will try to illustrate with parts in pseudocode the…
-
0
votes1
answer277
viewsHow to print the result of a php function from another page?
You can tell me how to finish this project, with this code below I managed to define the message that will appear from the number entered by the user given by the administrator <form…
-
0
votes1
answer221
viewsFill cells with AN by an annual logical sequence in R
I have a dataframe with 25 people and their respective ages from 2012 to 2015, but in a few years the ages were not filled. id<-c(1:25) idade_2012<-c(21, 18, 19, 25, 20, 12, 12, 13, 14, 29,…
-
0
votes2
answers92
views -
0
votes0
answers20
viewsWorking with Shifts in Dimension of Hours
I am structuring a new Datawarehouse that will in the future be consumed on a BI platform. Already created some dimensions for my database one of them was the Dates, in which I break the date into…
-
0
votes1
answer33
viewsRead Two Notes and Make Media If They Are Valid Notes
I’m having trouble solving the exercise below Shall I wear Desvio Condicional And by my "thoughts" I believe I should use the Desvio Encadeado I know that both grades must meet the criteria of…
-
0
votes2
answers462
viewsFind out how many are older in Windows Forms app
I’m trying to do a C# exercise using Windows Forms that are older than 18 years. The algorithm should read the age of 10 people. But when I run the program it lets me just type an age. public…
-
0
votes0
answers41
viewsProblem with Logic Listing with 3 information
I am receiving from the database several clients who have contracts and each contract of these has several documents... how can I list this using vectors in php? 8 years since I was away from the…
-
0
votes0
answers35
viewsFill in only one field
I have 6 filters in a form... Only one filter can be filled. I’ve tried using a XOR, using a flag, but not the right one: // rgn20180711 TrixDes : inclusão de campos que permitem buscar o codigo…
-
0
votes0
answers53
viewsASP Classic & Mysql - Find out which page the X record is on
I have a problem that I think is more logical than language itself, but if you can answer in ASP Classic already helps enough. I need to create a function, where given an X record, and a number of…
-
0
votes1
answer22
viewsComponents and Services
I am developing an application and came across the following problem: I am working with an api that manages a website and have some endpoints like: banners, testimonials, user, images etc, most…
-
0
votes2
answers585
viewsCompare current record with previous record in loop/loop
Setting Let’s assume I have 100 records on any comic book. ID | PESSOA | CARRETO | ENDERECO | DISTANCIA 1 | A | C10 | XX | 20 2 | B | C20 | XY | 25 3 | D | C50 | XZ | 19 4 | D | C50 | XZ | 19 5 | F…
-
0
votes2
answers72
viewsContrast application on the page via cookies
I have a button on an accessibility bar, which when clicked calls the following function: function contraste2 () { var css = document.querySelector('#css'); var contraste = Cookies.get("contraste");…
javascript html logic cookies accessibilityasked 6 years, 3 months ago Recurso de Acessibilidade 31 -
0
votes1
answer106
viewsCorrection of the Code in C
I did the code below which is basically read two vectors A and B, and accumulate the values in vector C. At the end of the code, I need to show if there are repeated values and print a message to…
-
0
votes1
answer75
viewsPHP writing encrypted javascript
I have a question about a javascript obfuscator made in php.. https://damidev.000webhostapp.com Can someone help me understand how this guy did the encryption? every time the obfuscated code is…
-
0
votes1
answer59
viewsPopular Select with XML - Logic
Hello, I need to popular a select so that they are dynamic. The customer is a car site, IE, the user will be able to schedule the cars. my job is to popular select, however I am having difficulties…
-
0
votes1
answer75
viewsAverage calculation does not return correct result
I decided to make a program to calculate the average. It works like this: 1º Pergunta o número de alunos; 2º Pergunta o nome, e as duas notas; 3º Calcula a média; 4º Imprime. But the function is not…
-
0
votes1
answer45
viewsToggle Variable within While
My system controls vehicle travel. When the customer inserts a particular trip to a line, this line has two vehicles associated with it. Then he takes the period, for example from 04/02/2019 to…
-
0
votes3
answers77
views*Python- why is my code giving me information I didn’t ask for?
should only show me the value of the fuel I requested, but it shows me the value of both gasoline and alcohol, no matter if I type D or A: tipo_comb = input('Digite [G} para gasolina \nE [A] para…
-
0
votes3
answers2069
viewsCalculate the arithmetic mean of the integers between 15 (inclusive) and 100 (inclusive)
I need to calculate the arithmetic average of the integers between 15 (inclusive) and 100 (inclusive). I made this code: x=0 for i in range(15,101): x=x+i print('%d / %d = %5.1f' % (x,i,x/i)) If the…
-
0
votes1
answer80
viewsPopulate vector and check if current position value is equal to previous
btnInnerText(btns[0],sorteio()); var bool = true; for(var i=1;i<btns.length;i++){ do{ btnInnerText(btns[i],sorteio()); for(var j=0;j<btns.length;j++){ if(getValorBTN(i)==getValorBTN(j))…
-
0
votes2
answers63
viewsHow to Catch the Smallest Value of a Series of Inputs
the user enters a code and the desired quantity, this code refers to some value of the list and then the value of the list is multiplied by the quantity. of this multiplication I want the most…
-
0
votes1
answer186
viewsAspnet Mvc Automated Routine
I have the class Clientefirm and the class Archivists one client has a list of tax files (a maximum of 12 per year, one per month) and one Archivist has a Client. public class ArquivosFiscais {…
-
0
votes2
answers105
viewsDoubts with do-while loop
People I’m learning programming and I’m having doubts regarding the do-while loop, I was solving an exercise but at the time of executing the code presents a problem: does not end the loop, if I…
-
0
votes1
answer38
viewsWrapping Ivs with a class inside a repeat loop
I have the following php code for ($i = 0; $i <6; $i++){ echo '<div class="item">'; echo $i; echo '</div>'; } ?> I would like class until position 3 to be involved by a div, and…
-
0
votes0
answers36
viewsDoubt about code reading in C
I have a question about a code I made in C, the statement is as follows: "Write a C algorithm that reads the Price of a commodity and displays the price on the reset screen of 3%. The user will…
-
0
votes1
answer331
viewsExercise of conditionals
I’m having trouble with this next army: Set the podeSubir function, receiving 3 parameters: highPessoa (number), timeCompania (boolean), temProblemaCardiaco (boolean). Take into account the…
-
0
votes1
answer68
viewsDjango filtering of timestamp transactions
I am having a logical problem trying to perform a data filtering on Django. According to the code below, I am trying to filter an object inside my database: class…
-
0
votes1
answer49
viewsHow to assemble a foreach list at different positions
How to assemble a list using foreach to change the positioning of the image. If my Count is 1, position the image on the left side, if my Count is 2 position the image on the right side, follow my…
-
0
votes1
answer72
viewsI can’t enable javascript function
I’m trying to implement a very simple function of leasing a particular product. I need the id is read within a field and activated with the button Schedule. But the function is not activated when I…