Questions tagged as 'if'

2
answers

Doubts with the use of the IF / ELSE in C

When I run this code and type the gender = M or = F, all conditions are executed as expected. Already when I type sex = m or = f, only the first condition is met, regardless of the age value. Can anyone explain to me the right use and structure...
asked by 07.09.2018 / 09:06
1
answer

Validation does not enter the correct "if"

My code should have 4 validations and I'm using if and else if , but it's only doing two of them, see the code below: double salario = 0; double p0 = 1.20; double p1 = 1.15; double p2 = 1.10; double...
asked by 05.12.2018 / 20:58
1
answer

error: assignment to expression with array type

I'm trying to compile the code below for a list of exercises from my course course of introduction to programming but the codeblocks throws the error mentioned in the title when I try to compile the code. #include<stdio.h> int main(){...
asked by 08.05.2018 / 15:01
1
answer

Return in a DataFrame - Python

Good afternoon. I have a question regarding Python. I have an if where has the conditional and else, the else it processes more than one file and I need to save all the information it reads inside a DataFrame, is there a way to do this? The c...
asked by 22.05.2018 / 20:43
2
answers

IF, ELIF and ELSE

I'm taking my first steps in Python, and I had a question in the if / else statement, trying to solve the following exercise: "Based on input data for a person's height and gender, construct an algorithm that calculates their ideal weight usi...
asked by 04.10.2016 / 19:54
1
answer

How to traverse all the records in the database table?

Good afternoon, guys! I'm starting in PHP and I already had a problem. It is as follows: I need to go through all records in the bank table so that I can validate if that value already exists. I'm using Codeigniter and did the following plus...
asked by 05.10.2015 / 19:38
1
answer

Laravel 5, assuming variable in empty query?

I have a query, but sometimes this query returns an empty value ( no records ). These query results are directed to the generation of a HighCharts chart, but when there are no values within the query, the graph is not generated. My idea...
asked by 17.11.2018 / 13:41
2
answers

Why does the if or case test not work in this subquery?

I'm trying to run the following subquery inside a view: (SELECT if(idnotas > 0, "não", "sim") FROM notas WHERE vendas_idvendas = p.vendas_idvendas ORDER BY idnotas DESC LIMIT 1 ) as primeiraFatura, Howeve...
asked by 27.12.2018 / 12:49
1
answer

If chained - how to delete?

I'm doing an application where I have the following scenario: I have several rules (business classes) where all return the client code. They are separate classes that will look for the code trial and error, if find the client code returns...
asked by 21.08.2018 / 17:32
0
answers

Block registrations beyond the value stipulated in PHP form

I have a course management system where the teacher registers a class and the student accesses a page with a table with all the classes and subscribes to the one that he thinks best. The problem is that many students are enrolling in a class...
asked by 22.01.2018 / 17:32