1 / 6

CIS 451: Order of Operations

CIS 451: Order of Operations. Dr. Ralph D. Westfall January, 2009. Program Development. write code 1st, then analyze requirements? faster “progress” at start slower finish “messier” code when done analyze requirements, then write code slower at start, better in long run

brooks
Download Presentation

CIS 451: Order of Operations

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CIS 451: Order of Operations Dr. Ralph D. Westfall January, 2009

  2. Program Development • write code 1st, then analyze requirements? • faster “progress” at start • slower finish • “messier” code when done • analyze requirements, then write code • slower at start, better in long run • "Pay me now, or pay me later!"

  3. Order of Operations • ( ) items in parentheses evaluated 1st • ^ then exponentiation • *, / then multiply, regular division • \ then integer division • MOD (modulus: remainder after divide) • then +, - plus, minus • Please Excuse My Dear Aunt Sally

  4. Order of Operations - 2 • comparison operators come after calculations • =, < >, <, >, <=, >= • logical operators come after comparisons • NOT, AND, OR (in this order)

  5. Operations Order Exercises • evaluate the following (in class): • 3 * 5 + 4 / 2 – 3 ^ 3 • If (9 + 2) = (7 + 4) Then ... • try to create problems hard to do right • PEMDAS; and include Boolean comparisons • <= 8 single digits in problem • answer has <= 1 decimal • intermediate values <= 20 • post in Blackboard, verify in Excel

  6. String Constants for Non-HTML Output • VBCrLf: carriage return and line feed • moves following text to start of next line • Response.Write "Hello" & VBCrLf & "world" • VBTab - inserts a tab • use " " (1 or more spaces in quotes) to insert one space in HTML output) • Note: HTML ignores extra spaces unless you use &nbsp; <p>J Lo shows J Lo on web page <p>J &nbsp; &nbsp; &nbsp; Lo shows J Lo

More Related