Questions tagged [statements]

In computer programming a statement is the smallest standalone element of an imperative programming language. A program written in such a language is formed by a sequence of one or more statements. A statement will have internal components (e.g., expressions).

A statement is the smallest standalone element of an imperative programming language. A program written in such a language is formed by a sequence of one or more statements. A statement will have internal components (e.g., expressions).

Resources

471 questions
0
votes
1 answer

"Else if" statement don't do anything (Making an android test)

I'm making my first android app and I want to to make a test app, I'm using a variable and "If"/"Else if" statements in order to change the text of the question (TextView) and answers (RadioButtons). The problem is that when the user presses the…
Jacobo
  • 87
  • 1
  • 1
  • 13
0
votes
1 answer

How to set statementList attribute or multiple sub batch in SqlExecutor in ibatis

I am using ibatis-sqlmap-2.3.0 version and has requirement to insert around 70K lines in a table. Using SqlExecutor Batch functionality I also want to know index of statement that failed in middle of executeBatch(); following is the code piece for…
Amit Sharma
  • 31
  • 1
  • 5
0
votes
1 answer

How to target div's x coordinates through if/else statement?

How would you target the X coordinates of a div when using an if statement? What I'm trying to do is to get a div to animate across the screen but I only want it to move when certain x coordinates are met, hence why the if/else statements. For…
user1563944
  • 403
  • 7
  • 18
0
votes
1 answer

MySQL query to search keywords ordered by relative match

I am creating an online system that matches bank statements (description, value, type, etc) to purchasers (names, addresses) and would like some feedback on the way I am currently doing this: $array = array("keywords", "taken", "from", …
Oliver Tappin
  • 2,511
  • 1
  • 24
  • 43
0
votes
3 answers

PHP If blocks only uses the last block

I have code that looks like this: if ($first == 1); { $q1 = "1"; $q2 = "2"; $q3 = "3"; } if ($first == 2); { $q1 = "1a"; $q2 = "2a"; $q3 = "3a"; } if ($first == 3); { $q1 = "1b"; $q2 = "2b"; $q3 = "3b"; } The variable $first comes out of an array…
Inter Node
  • 11
  • 2
0
votes
3 answers

Very new to PHP and very interested to learn. If statements and Functions

PLS. I am very NEW to PHP so pls. understand. OK so here it goes. . What I want to know first is that "Can a function and an if statement be in one code?" second for the code below, just take a look at where the NOTE is, what should i type in the if…
Jo E.
  • 7,822
  • 14
  • 58
  • 94
0
votes
2 answers

Rails view and controllers, (if/else statements)

I've just started my own rails project from scratch. I'm trying the view to display hello if the minutes variable is set to a certain value. The code is in the controller right now, and I want it to display the output in the view. is this possible?…
Namenone
  • 344
  • 2
  • 5
  • 19
0
votes
3 answers

Jquery conditional statements for css?

Conditional statements dont appear to be working for me. Im trying to a set of stacked images to change their zIndex based on the zIndex of the one being selected. So if i have a few buttons to call up a few images to the front: (assume we started…
user1361747
  • 31
  • 2
  • 9
-1
votes
2 answers

program to capitalize or join words in a sentence using python programming language

def capitalize_or_join_words(sentence): """ If the given sentence starts with *, capitalizes the first and last letters of each word in the sentence, and returns the sentence without *. Else, joins all the words in the given…
-1
votes
3 answers

print two numbers between two integers python

We were given an exercise where a user must input two numbers and the output must be the numbers between the two given numbers, with the condition that the only input are numbers, and if the user types anything besides that will print "INVALID…
Rick V
  • 23
  • 1
  • 8
-1
votes
2 answers

Java if statment contains letters

I was wondering how I should write this if statement in my assignment. The question is: Print option 2 if one of the strings begins with the letter w or has 5 characters. I would use the .contains to find the "w". if (two.contains("w")…
Emma
  • 15
  • 1
-1
votes
3 answers

Converting if statements to switch but not working, where did conversion go wrong?

This is part of the code, it gets a line of numbers from a textfile and counts how many numbers fit in each specified range. I'm converting it from if, else if statements (which works fine) just for practice. However none of the numbers are counting…
-1
votes
1 answer

I have an issue with my if statements; no output or errors

The hold section isnt printing im not getting an error or anything like that #TEXT SECTION #Start textMorn= "It's 8 in the morning, the sunshine comes up and you slowly open your eyes. You realize it's monday morning, so you get up and start…
p1p1p1
  • 11
  • 3
-1
votes
7 answers

Is it possible to add conditions inside a switch statement?

I used if, else if, and else statements before and today I've decided to use switch statements which really simplified my code. My question is, just like if statements, is there a way I can add multiple conditions inside a switch statement? Here's…
-1
votes
2 answers

Difference between a compound statement and a block in C++?

I often hear about the term of "compound statements" almost interchangeably used for a block, starting and ending with curly brackets of {}. I see no differences to a block. So my Question is: Is there a difference between a "block" and "compound…