learning about expert systems through computer programming

32
Learning about Expert Systems through computer programming

Upload: angela-bond

Post on 28-Dec-2015

226 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Learning about Expert Systems through computer programming

Learning about Expert Systems through computer programming

Page 2: Learning about Expert Systems through computer programming

• The exercises we are doing are designed to give students:– Exposure– A deeper– An

• Material has gone through the academic review process– Presented at the 2004 AIS Educator Conference: received a Best

Paper award– Published in the Review of Business Information Systems in 2005

(volume 9, number 1)– Presented as hands-on training sessions at the 2005 and 2006 AIS

Educator Conference.– Presented as part of an Effective Learning Strategies poster

presentation at the 2007 American Accounting Association annual meeting.

– This material has led to other VB instructional material published by the AAA , as well as presentations at other AIS Educator Conferences (Interacting with a database using VB.NET)

Page 3: Learning about Expert Systems through computer programming

Programming helps build business competencies • Programming helps develop and improve problem

– Increased ability to handle more complex issues and problems (Beard and Smith 2002)

– Will develop critical thinking skills that are (Fordham 2005)

• AICPA core competency: ability to (2004)

• The lack of programming skills may handicap accountants in working effectively as IS auditors (Calderon, Cheh, Chatham 2002)

• The Information Systems Audit and Control Association (ISACA) has developed curriculum models stressing the need and importance of computer programming skills.

• Even if you never program in your career, having these types of skills can change how you look at things.

Page 4: Learning about Expert Systems through computer programming

Types of programming that you might experience

• Creating a• Creating

• Creating Visual Basic programs– VB is one of the easiest programming languages to learn

and use• Using VBA

– V– Programming language used in Microsoft Office (especially

Excel) that integrates the application software functionality with the Visual Basic language.

– Macro programming in Excel

Page 5: Learning about Expert Systems through computer programming

When a computer program is created, what are the two primary components?

• The (GUI)– What the

• Icons, windows and other controls that can be clicked or double clicked in order for the computer to do something.

• The actual– The

– The computer doesn’t know what to do unless there is some sort of program or code that tells it what must be done and how it is to be done.

• VB is an• VB only

Page 6: Learning about Expert Systems through computer programming

• Expert: one with special skill or knowledge representing mastery of a particular subject– Human experts reason through a problem/process, with

the end result being a recommended solution or diagnosis.

• Expert systems are a form of artificial intelligence that is designed to capture expertise and make that available for others to use– D– P

• Expert systems follow decision making rules, typically in the form of

Page 7: Learning about Expert Systems through computer programming

Expert System Decision Tree

Good

Income?

Education

Employment?

References?

Education

Bad

High

Low

High

Low

Grant the Loan

Grant the Loan

Investigate Further

Investigate Further

Investigate Further

Refuse the Loan

Refuse the Loan

Low

Medium

High

Employed

Unemployed

Page 8: Learning about Expert Systems through computer programming
Page 9: Learning about Expert Systems through computer programming
Page 10: Learning about Expert Systems through computer programming

• Label– Used to

• Button– Used to

• Radio button/option button– Allows the user

• Check box: Allows the user to select multiple options at the same time

• List box: Allows the user to select an option from a drop-down list

