I have an If Statement that isnt loading the right image any help would be great <?php if($formattedNum6 > $PeriodSalesTarget):{ echo '<img src="images/TargetMetGreen.png" alt="" />';} elseif($formattedNum6 > $CummulativePeriodSalesTarget):{ echo '<img src="images/TargetMet.png" alt="" />';} else:{ echo '<img src="images/TargetNotMet.png" alt="" />';} endif; ?> $formattedNum6 = 515,839 $PeriodSalesTarget = 1,366,000 $CummulativePeriodSalesTarget = 503,600 So it should show TargetMet.png but instead is showing TargetMetGreen.png If i change the PeriodSalesTarget to 999,999 it works so looks like it isnt treating the values as numbers but i dont know how to fix

Member Avatar
Member Avatar
+0 forum 2

Using swift programming import UIKit var str = "Hello, playground" func ls(array: [Int]) -> (large: Int, small: Int)//function { var lar = array[0] // array of large number var sma = array[0] // array of small number let num = 0 // check odd or even for i in array[1..<array.count] { if i < sma && num % 2 == 0 { sma = i }else if (i > lar) { lar = i } else if num % 2 == 0 { print("this is an even number") } else { print("this is an odd number") } } return (lar, …

Member Avatar
Member Avatar
+0 forum 5

Hello! I'm having a rather difficult time because the concepts weren't very much explained in class for complex situations. I'm a bit entangled with the few if-else conditions I have... :( I've been trying hard to crack the case, but I think somebody really needs to see my work. Write a menu driven program for the following options using ladderized if-else statement: a. To find whether the number is odd or even. b. To display sum of input five numbers. c. Exit.

Member Avatar
Member Avatar
+0 forum 4

