Flash Website Builder- Trendy Site Builder is a Flash Site Building tool that helps users build stunning websites. Check Out Custom Custom Logo Design by LogoBee. Website Design and Free Logo Templates available.
 CodingForums.com Working With If...Then Statements

Before you post, read our: Rules & Posting Guidelines

Enjoy an ad free experience by logging in. Not a member yet? Register.
 10-16-2012, 09:40 PM PM User | #1 FIR93 New to the CF scene   Join Date: Oct 2012 Posts: 2 Thanks: 1 Thanked 0 Times in 0 Posts Working With If...Then Statements I'm doing a homework assignment where I have to look at the code created by my teacher and write what the answer would be using the information given. So x starts at 7 y starts at 12 Using the info below. First she declared her variables and her statement looks like this: If x <= 7 Or y > 11 Then If x > 2 Or y > 9 Then y = 4 * y + x Else y = x - 8 If x + y > 14 Then x = x - 7 End If End If So looking at this the first If...Then statement is true then I go to the second one which is 'If x > 2 Or y > 9 Then' and if that one is true as well I plug in my numbers to solve for 'y'. But do I use the same equation to solve for x as well? Thanks for all help given
 10-16-2012, 09:53 PM PM User | #2 WolfShade Regular Coder   Join Date: Apr 2012 Location: St. Louis, MO, USA Posts: 966 Thanks: 7 Thanked 100 Times in 100 Posts if 7 <= 7 OR 12 > 11 THEN // they both are if 7 > 2 OR 12 > 9 THEN // they both are y=4 * 12 + 7 //55 ELSE y = 12 - 8 //4 IF 7 + 4 > 14 THEN // it isn't x = 7-7 __________________ ^_^ If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link. * The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".
 Users who have thanked WolfShade for this post: FIR93 (10-17-2012)
 10-17-2012, 02:51 AM PM User | #3 FIR93 New to the CF scene   Join Date: Oct 2012 Posts: 2 Thanks: 1 Thanked 0 Times in 0 Posts So for thee final answer y =4 and x=0 ?
 10-17-2012, 03:50 AM PM User | #4 Fou-Lu God Emperor     Join Date: Sep 2002 Location: Saskatoon, Saskatchewan Posts: 16,595 Thanks: 4 Thanked 2,597 Times in 2,566 Posts There is no way to tell with what you have here. Since you'll never enter that else statement, and there is mismatched end if with the if. . .then calls, there are. . . looks like 3 possible outcomes with the above algorithm. My personal answer with that above block is a compilation error. Since the else can never be executed in the above code no matter how its written, y will always be 55, and x will be either 0 or 7.

 Bookmarks

 Thread Tools Rate This Thread Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home :: Client side development     JavaScript programming         DOM and JSON scripting         Ajax and Design         JavaScript frameworks         Post a JavaScript     HTML & CSS     XML     Flash & ActionScript         Adobe Flex     Graphics and Multimedia discussions     General web building         Site reviews         Building for mobile devices :: Server side development     Apache configuration     Perl/ CGI     PHP         Post a PHP snippet     MySQL         Other Databases     Ruby & Ruby On Rails     ASP     ASP.NET     Java and JSP     Other server side languages/ issues         ColdFusion         Python :: Computing & Sciences     Computer Programming     Computer/PC discussions     Geek News and Humour Web Projects and Services Marketplace     Web Projects         Small projects (quick fixes and changes)         Medium projects (new script, new features, etc)         Large Projects (new web application, complex features etc)         Unknown sized projects (request quote)         Vacant job positions         Looking for work/ for hire         Project collaboration/ partnership         Paid work offers and requests (Now CLOSED)     Career, job, and business ideas or advice     Domains, Sites, and Designs for sale         Domains for sale         Websites for sale         Design templates and graphics for sale :: Other forums     Member Offers     Forum feedback and announcements

All times are GMT +1. The time now is 10:56 AM.