473,396 Members | 1,783 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

whats wrong with this " if "condition?

hi anybody can help me analyze this code..im not getting the correct output..

Expand|Select|Wrap|Line Numbers
  1. if(($origin=="NAIA 1" && $vehicle=="Small Car" && $zone=="Paranaque 2") && ($destination=="BACLARAN" || $destination=="SAN DIONISIO" || $destination=="BICUTAN INTERCHANGE" || $destination=="MULTINATIONAL VILLAGE" || $destination=="MOONWALK" || $destination=="SM SUCAT" || $destination=="DON BOSCO" || $destination=="SUN VALLEY" || $destination=="BETTER LIVING" || $destination=="MERVILLE" || $destination=="MARCELO GREEN" || $destination=="KALAYAAN" || $destination=="UNITED PARANAQUE"))
  2.     {
  3.     $rate=550;
  4.     }
  5.     if(($origin=="NAIA 1" && $vehicle=="Innova" && $zone=="Paranaque 2") && ($destination=="BACLARAN" || $destination=="SAN DIONISIO" || $destination=="BICUTAN INTERCHANGE" || $destination=="MULTINATIONAL VILLAGE" || $destination=="MOONWALK" || $destination=="SM SUCAT" || $destination=="DON BOSCO" || $destination=="SUN VALLEY" || $destination=="BETTER LIVING" || $destination=="MERVILLE" || $destination=="MARCELO GREEN" || $destination=="KALAYAAN" || $destination=="UNITED PARANAQUE"))
  6.     {
  7.     $rate=865;
  8.     }
  9.     if(($origin=="NAIA 1") && ($vehicle=="Van") && ($zone=="Paranaque 2") && ($destination=="BACLARAN" || $destination=="SAN DIONISIO" || $destination=="BICUTAN INTERCHANGE" || $destination=="MULTINATIONAL VILLAGE" || $destination=="MOONWALK" || $destination=="SM SUCAT" || $destination=="DON BOSCO" || $destination=="SUN VALLEY" || $destination=="BETTER LIVING" || $destination=="MERVILLE" || $destination=="MARCELO GREEN" || $destination=="KALAYAAN" || $destination=="UNITED PARANAQUE"))
  10.     {
  11.     $rate=1300;
  12.     } 
  13.  
  14.  
Jun 18 '12 #1

✓ answered by Rabbit

Happens to everyone, good luck.

5 1564
Rabbit
12,516 Expert Mod 8TB
How can we help if we don't know what the correct output is? We would also need to know the input and the resulting wrong output.
Jun 18 '12 #2
well basically it will print for the price rate of the car depending on the origin,destination,vehicle type,

Expand|Select|Wrap|Line Numbers
  1. $origin = 'NAIA 1';
  2. $vehicle = 'Van'; # switching with 'Innova' and 'Vios'
  3. $zone = 'Paranaque 2';
  4. $destination ='BACLARAN'or 'Luneta';
  5. $rate = 500;
  6.  
the output will be

rate=500
Jun 19 '12 #3
Rabbit
12,516 Expert Mod 8TB
Well it's impossible for rate to output 500 since you set it to 550 in your code.
Jun 19 '12 #4
LOL..funny thing is i try to read the line almost a hundred times figuring were did i go wrong..just to find out that i place the wrong price..it almost took me 1 whole day just to find it out..bad bad bad..any way thanks
Jun 19 '12 #5
Rabbit
12,516 Expert Mod 8TB
Happens to everyone, good luck.
Jun 19 '12 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: iz0nlee | last post by:
can anybody tell me what is wrong here, I got this shockwave test from javascript in easy steps but it doesnt open the pages required <html> <head> <script type = "text/javascript"> if ( ...
3
by: Dam | last post by:
Using SqlServer : Query 1 : SELECT def.lID as IdDefinition, TDC_AUneValeur.VALEURDERETOUR as ValeurDeRetour FROM serveur.Data_tblDEFINITIONTABLEDECODES def,...
6
by: JS | last post by:
In this sample code: if(n==0&&args>1){ for(i=num;args>i+1;i++){ s.length = 0; opt = document.createElement('OPTION'); s.appendChild(opt); opt.value = ""; opt.text = "\74-- Vælg --"; }
6
by: Jason Huang | last post by:
Hi, I would like to have a public string which will return a "" if the parameter is a Null string, would someone tell me what's wrong with my code? public string NoNull(string strNoNull) {...
1
by: feng | last post by:
Hi, I know this might not be a question for this group but I would give it a try anyway as I couldn't find a better group for my question. I have noticed that there are a lot of articles out...
43
by: markryde | last post by:
Hello, I saw in some open source projects a use of "!!" in "C" code; for example: in some header file #define event_pending(v) \ (!!(v)->vcpu_info->evtchn_upcall_pending & \...
0
by: eyalhz | last post by:
I have this code at button click: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If ListBox1.SelectedIndex() Then Dim lines As...
1
by: Java Guy | last post by:
I'm trying to view a web page. IE tells me there are (Java?) errors on the page. Here they are: Line: 15 Char: 7 Error: Wrong number of arguments or invalid propert assignment Code: 0 URL:...
10
by: lovecreatesbea... | last post by:
Is it correct and safe to compare a string object with "", a pair of quotation marks quoted empty string?If the string object: s = ""; does s contain a single '\'? Is it better to use...
2
by: Seb | last post by:
I'm trying to code a calendar control which allows multiply selection of dates and can read from a datasource. The second part is working. However I'm having some trouble with the multiply...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.