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
-1
votes
2 answers

Python 'if' statements

I am doing an assignment where I need to conduct a quiz. This is a part of my code so far. answer = input("Your answer: ") guessesTaken = 0 points = 0 if answer == 'Call Of Duty' or answer == 'Call of duty' or answer == 'Call of duty' or answer ==…
Shahaad Boss
  • 1
  • 1
  • 2
  • 6
-1
votes
1 answer

Math operations conditional statement

public class Eval { public static void main(String[] args) { int operand1; char exp1; int operand2; if (args.length != 3 ) { System.err.println("*** Program needs 3 arguements***"); …
-1
votes
2 answers

prepared statement method.. confused

I don't know what's missing or why it isn't displaying data. My code is working if I'm not using prepared statements. When I used prepared statements, it seems that code is not working anymore. db.php Class Database{ public $mysqli; public…
eaponz
  • 574
  • 1
  • 16
  • 32
-1
votes
1 answer

bind param => error, why?

hey there i just want to insert some value´s in my database and i used this code: define('SECURE', true); include "storescripts/connect_to_mysql.php"; if (!$mysqli) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $stmt…
-1
votes
1 answer

If statements accept anything

I am new to Java and programming in general. In my program, I use if statements to read specific user input. But, when I enter the code "75832", it processes it as if I entered "24231". Also, if I enter anything besides those numbers, it processes…
-1
votes
1 answer

Opening PHP statements

So I was just wondering if it was considered bad practice to open and close PHP statements, and let me explain what I mean. I know I can make variables at the beginning of my code but I like to group stuff together.I'm not sure if making one big PHP…
Androidd
  • 13
  • 5
-1
votes
1 answer

How could I fix this side effect?

Possible Duplicate: How do I compare strings in Java? I am having a problem with the code below; the issue is that after you don't say map the first time, it keeps repeating No try again with the input box, no matter if you type "map" or not. …
-1
votes
1 answer

Using hitTestObject with 'if' statements in ActionScript

I am trying to use hitTestObject and enter_frame to create a "Test" page where the user drags an "answer box to another box, and if the answer is correct it displays the word "correct, if not "wrong", but I have four questions (q1) and 4 answers…
-1
votes
1 answer

PHP if / else statements don't seem to work for contact us with email

I've created some if / else statements to get a download when a user hit click but dont work ,because you can direct download without field name or email ,please help me contact. php for my site…
-2
votes
1 answer

What's the advantage and use of prepared statements in PHP

Possible Duplicate: PHP PDO prepared statements prepared statements - are they necessary* Recently, heard about php prepared statements. Nearly all hi-rep php developers use php prepared statements. Can anyone explain me what's the main advantage…
Tural Ali
  • 22,202
  • 18
  • 80
  • 129
-2
votes
1 answer

Understanding how to optimize the performance of JS Arrow Functions in different contexts

I'm trying to understand why arrow functions might run faster or slower in different javascript contexts. Given the following three options: JS Statement (e.g. paragraph.textContent = 'Loop iteration ' + (i + 1)) JS Anonymous Arrow…
Rounin
  • 27,134
  • 9
  • 83
  • 108
-2
votes
2 answers

I tried and I only printed out the letter 's's instead of the words that start with s. I'm not sure how to use the .split() function

Use for, .split(), and if to create a Statement that will print out words that start with 's': st = 'Print only the words that start with s in this sentence'
-2
votes
1 answer

how booleans work with if statements in Python?

I just want to know how Booleans work with "if" statements because it has caused some confusing and I want to understand the logic behind it and I believe that many other beginners have the same confusing. here I have an example of a car game which…
Simo
  • 1
-2
votes
3 answers

Multiple if search statements in excel?

I am trying to convert text of the month to the number B2 cell: BirthMonth_Jan BirthMonth_Feb BirthMonth_mar BirthMonth_Apr BirthMonth_May BirthMonth_Jun, ect to december for example, BirthMonth_Jan will output 1 based on the search of Jan, so i can…
user10659686