280 likes | 385 Views
Managing Financial Information. Critical Thinking Business Process Modeling WINIT Control Structures Homework. Critical Thinking. Missing files / other zip issues Grade fairness is important to me: come and see me Helping others EasyMeter . Use .Net Framework 4.0.
E N D
Managing Financial Information Critical Thinking Business Process Modeling WINIT Control Structures Homework
Critical Thinking • Missing files / other zip issues • Grade fairness is important to me: come and see me • Helping others • EasyMeter
Business ProcessModeling Tools Jobs and tools
Modeling a BP Identify the requirements (what needs to be done) Create a description of the financial Business Process Implement the BPusing IT Business Analyst / Consultant Technical Analyst / Consultant Developer / Consultant
State Diagrams State Diagrams State Diagrams State Diagrams State Diagrams State Diagrams Class Diagrams Sequence Diagrams Package Diagrams Component Diagrams Component Diagrams Collaboration Diagrams Use Case Diagrams Use Case Diagrams Scenario Diagrams Scenario Diagrams Scenario Diagrams Use Case Diagrams Use Case Diagrams Scenario Diagrams Scenario Diagrams Scenario Diagrams Activity Diagrams Use Case Diagrams Statechart Diagrams Component Diagrams Deployment Diagrams UML International standard: diagramming techniques to describe processes
An Activity Diagram • understand & communicate • reengineer & change • specify software • WE WILL USE IT TO DESCRIBE (HOME)WORKTO BE DONE.
Activity Diagram Starting point RECEIVING A/P VENDOR Activity Receive goods Actor Swimlane Inspect content Return some goods Decision Point [Returned goods] Receive returns [Errors] Notify Vendorand A/P Fork Join [Guard] Model guards only if they add value [OK] Merge Update A/R Accept allgoods Update A/P Reconcile Account Pay vendor End point
Forks, Joins, and Merges A join has a single exit point, that is traversed when allthe input activities have occurred. A merge (same symbol than the decision point) has a single exit and is traversed when any one of the input activities occurs. A fork has one entry point and multiple exits to activities that can be done in parallel
Homework H3
Activity Diagram H3 - Simple Financial Calculator Ask the user whether he/she wants to see (a) the interest, (b) the sum of principal + interest, or (c) both a and b (default). Ask for the interest rate (e.g., “5” means five percent). Allow for fractions, as in 4.725. Less or equal 0or more than 10 a b anything else Print Output Print Output Print Output Ask for the principal in $ More than $0 Ask for more? (y=yes) Ask for the number of years (1-30) y For this assignment assume a “competent” user Less than 1 or more than 30
H3: Math Functions Interest = Principal * [(1+ Interest Rate) t– 1] "Principal" is the same as "capital" pay attention to the unit of measure!
WINIT What Is NewIn Technology?
From UML to VB Introduction to Visual Basic
Variables Are named places in memory where you store information.To create a variable, you declare it (Dim) and you tell the computer what kind of info you want to store in it (e.g., an integer, a double, a string, a range). Dim myInterestas double = 0 Dim userInput as string = “Stefano” • To change its content, you use the assignment operator “=” myInterest= 0.05 • To use its value, you just write its name newVariable= myInterest* 2
Excel CELLS • Are objects with properties and behaviors. • No need to pre-specify what king of info you want to store in them. • Examples: Range("A1").Value = “My Excellent Calculator” Range("A1").Font.Bold = True Range("A1").ColumnWidth = 30 Range("A3").Value = "Interest is" Range("B3").Columns.NumberFormat = "$#,##0.00_);[Red]($#,##0.00)" Range("B3").Value = interest
Basic Idea: Decomposition • Once charted with UML, financial processes are easier to implement • Recognize the patterns & follow the examples VBA
Implementing a Decision ... Dim creditRange as Double ‘ More instructions… IfcreditRate > 0.5 Then Range("A10").Value = "Approved!" Else Range("A10").Value = "Rejected" EndIf creditRate > 50% Print “Rejected” Print “Approved” ...
The “else” Is Optional ... cr. rate > 50% If creditRate > 0.5 Then Range("A10").Value = "Approved!" EndIf Print “Approved” ...
Tests AND: if (creditRate > 0.5 ) And(age > 21) OR: if (creditRate <= 0.5 ) Or(age > 21) NOT: if Not (age = 21) alternatively you can use If age <> 21
Implementing a Decision Loop Ask the user the amount of principal in $ Principal <= $0 Dim inputFromUser As String Do inputFromUser = InputBox(“Amount of principal?") principal = Double.Parse(inputFromUser) LoopWhileprincipal <= 0
Implementing a Nested Loop Do ‘ Task A Do inputFromUser = InputBox(“Principal?")principal=double.Parse(inputFromUser) LoopWhile(inputFromUser <= 0) ‘ Task B inputFromUser = InputBox(“Want to quit?") LoopWhile(inputFromUser <> “y”) Task A Ask the user the amount of principal in $ Less than / equal to $0 Task B want to quit (n=no)? n y
Math Functions • interest = Principal * [(1+ Interest Rate)t – 1] • interest = principal * Application.WorksheetFunction.Power((1 + interestRate), t) • interest = principal * ((1 + interestRate) ^ t) - 1)
An Alternative to IF…THENWhen There Are Multiple Options SelectCasetextFromUser Case a Range(“B5").Value(“This is case a")‘ More instructions… Case b Range(“B5").Value(“This is case b")‘ More instructions… Case Else Range(“B5").Value(“this is the Default") ‘ More instructions… EndSelect Ask the user a b default Print Output Print Output Print Output
A More Interesting Case Dim number AsInteger ‘other code in here... SelectCase number Case 1 To 5 Range("A1").Value("Between 1 and 5, inclusive") Case 6, 7, 8 Range("A1").Value("Between 6 and 8, inclusive") Case 9 To 10 Range("A1").Value("Equal to 9 or 10") Case Else Range("A1").Value("Not between 1 and 10, inclusive") EndSelect Source: MSDN
Suggestions • Be careful about uploading • Google is your friend • Come and see me.