Questions tagged as 'if'

2
answers

If-else command is not working

In one of the exercises in a book I'm reading, I'm asked to trace a person's "profile" according to the year they were born (like those Facebook tests) but in order to limit the possibility of what is typed, I put a if to signal an error,...
asked by 05.04.2017 / 03:13
2
answers

How to use an existing variable as a counter

My goal is to get the alphabet letter that the user typed in and show, how many times he typed, the letters that preceded him and his successors, do you understand? Here's what I did: static int v; static String[] Alfa = {"A", "B", "C", "D", "...
asked by 15.10.2016 / 03:59
2
answers

(if / else if) with check box

I have the following problem: I have a decision structure that checks the check box. However, when I select the two boxes, the code still executes the commands that it checks if only one of the boxes has been selected, and with good reason, b...
asked by 17.12.2015 / 02:48
1
answer

Array? How to solve

There is this site that I am putting together where I made a joining of a code that insertion of a watermark with a form where it would be possible to choose which mark would be superimposed on the image that was uploaded. As I'm learning PHP ye...
asked by 09.01.2016 / 02:39
1
answer

IF within the while PHP / MYSQL

I'm listing some results within the while so my goal is that when any of the variables that cleverly in the while come empty, it list only those that come with content. ps. is a poll system, I put to register 4 answers, but some questions onl...
asked by 02.03.2016 / 15:35
1
answer

I am trying to write a code in JS to test the value of "Very Good" to "bad" in IQA (Air Quality Index)

The task is to measure whether the IQA is good or bad. IQA is a measure of the air quality index. This measurement is made in conjunction with the measurement of two gases: O3, PM10. So you have a table to keep track of if the index is good or b...
asked by 15.10.2018 / 20:04
1
answer

Which operator should I use in the JavaScript c: if I want to be between two variables?

Gentlemen, I need to know which operator to use in Javascript's c: if when I want to make a decision between them, for example, I need a background of a Div to turn red when it is between date x and y, is the "ENTRE" operator, here is a snippet...
asked by 09.08.2018 / 21:23
1
answer

Syntax error: Problem with variable inside the IF

My code: DELIMITER // CREATE FUNCTION f_desc (in_preco int) RETURNS INT BEGIN DECLARE fim_preco INT; IF in_preco >= 100 THEN -- aqui fim_preco := format(10 * in_preco/100, 2); ELSEIF in_preco >...
asked by 31.07.2018 / 23:07
2
answers

Higher and lower value problem with while. (Without using list!)

Write a program that reads an integer N and then read N  real numbers, separating the smallest and largest, presenting them on the screen. N = int(input("Digite N: ")) i = 0 ma = 'maior' me = 'menor' me = x while i < N: x = float(input(...
asked by 29.03.2018 / 16:19
1
answer

How to get first value returned by foreach

I am new to programming and am trying to solve my problem with foreach ... I have a foreach that returns me the groups of photos that have photos in them ... however I need to get the first group that the foreach find photos and apply the che...
asked by 08.03.2018 / 15:09