Hello! I was wondering if someone can take a look at the following if and else statement and point out what I have written incorrectly. In its current form, I cannot get it to work. So, essentially, I'm trying to construct an if conditional statement within another if statement. $var_test ="25"; $play_envir ="Open Play"; //In my complete code; $play_envir variable could be any of the following:"Open Play, Robotic Training, Coaching Session " if($var_test >'0' ) //if credit exists, payment will be deducted from credit { if ( $play_envir == "Open Play" ) { echo "Your fee for today is <font …

Member Avatar
Member Avatar
+0 forum 3

I am making an ABACUS MODEL program which adds counters to pegs. The program compiles fine but when i use the test that was issued to me (as pictured) it appears as though my program does not work as intended. I don't know if anyone will be able to help me solve this but any attempts or suggestions will be very helpful. Not particularly talented with Java. ## Variables: ## **thisPeg** - an integer that refers to any of the pegs in the abacus **peg_array[]** - stores the number of counters present in each of the pegs in the abacus …

Member Avatar
Member Avatar
+0 forum 1

Hi all, ive got a big question about conducting mysql_queries.. i have a schedule program that needs to sort through and pick the records that apply.. the date will change, and used a php date() formatted to mysql date and pick out the ones records that are active vers inactive. and finally sort through the other fields.. $sql="SELECT * FROM $dbtable WHERE date = $sysdate AND recstatus='active' ORDER BY ftime ASC, stime ASC, tailnum ASC"; can anyone tell me if im on the right track or am i going the wrong direction? THX to anyone that can help!!

Member Avatar
Member Avatar
+0 forum 3