My code only outputs 0.00 when 'y' is entered. Clearly, I'm a beginner. #include <iostream> #include <iomanip> #include <string> const double ADULTFEE = 18.00, CHILDFEE = 7.50, TRAINFEE = 6.00, BIRDFEE = 5.00; using namespace std; int main () { char reply = ' '; double adultNum = 0, childNum = 0, guestAdult = 0, guestChild = 0, trainNum = 0, birdNum = 0; double totalFee = 0; cout << "Welcome to Jake's Fee Calculator" << endl; cout << "How many adults (age 14 or over) are in your party? "; cin >> adultNum; cout << "How many children (age …

Member Avatar
Member Avatar
+0 forum 3

basically i am working on a project for uni, which is to create a form of an abacus model. - peg_array[] stores the number of counters/beads present in each of the pegs(lines) of the abacus. i am trying to use 2 boolean methods: "boolean removeCounter(int thisPeg)" "boolean removeCounter(int thisPeg)" thisPeg - An integer that refgers to any of the pegs in the abacus Please can someone help me solve this? All i am trying to do is to recognise where possible errors may occur and prevent them from happening. E.G. if conditions are true then add one counter to the …

Member Avatar
Member Avatar
+0 forum 6

Hi, I want to get last working day data from database(SQL database). For example, if today is Tuesday, I want to get Monday data. I can get the data directly using strtTime = Date.Now.AddDays(-1).ToString("yyyy/MM/dd") & " " & "06:15:00" But the problem is if today day is Monday. Since the last working day is not fixed, for example for week32, if today is monday, the last working day before monday is last saturday. but for week33, if today is monday, the last working day is last Friday. Sometimes the last working day can be last Thursday or Wednesday also. My …

Member Avatar
Member Avatar
+0 forum 9

Is it possible to loop an if-else statement? How would such a thing be coded. Basically, this code allows the user to enter a value for a month. If it's not from 0-12 it asks the user to enter a new value. How could I get that to go through the if-else again to see if it's a valid number? Also, if I wanted to say if it's less than 0 it's invalid does that need to be it's own if statement or I could I somehow combine that with something else? [CODE]#include <iostream> using namespace std; int main () …

Member Avatar
Member Avatar
+0 forum 5

Hi, I keep getting the error message "Missing return statement" after my if else controls. I have return controls, I'm just not sure if I can implement multiple returns. For example, I am trying to create a method in which the middle value of a sequence of numbers is returned, regardless of position. (E.g. 2, 1, 3 returns 2, -- 8, 3, 5 returns 5) Here is my code below [CODE] public int mid(int a, int b, int c) { if ((a != b) && (a != c)) { return a; } else if ((b != a) && (b != …

Member Avatar
Member Avatar
+0 forum 5

this is the code to email confirm. The user clicks on the link in the email, passing the code through url to this page. Then the data is transferred from a tmp table to main one. I have queried in phpmyadmin and it works fine. But when i actually use the php i get the "else {echo "error";}" suggesting that the INSERT query is not working. Any suggestions? [CODE] include("db_config_db.php"); $code=$_GET['code']; $sql1="SELECT * FROM table1 WHERE code ='$code'"; $result1=mysql_query($sql1); if($result1){ $count=mysql_num_rows($result1); if($count==1){ while($rows=mysql_fetch_array($result1)){ $username = $rows['username']; $name = $rows['name']; $email = $rows['email']; $address = $rows['address']; $city = $rows['city']; $state = …

Member Avatar
Member Avatar
+0 forum 8

[CODE]#include <iostream> using namespace std; int main( ) { int num1 , num2 , num3; cout << "Please Enter Three Valid Integers Using The Keyboard"; cin >> num1 , num2 , num3; if {num1 => num2} && {num2 => num3} else num1 + num2; if {num2 => num1} && {num1 => num3} else num2 + num1; if {num3 => num1} && {num1 => num2} else num3 + num1; if {num3 => num2} && {num2 => num1} else num3 + num2; cout << " The Maximum Sum Of These Numbers Is: "<< num1 , num2, num3 endl; system("pause"); Return 0 ; …

Member Avatar
Member Avatar
+0 forum 5

Hello, I was hoping that someone can help me with this. I have this linking list working, but I have one problem, when I click on the link it shows up with the link like this winner.php?service=1&&year=2010 and honorable.php?service=1&&year=2010&award=1 this is for all years not just 2010, and what I need it to do is show winner.php?service=AM&&year=2010 and honorable.php?service=AM&&year=2010&award=Notables I have looked in my db, and the values are correct, so I know that is not the issue. [CODE]<ul> <?php $row['year']='2010'; while($row['year']>'2000') { ?> <li> <?php if($row['service']='AM' && $row['award']='Winner') { ?> <a href="winner.php?service=<?php print $row['service'];?>&year=<?php echo $row['year'];?>"><?php echo $row['year'];?></a> <?php …

Member Avatar
Member Avatar
+0 forum 3

Hey! guys, i need help figurering out how to make this program ran. Jack has decided his student organization is going to sell Oktoberfest shirts at Oktoberfest. In order to compete with other clubs, he wants to offer a 10% discount to anyone who buys 5 or more shirts. Also, Jack is going to have several promotional ads before Oktoberfest to try and boost sales at his booth. If a customer mentions the ad, they receive $2.00 off their order. Jack wants the output of the program to display the quantity ordered plus the total due so everyone working at …

Member Avatar
Member Avatar
+0 forum 5

how can we make a C++ program that identifies whether the user has input a vowel or a consonant specifically by using the SWITCH structure? i mean its simple with if-else but is there a way it can be made with switch and not if-else?

Member Avatar
Member Avatar
+0 forum 1

Hey guys, I'm creating a Maze class along with a client class where it allows the user to input a direction (U/L/R/D), and then the validity of the move will be returned as well as the new position of the maze. So far, I've got this, but when I try to run it, two nullPointExceptions are thrown and I've tried fixing them but can't seem to understand as to why they're being thrown.. Any help would be appreciated, Ecliptical. [CODE]//Maze.Java //This program creates a maze, and allows the user to attempt to solve it through the client class. // // …

Member Avatar
Member Avatar
+0 forum 1

Heyah Does anyone know how can I change the bacground color of my textfield by using : the commands if & else It's for one of my school assignments but I really can't get to solve it by myself i searched through web but nothing :S We must use the textBox1.BackColor = System.Drawing.Color.Black; & if (textBox1.BackColor.Equals(System.Drawing.Color.Black)) lines but from what you can see in my way of writing and asking for so (I suppose) simple question I'm pretty new to coding so any help or tips would be appreciated my assignment is to create a button and a textfield in …

Member Avatar
Member Avatar
+0 forum 3

Hi all, I have seen code of the form: [code=php] if(file_exists("foo.php") include("foo.php"); else include("blah.php"); [/code] As far as I know, this is perfectly legal in php. What I was wondering was is it possible to do the following in in-line code in PHP? [code=php] if(file_exists("foo.php") // contains a specialised version of myFoo function include("foo.php"); else { // define the default function here function myFoo($param) { // do something here } } [/code] So in other words I want to be able to define a function in my PHP code only if the specialised version does not exist. I need to …

Member Avatar
Member Avatar
+0 forum 3

The End.