. 04 C++ elements and Case study . Previous -- First Program .See ./03.html .Open Prepare -- C++ Elements . 2.6 Arithmetic . Fig 2.9 Arithmetic Operators You need to know about "+", "-", "*", "/" and "%". But they are fairly straightforward, except for the '%' modulus operator and integer division. By the way.... C++ has a lot more operators: "!", "^', "&", "&&", "|", "||", ... which we will discover later. Note: "^" is not exponentiation! Note: don't forget that 3/6 is 0 in C++, but 3.0/6.0 is 0.5. Changing from "int" division to "double" division, often fixes a bug. . Fig 2.10 Precedence of operators Vital. If you haven't learned these in algebra ------- put them on your cheat sheet or memorize the British mnemonic BODMAS::="Brackets, Division, Multiplication, Addition, Subtraction". . 2.7 Decision Making: Equality and Relational Operators Look out for the traps: "==", ">=", "<=", ... . Figure 2.13 -- ifs and conditions Using some advanced features of C++ (Classes 8 through to 13) this program can be much improved:-( . 2.8 Software Engineering Case Study: Examining the ATM Requirements Specification Notice that that the screen images and usage scenarios (lists of actions) are very important and proceed the use case diagram. Beware of drawing a use case diagram before you have written down who you users are and what they will be doing with your software. . 2.9 Wrap-Up . Summary -- worth looking at . Self Review Exercises you have time Pages 71-72 exercises 2.1,2.2,2.3. Pages 76-77 exercises 2.4, 2.5, 2.6 .Close Prepare -- C++ Elements . Deliver -- Question and Project 2 Project 2: a use case describing a typical user and how they get something of value out of your program. Not a diagram but some text: .As_is Programmer: RJB .As_is Project: CWeb .As_is User: Jo Coyote is taking CS201. .As_is Jo can log in, input a simple C++ program, compile it, and test it .As_is from off campus using a standard web browser. This is called an informal "use case". . Exercises probably from 2.14-2.26 . Quiz 1 Not completely different from the stuff in exercises 2.1 to 2.26. . Next -- Objects and Classes .See ./05.html