I am trying to implement periodic boundary conditions for 2d lattice. I did: int boundary2d(int xpos,int ypos,int stepx,int stepy){ int x=4,y=4; //grid size int **matrix; //the grid matrix int i=stepx+xpos; int j=stepy+ypos; if (i<0) { do { i+=Nx; }while (i>Nx-1); } if (i>Nx-1) { do{ i-=Nx; }while(i>Nx-1); } if (j<0) { do { j+=Ny; }while (j>Ny-1); } if (j>Ny-1) { do{ j-=Ny; }while(j>Ny-1); } return matrix[i][j]; } I don't know if i have the conditions right. Could you help me? Thank you!

Member Avatar
Member Avatar
+0 forum 4

Hi Everyone, I'm doing my third year in Information Technology. As part of our syllabus, we need to go out into the "real world" and find an information systems problem, which we then solve using the skills we've learnt over the years, as well as any new skills we learn this year. This is then the project we work on for the whole year, and forms the "glue" for entire diploma. This project is split up into phases, which follow the SDLC (Software Development Life Cycle) namely planning, analysis, design, implementation and support. I have a bit of a problem …

Member Avatar
Member Avatar
+0 forum 1

I'm trying to seem if(t3.alive) is not ever entered. It successfully goes through t1 and t2 if statment but skips over three. I've tried the do while, while (like seen). I would think if t3 is still alive the loop would still go then once it's not, its out but i'm not seeing that result. even if it wasn't started it would at least go in immediately but it's just skiped over help please while ((t3.IsAlive) || ((t2.IsAlive) || (t1.IsAlive))) { if (!t3.IsAlive && itc == false) { it.Stop(); itc = true; } if (!t1.IsAlive && mtc == false) { …

Member Avatar
Member Avatar
+0 forum 12

the scenario is a fitness test and the challenge was to return a string saying either Gold, Silver, Pass or Fail, depending on certain conditions, they were as follows; gold - the candidate scored 4 or more at each station , and had a total of 13 or more points silver - the candidate scored 3 or more at each station, and had a total of 11 or more points pass - the candidate scored 2 or more at each station, and had a total of 7 or more points fail - less than 2 points for any station or …

Member Avatar
Member Avatar
+0 forum 1

I am having some trouble with this code. I want have an onclick function on a div and I want to call this function. Only the 'if' section of the code works. If the #about opacity is anything other than 0.47, it still executes the 'if' code, but not the 'else' [CODE] function opacityabout() { if ($('#about').css("opacity", "0.47")) { $('#about').css("opacity", "1"); $('#home').css("opacity", "0.47"); $('#right').css("-webkit-transform", "rotate(180deg)"); } else { $('#about').css("opacity", "0.47"); $('#home').css("opacity", "1"); $('#right').css("-webkit-transform", "rotate(180deg)"); } }[/CODE] My HTML is set up like this: [CODE]<div id="right" onclick="opacityabout()"> </div>[/CODE] Thanks

Member Avatar
Member Avatar
+0 forum 9

if I wanted to remove all of the strings within a given list that met a certain criteria, such as having the str'a' in them, how would I go about doing that? the only way that's intuitive to me a for/in loop, but that can't be done. any ideas? Using Python3.2

Member Avatar
Member Avatar
+0 forum 9

I'm trying to code a site similar to the coding on the bottom. I need help though I'm not sure if functions for php can work this way. I want to be able to use the function greeting in many different if else statements. How can i do this without having to plug the entire code in to every if else statement. Thanks [CODE] function greeting(){ if($greetings == hello){ echo "Hello"; }else{ echo "goodbye"; } } [/CODE] [CODE] if($occupancy > 0){ function greeting() }else{ echo "Nobody is home"; } [/CODE]

Member Avatar
Member Avatar
+0 forum 4

I'm trying to build a mortgage qualifying script for a company. My php code is working fine .. up until the if else statements. fyi I'm using wamp... heres the code. The code if very raw, i've only been working on it for a day or 2, but I can't understand why my if else statements aren't working. index.htm[CODE][/CODE] [CODE] <html> <body> <h1>Lead Capture</h1> <div id = "leadcapture"> <form method="post" action="process.php"> Name:<br> <input name="name" type="text" STYLE="background: white; border: 1px #CACACA solid;"><br > Phone:<br><input name="phone" maxlength="13" size="13" type="text" STYLE="background: white; border: 1px #CACACA solid;"><br > Email: <br><input name="email" type="text" STYLE="background: white; …

Member Avatar
Member Avatar
+0 forum 1

[CODE]#include <iostream> #include <string> using namespace std; int main() { // Variable declarations allowing us to calculate string fullName; int weeklySalary; int weeks; string age; int option; int actualage; int earnings; double savingsPercentage; double percentage; int retirementage; double total; cout << "What is your name? "; getline(cin, fullName); cout << "How old are you? "; cin >> age; cin.ignore(); // Removes the control character... cout << "Please select an option: " << endl; // Main menu allowing selection of option. cout << "\t(1) Number of years to retirement" << endl; cout << "\t(2) Amount earned between now and retirement" << …

Member Avatar
Member Avatar
+0 forum 5

Hi, i'm trying to get something to work. I want to do a query with multiples "if not" conditions in a mysql query. This is working : SELECT * FROM table WHERE column!='value' This is not working : SELECT * FROM table WHERE column!='value' OR column2!='value' I've tried all kind of apostrophe and it still not working. My question is : How can i make multiple "if not" conditions in my mysql query? Thank you !

Member Avatar
Member Avatar
+0 forum 3

Thanks to some great help for my first ever post on this formum [ [URL="http://http://www.daniweb.com/forums/thread346113.html"]Fetch a node based on a value of another node.[/URL]] I am now recursively traversing through my XML data where nodes are related to each other. Example XML [ICODE] <gedcom> <INDI ID="@I001@"> ... <FAMC>@F001@</FAMC> </INDI> <INDI ID="@I002@"> ... <FAMC>@F002@</FAMC> </INDI> <INDI ID="@I003@"> ... <FAMC>@F003@</FAMC> </INDI> ... <FAM ID="@F001@</FAM> ... <HUSB>@I002@</HUSB> <WIFE>@I003@</WIFE> </FAM> <FAM ID="@F002@</FAM> ... <HUSB>@I004@</HUSB> <WIFE>@I005@</WIFE> </FAM> <FAM ID="@F003@</FAM> ... <HUSB>@I006@</HUSB> <WIFE>@I007@</WIFE> </FAM> ... </gedcom> [/ICODE] Here is my current XSLT code [ICODE] <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes" method="html"/> <xsl:template match="/"> <html> <head> <title>Pedigree Chart</title> …

Member Avatar
+0 forum 0

D is a list containing some words. D=[word1,word2,word3......] E is a list containing combinations of any two words in D ... E=[(word1,word2),(word7,word1)....] How can I implement the following in python: [CODE]A0[x]=1 for all x in D # This is actually Ai. when i=0, it becomes A0 B0[x]=1 for all x in D for i = 1 to 10: # i takes the values 1 to 10 Ai[x]=0 for all x in D Bi[x]=0 for all x in D for x in D: for y in D: if (x,y) in E: Bi[x]=bi[x] + Ai-1[q] if (y,x) in E: Ai[p]=Ai[p]+Hi-1[q] print A10,B10[/CODE]

Member Avatar
Member Avatar
+0 forum 6

Salary Works Department for use in a workplace, employees' salaries and to calculate the income tax cuts, the minimum number of net salary payments using money to make and required a program to get some statistical information. For this program the following data will be entered for each employee in the workplace:  Personnel number (integer greater than 0, enter 0 or a negative value indicates that data entry is over.)  Gross salary (the real number, the minimum wage can not be low, the current gross minimum wage is £ 760.50.)  Marital status (m / M: married, s …

Member Avatar
Member Avatar
+0 forum 4

i need help with the usage of round function.Can you help me?

Member Avatar
Member Avatar
+0 forum 8

Using the following code I am trying to check the users input string (CAcodes) and checking each one individually by assigning each element in CAcodes to a list (CAcode). A for-loop checks the conditions to make sure that the conditions for each code are met. The main for-loop tests several things. [B]1.) Try Statement:[/B] tests if there is a url entered for the corresponding code in the dictionary (urldict). If there is no url entered for that specific code, then the dictionary holds the value to be "0.0". If the value is "0.0" (making k =1) the program breaks at …

Member Avatar
Member Avatar
+0 forum 19

Hello everyone, Im new here. I'm not new to web design but a bit new to PHP. I really need some help with this. I have an email script that sends a bunch of user choices to me. The choices ware one or more and are sent to the email page via Sessions (entered and submitted two pages before). Here is the email section of the code. [CODE=php]$to = "my@email.com"; $subject = "Online order recieved " ; $uni_order = "$TotalShirts_unisex $unisex_colour Unisex T-Shirts"; $mp_order = "$TotalShirts_mpolo $mpolo_colour Men's Polo Shirts"; $fp_order ="$TotalShirts_fpolo $fpolo_colour Women's Polo Shirts"; $ks_order = "$TotalShirts_kshirt $kshirt_colour …

Member Avatar
Member Avatar
+0 forum 9

Hello guys, I am trying to make a very simple booking system. The booking will be either for the current or the next year only. There are three fields; number of person, type of meal and date. In any particualr day and meal, the number of person can't exceed 100. When the user enters a date, number of people and meal type, the bookingcheck script should check if the booking is available. If it is available; it will allow the user to make a booking for that day and meal type. If there was no booking placed on that day, …

Member Avatar
+0 forum 0

Hi all, Are multiple conditionals at once okay in Python?? So for example: [CODE]if self.combobox.GetValue()!="" [B][COLOR="Red"]and [/COLOR][/B]self.FilePathTextBox.GetValue()!="": [I][functions and objects go here] [functions and objects go here][/I] else: self.SetStatusText('error') [/CODE] Mainly a question on style ... I tried it on my program, and the program seems to work fine. Is this standard procedure or is there a better way to do things? Does this normally happen in other languages like Java and C++/C#?? Thanks.

Member Avatar
Member Avatar
+0 forum 1

A belated word about last week's [URL="http://www.facebook.com"]Facebook[/URL] fiasco, if I may. You might remember the company aroused all sorts of excitement when it changed its terms and conditions to allow itself rights in perpetuity to images on its servers. The BBC had a [URL="http://news.bbc.co.uk/1/hi/technology/7897824.stm"]social media expert[/URL] in to explain how the company was getting a little above itself. I should declare an interest, albeit an indirect one; I've just been asked to write a book on social media. I know a little about what I'm talking about. So, of course, does this guy. He doesn't mention, though, the obvious reason …

Member Avatar
+0 forum 0

The End.