Presentation is loading. Please wait.

Presentation is loading. Please wait.

Process Automation: From models to code

Similar presentations


Presentation on theme: "Process Automation: From models to code"— Presentation transcript:

1 Process Automation: From models to code
Jobs and tools

2 Critical thinking Going well Want a book? See the web site
Googling for solutions is ok, copying and pasting from a classmate is not. EasyMeter 

3 Homework H4 - Fin Cal Part II

4 It begins with figuring out what needs to be done
Hey, I really liked your financial calculator! Could you add to it a table that shows interest and principal from year 0 to the end? User perspective “Use cases” Talk about it Sketch it Show it Prototype with paper and pencil

5 Activity Diagram (part II) Simple Financial Calculator
User inputs principal, years, and interest rate User presses “print table” button Principal, Year, or Rate is missing Alert the user Print and format table header i > number of years Format data and autofit the columns i <= number of years Print the ith row of data

6 You Do The Talking Name Learning objectives
What you like about the class so far What can be improved Attitude towards the Tournament?

7 How VS works Coding Compiling Requirements: What needs to be done
Visual Studio Excel Requirements: What needs to be done Visual Studio is an IDE Coding Compiling Source code file in a computer language Runnable program .exe, .dll C#, VB, C++

8 Variables are named places in memory where you store information
To create a variable, you declare it (Dim) and you tell the computer what type of info you want to store in it (e.g., an integer, a double, a string, a range). Dim myInterest as double = 0 Dim userInput as string = “Stefano” To change its content, you use the assignment operator “=” myInterest = 0.05 To use the variable stored value, you just write its name Dim newVariable as double = 0 newVariable = myInterest * 2

9 Excel CELLS Are objects with properties and behaviors.
No need to pre-specify what kind 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 Range("A2", "B10").Value = "Wow!"

10 What Is New In Technology?
WINIT What Is New In Technology?

11 Introduction to Visual Basic
From models to code Introduction to Visual Basic

12 Implementing a Decision
... Dim creditRate as Double ‘ More instructions… If creditRate > 0.5 Then Range("A10").Value = "Approved!" Else Range("A10").Value = "Rejected" End If creditRate > 50% Print “Rejected” Print “Approved” ...

13 The “else” Is optional ... If creditRate > 0.5 Then
cr. rate > 50% If creditRate > 0.5 Then Range("A10").Value = "Approved!" End If Print “Approved” ...

14 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

15 Implementing a For…next loop
Print and format table header i > number of years Format data and autofit the columns i <= number of years Print the ith row of data For i As Integer = 0 To years Range("H4").Offset(i, 0).Value = i interest = principal * ((1 + interestRate)^i -1) Range("H4").Offset(i, 1).Value = interest Next

16 Suggestions Give yourself plenty of time Google is your friend
Come and see me.

17


Download ppt "Process Automation: From models to code"

Similar presentations


Ads by Google