• Text Box: allows the user to provide data input for the program while the program is actually running (input which will then be used in various calculations/operations.

Page 11: Learning about Expert Systems through computer programming

• Windows Form Designer generated code– A by VB– Never delete or actively modify code in this section

• Don’t even open it up. • Your coding needs to go underneath this area.

• Event procedures are when a certain event

occurs– Our only

eventwill be theClick event

Page 12: Learning about Expert Systems through computer programming

• The Blue Words are reserved words in VB that have exact meaning in the VB syntax– Private Sub event procedures/sub routines– End Sub of an event procedure– Dim is a variable declaration statement

• Used

– M is a way to refer to the currently active form• Programmers typically indent their code to make

it easier to read (and find errors)

• .something indicatesaction

• Abbreviations used in naming

Page 13: Learning about Expert Systems through computer programming

Variables• M• Why called variables?

– Data stored in these memory locations

– O variables can be used to store anything and take up the greatest amount of memory space.

– String variables are used to store (letters and numbers not used in calculations)

– Numeric variables are used in • Integer, decimal, single, double, short, long

• How is a variable going to be used and what type of data will it store?

• See tutorial page 4

Page 14: Learning about Expert Systems through computer programming

IntelliSense• A VB feature that is “aware” of what you are doing and it

will provide suggestions and assistance regarding what you might want to include in the statement that you are coding (and it also checks your spelling

• Pressing the space bar adds the item currently highlighted in the IntelliSense listing to your code

Page 15: Learning about Expert Systems through computer programming

• M. This window will stay on the screen until the user has acknowledged it.

• The syntax of a message box statement is

MsgBox (“The message to display”, Buttons, “A title for the message box”)

– Message to display to the user (inside quote marks)– What types of icons and buttons should be displayed

inside the message box– Title text (which appears in the message box title bar

• MsgBox("Grant the Loan", MsgBoxStyle.Information, "Recommendation")

Page 16: Learning about Expert Systems through computer programming

• C is a form of internal program documentation that is It is used to clarify the purpose of a line or section of code. An signals the start of a comment.

Page 17: Learning about Expert Systems through computer programming

Radio Buttons (also known as )• Allow the user to select

from a group of options– Programmers typically use these in conjunction with

• Checkbox controls can also be used with selection statements. Checkboxes allow the user to select multiple options at the same time

Page 18: Learning about Expert Systems through computer programming

Selection Statements

• Allows a computer program to, depending on certain conditions in the data

or depending on user input– I statements are one of the

most common forms of selection statements.

• In 366, your IF statements selected one of two courses of action.

• Real computer programs have multiple courses of action inside IF statements (ElseIF)

• There can even be nested Ifs ( )

Page 19: Learning about Expert Systems through computer programming

Expert System Decision Tree

Good

Income?

Education

Employment?

References?

Education

Bad

High

Low

High

Low

Grant the Loan

Grant the Loan

Investigate Further

Investigate Further

Investigate Further

Refuse the Loan

Refuse the Loan

Low

Medium

High

Employed

Unemployed

Page 20: Learning about Expert Systems through computer programming
Page 21: Learning about Expert Systems through computer programming

Variables• Memory locations used to store data. The data stored in

these memory locations can change (vary) as the program runs.– Object variables can be used to store anything and take up the

greatest amount of memory space.– String variables are used to store a sequence of text (letters and

numbers not used in calculations)– Numeric variables are used in calculations

• Integer, decimal, single, double, short, long

• The variable ‘s data type is determined based on how is a variable going to be used and what type of data will be stored in that variable.

• The VB keyword used to declare a variable is:

Page 22: Learning about Expert Systems through computer programming

Variable Scope• When creating variables, programmers must

think about the scope of the variable.– Variable scope:

• A variable’s scope is determined by and the variable is declared– A variable declared

– A variable declared outside an event procedure (

. Any event procedure can access (and modify) variables in the general declarations area

Page 23: Learning about Expert Systems through computer programming
Page 24: Learning about Expert Systems through computer programming

Global Variables• Variables that can be shared across all forms have

global scope and those types of variables are referred to as

• Global variables are Code modules are shared by all forms

– Global variables are declared using a Public statement (rather than a Dim statement)

Page 25: Learning about Expert Systems through computer programming

Expert System Decision Tree

Good

Income?

Education

Employment?

References?

Education

Bad

High

Low

High

Low

Grant the Loan

Grant the Loan

Investigate Further

Investigate Further

Investigate Further

Refuse the Loan

Refuse the Loan

Low

Medium

High

Employed

Unemployed

Page 26: Learning about Expert Systems through computer programming

To create a code module• Go to the Project menu, select Add Module,

click once on module, then Add

Page 27: Learning about Expert Systems through computer programming

To create a code module• Go to the Project menu, select Add Windows

Form, click once on Windows Form, then Add

Page 28: Learning about Expert Systems through computer programming

• The Show method is used to• The Hide method is used to• E is the code used to end/stop/exit a program.

Page 29: Learning about Expert Systems through computer programming

Programmers use loops to repeat actions(the coding below simulates a loop)

Page 30: Learning about Expert Systems through computer programming

Properties• AutoSize:

– Does the control resize itself to fit its text? True or False

• Size property 128, 48 128 width, 48 height

• Text property: text displayed inside the control.

• Location property: – where on the form the control is located/found

Page 31: Learning about Expert Systems through computer programming

Properties• (Name) property: specifies the name of the

control/object. This name can also be used in the code and it also appears in IntelliSense– objFormEducation ExitButton– frmFinal.vb HighRadioButton

• You can also specify font size, font styles and background colors

• Visible (default is true), but can be set to false. Program code can be used to make a control visible or invisible as the program is running

Page 32: Learning about Expert Systems through computer programming

Properties• Checked property:

– changing from False to True causes an object (such as an option button) to be selected by default

– This can and should be set to ensure that the user selects an option (because if the user does not select an option, then the program may operate incorrectly or crash)

– See tutorial page 17 for explanation