1 / 25

Catalog guidelines of 3-4 hours per week per unit

Catalog guidelines of 3-4 hours per week per unit. CS 14 Final Grade vs. Class Attendance, Win/Spr 2004. 100%. A. 90%. B. 80%. C. 70%. D. 60%. 50%. 40%. 30%. 20%. 10%. 0%. 0%. 10%. 20%. 30%. 40%. 50%. 60%. 70%. 80%. 90%. 100%. Class Attendance. Operators in VB: Part I.

bevan
Download Presentation

Catalog guidelines of 3-4 hours per week per unit

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. Catalog guidelines of 3-4 hours per week per unit

  2. CS 14 Final Grade vs. Class Attendance, Win/Spr 2004 100% A 90% B 80% C 70% D 60% 50% 40% 30% 20% 10% 0% 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% Class Attendance

  3. Operators in VB: Part I SymbolName ^ Exponentiation * Multiplication /  Division +  Addition - Subtraction We have seen 5 arithmetic operators

  4. Operators in VB: Part II We have seen 6 relational operators SymbolName =  Equality < >  Inequality () <  Less Than >  Greater Than <=  Less Than or Equal To () >=  Greater Than or Equal To ()

  5. Operators in VB: Part III We have seen 3 Boolean operators SymbolName Not  Negation And  Conjunction Or Disjunction

  6. Operators in VB: Part IIII We have seen 1 string operator SymbolName & Concatenation

  7. Operands in VB: Part I Examples of arithmetic operands • The literal number 5 • -2 The literal number –2 • 12.4 The literal number 12.4 • Dim shtAge AsShortThe variable shtAge • Dim lngX AsShortThe variable lngX • Const sngTax = 1.07The constant sngTax

  8. Operands in VB: Part II Examples of string operands “A” The literal string “A” “-2” The literal string “-2” “Homer” The literal string “Homer” Dim strName AsStringThe variable strName Dim strQ AsStringThe variable strQ Const StrM = “NO”The constant StrM

  9. Operands in VB: Part III Examples of Boolean operands True The literal logical value True False The literal logical value False Dim blnIsMale AsBooleanThe variable blnIsMale

  10. Expressions In VB: Part I Expressions consist of one or more operands and zero or more operators. Expressions always evaluate to a single value

  11. Expressions In VB: Part II Expressions consist of one or more operands and zero or more operators. Expressions always evaluate to a single value

  12. Expressions In VB: Part III Expressions consist of one or more operands and zero or more operators. Expressions always evaluate to a single value

  13. Expressions In VB: Part IIII Expressions consist of one or more operands and zero or more operators. Expressions always evaluate to a single value

  14. Expressions In VB: Part V Expressions consist of one or more operands and zero or more operators. Expressions always evaluate to a single value

  15. Expressions In VB: Part VI Expressions consist of one or more operands and zero or more operators. Expressions always evaluate to a single value

  16. Expressions In VB: Part VII Expressions consist of one or more operands and zero or more operators. Expressions always evaluate to a single value

  17. Expressions In VB: Part VIII Expressions consist of one or more operands and zero or more operators. Expressions always evaluate to a single value

  18. Expressions In VB: Part IX Expressions consist of one or more operands and zero or more operators. Expressions always evaluate to a single value

  19. Not((2 * 3 = 1 + 5) And (“U” & “2” = “U2”)) Not(( 6 = 1 + 5) And (“U” & “2” = “U2”)) Not(( 6 = 6 ) And (“U” & “2” = “U2”)) Not(( True ) And (“U” & “2” = “U2”)) Not(( True ) And ( “U2” = “U2”)) Not(( True ) And ( True )) Not(( True )) False

  20. Expressions In VB: Part X Expressions consist of one or more operands and zero or more operators. Expressions always evaluate to a single value

  21. Expressions In VB: Part XI Expressions consist of one or more operands and zero or more operators. Expressions always evaluate to a single value

  22. Expressions In VB: Part XII Expressions consist of one or more operands and zero or more operators. Expressions always evaluate to a single value

  23. Expressions In VB: Part XIII Expressions consist of one or more operands and zero or more operators. Expressions always evaluate to a single value

  24. Homework Read Drills 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, 4.1, 4.2, 4.3, 4,4, 4.5 4.6, 4.7, 4.8, 4.9, 4.10, 4.11, 4.13 and 4.14 in the book (the answers are in the book). Working in groups of size 1, 2 or 3: Take one question from (3.1, 3.2, 3.3, 3.4, 3.5) and one from (3.6, 3.7, 3.8, 3.9, 3.10) and one from (4.1, 4.2, 4.3, 4,4, 4.5 4.6) and (4.7, 4.8, 4.9, 4.10, 4.11, 4.13, 4.14 ) and write a new version of it. The next page shows examples of the type and quality of work I expect. Homework is due on Friday the 15th

  25. Joe Doe (SID 23431) and Jane Doe (SID 855675) Homework 1 1) Drill 3.3 on page 58 is as follows: If the following code were executed, would an overflow occur? If so, why? Private Sub btnCalculate_Click(... Dim shtVariable As Integer shtVariable = 10000 shtVariable = shtVariable * 3 End Sub Answer: An overflow will not occur. The exercise is suppose to test our knowledge of the concept of overflowing, which is defined as attempting to place a value into a variable which is too small to hold it. In our modification we have changed the exercise to consider the Long type, instead of the Integer type, and to consider the related concept of underflowing. which is defined as attempting to place a negative value into a variable whose type cannot hold such small values. According to the book, the most negative value a Long can hold is –9,223,372,036,854,775,808. So our example starts by defining a Long, initializing it to –9,223,372,036,854,775,800, then asking the user what will happen if we subtract 5, and what will happen if we subtract another 5. The exercise is below If the following code were executed, would an overflow occur? If so, why? Private Sub btnCalculate_Click(... Dim LngVar As Long LngVar = –9,223,372,036,854,775,800 LngVar = LngVar – 5 ‘what happens here? LngVar = LngVar – 5 ‘what about here? End Sub Answer 1: (write an explanation here, ek)

More Related