Você está na página 1de 32

O LYMPIA B USINESS S CHOOL

School of Computing & Information Science

DIPLOMA IN INFORMATION SYSTEMS

F ILO -T EXT
Programming Language (Foxpro)
December, 1997 12 weeks

R AFFLES E DUCATION G ROUP


Kuala Lumpur w Petaling Jaya w Penang w Singapore w Jakarta w Bangkok w Beijing w London w New-York

School of Computing & Information Science

Programming Language (Foxpro)

T ABLE

OF

C ONTENT

Raffles Education Group ......................................................................................................................... 1 TABLE OF CONTENT ................................................................................................................................. 2 INTRODUCTION.......................................................................................................................................... 3 THE SUBJECT PROGRAMMING LANGUAGE (FOXPRO) ................................................................................... 3 HOW TO USE THE FILO-TEXT? ............................................................................................................... 4 ASSESSMENT ............................................................................................................................................... 5 INDIVIDUAL ASSIGNMENT ............................................................................................................................ 5 MID-TERM E XAMINATION............................................................................................................................. 5 TEAM PROJECT............................................................................................................................................. 5 FINAL E XAMINATION.................................................................................................................................... 6 ATTENDANCE.............................................................................................................................................. 6 FEES............................................................................................................................................................... 6 CONTACT-TIME.......................................................................................................................................... 7 FULL-TIME ................................................................................................................................................... 7 PART-TIME ................................................................................................................................................... 7 THE ACADEMIC TEAM ............................................................................................................................. 8 THE ACADEMIC PLANNER....................................................................................................................... 9 WEEK 1 ....................................................................................................................................................... 10 WEEK 2 ....................................................................................................................................................... 12 WEEK 3 ....................................................................................................................................................... 14 WEEK 4 ....................................................................................................................................................... 16 WEEK 5 ....................................................................................................................................................... 18 WEEK 6 ....................................................................................................................................................... 20 WEEK 7 ....................................................................................................................................................... 22 WEEK 8 ....................................................................................................................................................... 24 WEEK 9 ....................................................................................................................................................... 26 WEEK 10 ..................................................................................................................................................... 28 WEEK 11 ..................................................................................................................................................... 30 WEEK 12 ..................................................................................................................................................... 32

Olympia Business School

Page 2

SCIS/HOD/971201

School of Computing & Information Science

Programming Language (Foxpro)

I NTRODUCTION

THE SUBJECT

PROGRAMMING LANGUAGE (FOXPRO)

In this subject, the student will be introduced to a new way of programming and managing data using a very powerful programming language fully dedicated to data base management: namely FoxPro. More over, since FoxPro is a MS-Windows application (which runs under MS-Windows), one will take the profit of this rich graphical interface and hence develop and implement highly powerful and easy-to-use management applications. This subject is divided into 11 topics tightly dependent; indeed, one will start with learning how to use this RDBMS (Relational Data Base Management System) which is FoxPro, in order to get familiar with its interface. In the second week, one will learn the new lexicons and concepts related to the data base management; the third week, one will create ones first table and manage it. The second part (from week 4 to week 11), we will get into the realm of programming using FoxPro, we will discover how to: Create variables and compute with expressions, Make decision and control the information flow, Input and output data, Create ones windows, Write well structured and modular programs using procedures and functions, Program good interface for data entry, Set the whole system according to ones needs.

Upon completing this subject, the student will have developped a sound understanding of RDBMS programming and will have a fair ability to write medium size applications in FoxPro. Enjoy yourself!

Olympia Business School

Page 3

SCIS/HOD/971201

School of Computing & Information Science

Programming Language (Foxpro)

H OW

TO USE THE

F ILO -T EXT ?

The Filo-text is a tool providing you guidance for this subject. It provides you a general information on the following: Assessment Attendance Fees Contact time The academic team The academic planner

For every week, it then provides you with the following information: The topic The objective(s) of the lecture The textbook and the chapter(s) and page(s) related to the given topic The other reference books available to you in the library Additional reference material for your own research The objective(s) of the tutorial Questions to prepare for discussion during the tutorial Questions for your personal research

Use the Filo-text to prepare yourself prior to the lecture, between the lecture and the tutorial and after the tutorial.

Olympia Business School

Page 4

SCIS/HOD/971201

School of Computing & Information Science

Programming Language (Foxpro)

A SSESSMENT
Student assessment will be evaluated based on the following breakdown: 1) 2) 3) 4) Individual Assignment Mid-Term Examination Team Project Final Examination 15 % 15 % 20 % 50 % 100 %

Total INDIVIDUAL ASSIGNMENT

An individual assignment will be given to the student on the first week and will have to be returned no later than week 6. The marked assignment will be returned to the student by no later than week 8. The assignment will be related to the topics covered between week 1 and week 4 inclusive. It will comprise a written report of approximately 1000 words. Should the student fail to submit his/her assignment on week 6, the result will automatically be nil. MID-TERM EXAMINATION A mid-term examination will be conducted during the lecture session of week 8. It will assess the students knowledge and understanding of the topics covered up to week 6. The results, together with the answer scripts, will be returned to the students no later then week 10. Should a student be absent without a valid apology, the result will automatically be nil. TEAM PROJECT A team project will be assigned to students during the first week. The team will comprise of 4 to 6 students. The report of the team project will have to be submitted to the subject lecturer by no later than week 10 and will be presented on week 11. Late submission wont be entertained and will automatically result in no marks being awarded.

Olympia Business School

Page 5

SCIS/HOD/971201

School of Computing & Information Science

Programming Language (Foxpro)

FINAL EXAMINATION The final examination will be conducted on week 13 or week 14 and its duration will be 3 hours. Registration for the examination is open from week 3 and is closing on week 6. Make sure you register on time. No late registration will be entertained. The format of the examination is as follows: Section A Section B Total Short Answer Questions Essay-type Questions 5 * 4 Points Any 4 out of 6 * 20 Points 100 Points

A TTENDANCE
Attendance for both the lectures and the tutorials is compulsory. Any student not attending a class should provide a medical certificate or a written justification (signed by a parent or guardian in the case of a full-time student). Should a student fail to do so, he/she will be considered truant. Should a student attendance for a given subject be lower then 70 %, he/she will not be allowed to sit for the final examination. Punctuality is equally important. The lecturer is entitled to refuse entry into the classroom to any student that would present him/herself late.

F EES
The registration fee is to be paid upon registration. The course fee is paid either in full, per semester or by instalments. For payments made in full, the payment is due before the first lecture. For payments made by semester, the payment per semester is due on the first day of the semester. For monthly instalments, the first payment is due on the first day of classes while the subsequent payments are due on the first day of each subsequent month. Should any student have difficulty to pay his/her fees on time, he/she must meet with the (Deputy) Principal to arrange an alternative. Any student that would not have settled his/her fees and would not have met with the (Deputy) Principal will not be allowed to attend classes nor to sit for an examination.

Olympia Business School

Page 6

SCIS/HOD/971201

School of Computing & Information Science

Programming Language (Foxpro)

C ONTACT -T IME

FULL-TIME The duration of the classes is 12 weeks. Contact time consists of 1 1/2 hours of lecture and 1 1/2 hours of tutorial per week. PART-TIME The duration of the classes is 12 weeks. Contact time consists of 1 hours of lecture per week. For each hour of contact, the student is expected to spend at least 2 hours of unsupervised work, be individually or in group.

Olympia Business School

Page 7

SCIS/HOD/971201

School of Computing & Information Science

Programming Language (Foxpro)

T HE A CADEMIC T EAM
At the beginning of the first lecture, please fill-in the following:

Day

Time Starting Finishing

Room

Lecture Lecturer Consultation Tutorial Tutor Consultation Class Lecturer Consultation Lecturer-in-Charge Consultation Principal Consultation Head of Department Consultation Subject Representative

Olympia Business School

Page 8

SCIS/HOD/971201

School of Computing & Information Science

Programming Language (Foxpro)

T HE A CADEMIC P LANNER
Here is an outline of the topics you will cover, week after week. Week 1 2 3 Date Topic Getting started Database management system Creating and working with tables, sorting and indexing files 4 5 6 7 8 9 10 11 12 13 & 14 Variables and expressions Control flow Programming with FoxPro Input and output User deifned windows Functions and procedures Programming for data entry and editing Environment Synthesis Final Examination

Olympia Business School

Page 9

SCIS/HOD/971201

School of Computing & Information Science

Programming Language (Foxpro)

W EEK 1
Lectures Subject: Lectures Objectives: On completion of this lecture, the student will have acquired the following: Textbook: Chapter(s) FoxPro 3.0 for MS-Windows: Developers Guide Reference Books: Chapter(s) FoxPro through examples: A reference for beginners and developers. Running FoxPro for MS-Windows. Additional Reference Material: 1) Instructors Guide to Microsoft FoxPro For Windows Step by Step. 1 1 Pages 1-17 3-8 1 Pages 1-32 An introduction to RDBMS and Visual FoxPro. Its objectives. The system requirements. GETTING STARTED

Olympia Business School

Page 10

SCIS/HOD/971201

School of Computing & Information Science

Programming Language (Foxpro)

Tutorials Subject: Tutorials Objectives:

GETTING STARTED

On completion of this tutorial, the student will have acquired the following: Starting FoxPro in different ways. Get familiar with its interface. Work with the DESIGNER. Create the first table (file of information) and work on it.

Questions to prepare for discussion during the tutorial: 1) 2) 3) 4) 5) Start FoxPro with the button START. Start FoxPro with the MS-Office Tool Bar. Create a new program. Create a new table and give to it a structure (its fields). Fill it with some information, then browse it.

Questions available for self-assessment: 1. How do you start Visual FoxPro without using MS-Office 95 Toolbar in MS-Windows 95 environment? 2. How do you start Visual FoxPro if you have MS-Office 95 Toolbar ? 3. How do you create new project ? 4. What does the Project Manager consist of ? 5. What is the main function of the expanding / collapsing button? 6. What does the database designer display ? 7. What is the shortcut button to get a new file menu ? 8. What does Visual FoxPro display when Database Designer window is active ? 9. Create a new table using the DESIGNER. 10. Fill it with some records and browse it.

Olympia Business School

Page 11

SCIS/HOD/971201

School of Computing & Information Science

Programming Language (Foxpro)

W EEK 2
Lectures Subject: Lectures Objectives: On completion of this lecture, the student will have acquired the following: Textbook: Chapter(s) FoxPro 3.0 for MS-Windows: Developers Guide Reference Books: Chapter(s) FoxPro through examples: A reference for beginners and developers. Running FoxPro for MS-Windows. Additional Reference Material: 1) Instructors Guide to Microsoft FoxPro For Windows Step by Step. 2 1 Pages 18-27 8-12 2 Pages 33-54 Understanding database concepts. Relational terms. Categories of DBMS (Data Base Management System). Simple language for database management. Simple commands on a database file. The structure of a FoxPro program. DATABASE MANAGEMENT SYSTEM

Olympia Business School

Page 12

SCIS/HOD/971201

School of Computing & Information Science

Programming Language (Foxpro)

Tutorials Subject: Tutorials Objectives:

DATABASE MANAGEMENT SYSTEM

On completion of this tutorial, the student will have acquired the following: Using the command window to write commands. Create a new table and manage it.

Questions to prepare for discussion during the tutorial: 1) 2) 3) 4) 5) Create a new table giving it a name and a structure (fields). Fill this table with some records. List the information of the table. Close all the tables. Try to list your table once again.

Questions available for self-assessment: 1) 2) 3) 4) 5) 6) 7) 8) 9) Discuss database concepts. What are the differences between hierarchical model and network model ? What is the relational model ? What is a field ? What is a record? What is a primary key? Explain the entity integrity. What are the set of eight operations in relational algebra? Explain each one of them.

10) How to write a command

Olympia Business School

Page 13

SCIS/HOD/971201

School of Computing & Information Science

Programming Language (Foxpro)

W EEK 3
Lectures Subject: Lectures Objectives: On completion of this lecture, the student will have acquired the following: Textbook: Chapter(s) FoxPro 3.0 for MS-Windows: Developers Guide Reference Books: Chapter(s) FoxPro through examples: A reference for beginners and developers. Running FoxPro for MS-Windows. 4 11 7 Additional Reference Material: 1) Instructors Guide to Microsoft FoxPro For Windows Step by Step. Pages 56-77 287-298 143-172 17 Pages 559-620 Creating tables and working on their structure. Sorting data according to a certain order. Indexing files. Managing records (Adding, Deleting and Modifying). CREATING AND WORKING WITH TABLES, SORTING AND INDEXING FILES

Olympia Business School

Page 14

SCIS/HOD/971201

School of Computing & Information Science

Programming Language (Foxpro)

Tutorials Subject: Tutorials Objectives:

CREATING AND WORKING WITH TABLES, SORTING AND INDEXING FILES

On completion of this tutorial, the student will have acquired the following: Creating tables using the command window. Filling it with information in an interactive way. Ordering information. Creating an index for a table. Working with the index file.

Questions to prepare for discussion during the tutorial: 1) 2) 3) 4) 5) Create a table. Display its structure. Sort the table according to its primary key . Index the table according to its primary key. Close all the opened tables and try to list your table.

Questions available for self-assessment: 1) How do you create a new table? 2) Which command do you use if you want to edit an existing DBF files list of fields? 3) Which command do you use to create a new table? 4) Write the command to close all open tables. 5) Write the syntax for SORT command. 6) Which command do you use to create a new index file? 7) Write the syntax for INDEX command. 8) What is the reason of using SET INDEX TO command? 9) What is the reason of using SET ORDER TO command? 10) Why do we need to use REINDEX command?

Olympia Business School

Page 15

SCIS/HOD/971201

School of Computing & Information Science

Programming Language (Foxpro)

W EEK 4
Lectures Subject: Lectures Objectives: On completion of this lecture, the student will have acquired the following: Textbook: Chapter(s) FoxPro 3.0 for MS-Windows: Developers Guide Reference Books: Chapter(s) FoxPro through examples: A reference for beginners and developers. Running FoxPro for MS-Windows. Additional Reference Material: 1) Instructors Guide to Microsoft FoxPro For Windows Step by Step. 5 10 Pages 11-123 265-285 4 Pages 87-103 Knowledge of data object attributes. Knowledge of how to use data types and identifiers. Working with memvars and use arrays. Using operands, constants and variables. Working with different kinds of expressions. VARIABLES AND EXPRESSIONS

Olympia Business School

Page 16

SCIS/HOD/971201

School of Computing & Information Science

Programming Language (Foxpro)

Tutorials Subject: Tutorials Objectives:

VARIABLES, AND EXPRESSIONS

On completion of this tutorial, the student will have acquired the following: Working with different data types. Understanding the precedence rule of expressions. Writing simple programs that manipulate different data and data types with different expressions.

Questions to prepare for discussion during the tutorial: 1) 2) 3) Write a program in which you create three memvars named a, b and c ; their type is character and their value is very easy. write a program in which you create two memvars a1 (numeric, value 20) and b1 (15 characters, value LIM); a1 receives the result of a+10, b1 receives KUALA. Let a=10, b=20, c=30 and d=40. Logic = ! ((a+b)<(c-d)) and ((d+b)>(a+c)) What is the type and the value of Logic? Change a and c so that the value of Logic changes 4) Create I, j and h and assign to them 1, 20 and Salem Assign j to I Assign h to I 5) Write a program that computes the salary, given the rate and the hours.

Questions available for self-assessment: 1) Write down the data types recognized by FoxPro. 2) Which commands can create memvars? 3) Which commands do we use to create arrays? 4) What are operands? 5) List and describe logical operators. 6) List and describe relational operators. 7) List and describe numeric operators. 8) List precedence rules for FoxPro. 9) What is the command that assign a value to many variables at once? 10) What is the command that assign each value to each variables?

Olympia Business School

Page 17

SCIS/HOD/971201

School of Computing & Information Science

Programming Language (Foxpro)

W EEK 5
Lectures Subject: Lectures Objectives: On completion of this lecture, the student will have acquired the following: Working with the selection structures by using: * The IF command. * The DO CASE command. Working with the repetitive structures by using: * The FOR command. * The DO WHILE command. * The SCAN command. Textbook: Chapter(s) FoxPro 3.0 for MS-Windows: Developers Guide Reference Books: Chapter(s) FoxPro through examples: A reference for beginners and developers. Running FoxPro for MS-Windows. Additional Reference Material: 1) Instructors Guide to Microsoft FoxPro For Windows Step by Step. 7 14 Pages 137-150 472-482 6 Pages 185-193 CONTROL FLOW

Olympia Business School

Page 18

SCIS/HOD/971201

School of Computing & Information Science

Programming Language (Foxpro)

Tutorials Subject: Tutorials Objectives:

CONTROL FLOW

On completion of this tutorial, the student will have acquired the following: Code programs with sequencing, selective and iterative structures.

Questions to prepare for discussion during the tutorial: 1) 2) 3) 4) 5) Write a program that outputs the following (1,2,3,4,6,7,8,9) Write a program that assign grades to the Dbfile Student.dbf according to their marks. Write a program that receives 10 integers, store them into an array and sort them according to the ascendant order. Write a program that compute the sum of the first 100 integers. Write a program that compute the product of the first 100 integers.

Questions available for self-assessment: 1) Write down a simple source code to display the even numbers between 0 and 60 by using FOR command. 2) Write down a simple source code to display the odd numbers between 0 and 60 by using FOR command. 3) Write down a simple source code to display the even numbers between 0 and 60 by using DO WHILE... ENDDO command. 4) Write down a simple source code to display the odd numbers between 0 and 60 by using DO WHILE... ENDDO command. 5) Explain the IF command. 6) Explain the DO WHILE command. 7) Explain the FOR command. 8) Explain the DO CASE command. 9) Explain the SCAN command. 10) Give an example of using SCAN command.

Olympia Business School

Page 19

SCIS/HOD/971201

School of Computing & Information Science

Programming Language (Foxpro)

W EEK 6
Lectures Subject: Lectures Objectives: On completion of this lecture, the student will have acquired the following: Textbook: Chapter(s) FoxPro 3.0 for MS-Windows: Developers Guide Reference Books: Chapter(s) FoxPro through examples: A reference for beginners and developers. Running FoxPro for MS-Windows. 7 14 Pages 137-150 478-482 6 Pages 185-193 Understanding the structure of a FoxPro program. Writing methodical and simple programs. PROGRAMMING WITH FOXPRO

Additional Reference Material: 1) Instructors Guide to Microsoft FoxPro For Windows Step by Step.

Olympia Business School

Page 20

SCIS/HOD/971201

School of Computing & Information Science

Programming Language (Foxpro)

Tutorials Subject: Tutorials Objectives:

PROGRAMMING WITH FOXPRO

On completion of this tutorial, the student will have acquired the following: Writing programs that are simple and understandable

Questions to prepare for discussion during the tutorial: 1) Let a Dbfile Stud.dbf with the following structure (ID N(2), NAME C(15) and Mark N(3)).

Write a program that fills the Stud.dbf with some students. The process should stop when 99 is entered into the ID. 2) 3) 4) 5) Write a program that lists all the students who obtained more than 70. Write a program that compute the average, the minimum and the maximum of the student marks. Write a program that displays all the student who are very intelligent (>90) or very weak (<20). Write a program that add 5 marks for all those who are very weak.

Questions available for self-assessment: 1) Write a program that can verify whether input number is even or odd. 2) Write a program that can verify whether input number is greater or less than 100. 3) Write a program that can add discount 2% to the purchase if more than $1000. 4) Write a program to generate a table of prime numbers. 5) Write a program to find an individual data from existing database. 6) Write a program for the following conditions: Allow the user to enter the numbers (from 1 to 10) and display each of them in English. 7) Write a main program to check the password. 8) Write a program that checks if a given number is a multiple of 5. 9) Write a program that display all the integers laid between 15 and 35 (except 28) 10) Write a program that finds the smallest and the largest number of a series of integers that must be already stored into an array.

Olympia Business School

Page 21

SCIS/HOD/971201

School of Computing & Information Science

Programming Language (Foxpro)

W EEK 7
Lectures Subject: Lectures Objectives: On completion of this lecture, the student will have acquired the following: Textbook: Chapter(s) FoxPro 3.0 for MS-Windows: Developers Guide Reference Books: Chapter(s) FoxPro through examples: A reference for beginners and developers. Additional Reference Material: 1) Instructors Guide to Microsoft FoxPro For Windows Step by Step. 3 Pages 32-53 8 Pages 271-338 Using the input and output commands to interact with the user. Understanding the Low-Level File Input Output. INPUT AND OUTPUT

Olympia Business School

Page 22

SCIS/HOD/971201

School of Computing & Information Science

Programming Language (Foxpro)

Tutorials Subject: Tutorials Objectives:

INPUT AND OUTPUT

On completion of this tutorial, the student will have acquired the following: Write programs that provide: Input interface to the user. Output interface to the user.

Questions to prepare for discussion during the tutorial: 1) 2) 3) 4) 5) Write all the commands that assign a string of characters to a variable. Write all the commands that assign a numeric value to a variable. Write a command that assigns a string of characters to 3 variables. Write a program that ask the user to input some marks for some students. (use Stud.dbf) write a program that output only the students who got more than 65. (use Stud.dbf)

Questions available for self-assessment: 1) Describe the main input operations command. 2) Explain the ACCEPT command. 3) Explain the INPUT command. 4) Explain the WAIT command. 5) Write a simple program to demonstrate WAIT command. 6) Write a simple program to demonstrate ACCEPT command. 7) Describe the main output operations command. 8) Explain the DISPLAY command. 9) Explain the LIST command. 10) What is the main difference between DISPLAY and LIST ?

Olympia Business School

Page 23

SCIS/HOD/971201

School of Computing & Information Science

Programming Language (Foxpro)

W EEK 8
Lectures Subject: Lectures Objectives: On completion of this lecture, the student will have acquired the following: Textbook: Chapter(s) FoxPro 3.0 for MS-Windows: Developers Guide Reference Books: Chapter(s) FoxPro through examples: A reference for beginners and developers. 7 Pages 156-162 7 Pages 223-269 Creating programs that use the good user interface of MS-Windows Defining windows, their coordinates, borders, etc. Activating and deactivating windows. Showing, hiding and modifying windows. USER DEFINED WINDOWS

Additional Reference Material: 1) Instructors Guide to Microsoft FoxPro For Windows Step by Step.

Olympia Business School

Page 24

SCIS/HOD/971201

School of Computing & Information Science

Programming Language (Foxpro)

Tutorials Subject: Tutorials Objectives:

USER DEFINED WINDOWS

On completion of this tutorial, the student will have acquired the following: Write programs to: Create a user defined window Direct some output to specified user defined window. Manage a set of user defined windows in an organized manner.

Questions to prepare for discussion during the tutorial: 1) Write a program that : 2) Create a window called MyWindow Activate it, deactivate it, show it, hide it and modify it.

Write a program that creates two windows called tens and cents respectively. Arrange to display the integers (10 to 90) in the first window and the integers (100 to 900) in the second one.

3) 4) 5)

Continuing the precedent program, direct all the even numbers (0,2,3,4,, 20) to the first window and all the odd numbers to the second one with an alternatively way. Continuing the precedent program, save your two windows in your floppy disk, then try to load them back from your diskette. Write a program that create a window with a special type of border and a given scheme of color.

Questions available for self-assessment: 1) Explain the DEFINE WINDOW. 2) Explain the ACTIVATE WINDOW. 3) Explain the SHOW WINDOW. 4) Explain the HIDE WINDOW. 5) Explain the MODIFY WINDOW. 6) Explain the DEACTIVATE WINDOW. 7) Explain the SAVE WINDOW. 8) Explain the RESTORE WINDOW. 9) Explain the MOVE WINDOW. 10) Explain the ZOOM WINDOW.

Olympia Business School

Page 25

SCIS/HOD/971201

School of Computing & Information Science

Programming Language (Foxpro)

W EEK 9
Lectures Subject: Lectures Objectives: On completion of this lecture, the student will have acquired the following: Textbook: Chapter(s) FoxPro 3.0 for MS-Windows: Developers Guide Reference Books: Chapter(s) FoxPro through examples: A reference for beginners and developers. 6 Pages 203-222 8 Pages 175-195 The interest of coding and implementing modular and well structured programs. Writing functions and using predefined ones. Writing procedures that handle some tasks. Differentiating between functions and procedures. FUNCTIONS AND PROCEDURES

Additional Reference Material: 1) Instructors Guide to Microsoft FoxPro For Windows Step by Step.

Olympia Business School

Page 26

SCIS/HOD/971201

School of Computing & Information Science

Programming Language (Foxpro)

Tutorials Subject: Tutorials Objectives:

FUNCTIONS AND PROCEDURES

On completion of this tutorial, the student will have acquired the following: Writing modular programs by the mean of procedures and functions. Using predefined functions. Knowing when to use a procedure instead of a function and vice versa.

Questions to prepare for discussion during the tutorial: Let stud.dbf a table with (ID N(2), NAME C(15), MARK1 N(2), MARK2 N(2) and grade C(1) ) its structure: 1) 2) 3) 4) 5) Write a procedure called FILL that fills some records into the database file Stud.dbf ; the process should stop once the user key in 99 in the ID. Write a procedure called Listing that displays only the name and the mark of each student. Write a function called MeanMark that compute the average of a students marks . Write a function called FillGrade that fills GRADE with (A, B, C, D, F) according to the result computed by the former function MeanMark. Put all these pieces altogether to form a whole program that manages students marks.

Questions available for self-assessment: 1) Give an example of a program structure with multiple procedures. 2) Define user defined functions. 3) Write a function to find the square value of a certain integer. 4) Write a function to find the summation of 1+2+........10. 5) Write a function to find the product of 1*2*........10. 6) Write a function to find the cube of a certain integer. 7) Write a function to find the factorial numbers. 8) Write a function to calculate the mean of five input numbers. 9) Write a function to find the smallest of ten integers. 10) Write a procedure that store ten integers into an array and display them ordered.

Olympia Business School

Page 27

SCIS/HOD/971201

School of Computing & Information Science

Programming Language (Foxpro)

W EEK 10
Lectures Subject: Lectures Objectives: On completion of this lecture, the student will have acquired the following: Textbook: Chapter(s) FoxPro 3.0 for MS-Windows: Developers Guide Reference Books: Chapter(s) FoxPro through examples: A reference for beginners and developers. 7 Pages 143-145 9 Pages 339-449 Sending output to the screen or an active window in a formatting manner. Entering data into a program with a an easy-to-use format. Creating easy-to-use interfaces of input and output. PROGRAMMING FOR DATA ENTRY AND EDITING

Additional Reference Material: 1) Instructors Guide to Microsoft FoxPro For Windows Step by Step.

Olympia Business School

Page 28

SCIS/HOD/971201

School of Computing & Information Science

Programming Language (Foxpro)

Tutorials Subject: Tutorials Objectives:

PROGRAMMING FOR DATA ENTRY AND EDITING

On completion of this tutorial, the student will have acquired the following: Writing programs with good and easy-to-use interfaces. Displaying information at specified location in the screen.

Questions to prepare for discussion during the tutorial: Let a DB File CUSTOM.DBF (No N(2), NAME C(15), FUND N (8.2)). 1) 2) Create Customer.dbf and fill it with some customers information Display at row 3, column 4 the message Filling Process.

Give the user a framework of filling (the user should have a kind of a format easy-to-use in the filling process) 3) 4) 5) Write a program that displays the information already entered in a comprehensible format. Write a program that draw a box using SET BORDER TO. Write a program that can display a bitmap file in your FoxPro program.

Questions available for self-assessment: 1) Explain the @ command and READ command. 2) Write a program to create a simple input form by using @....SAY....GET command. 3) How can you display bitmap files by using @....SAY command? 4) Write a program to check any account number. 5) Explain the @......EDIT command. 6) Explain the SET BORDER TO. 7) Explain the SET FORMAT TO. 8) What are the full screen data editing commands? 9) What is the syntax of APPEND command? 10) Write the syntax for CHANGE command.

Olympia Business School

Page 29

SCIS/HOD/971201

School of Computing & Information Science

Programming Language (Foxpro)

W EEK 11
Lectures Subject: Lectures Objectives: On completion of this lecture, the student will have acquired the following: Textbook: Chapter(s) FoxPro 3.0 for MS-Windows: Developers Guide Reference Books: Chapter(s) FoxPro through examples: A reference for beginners and developers. 7 Pages 140-142 10 Pages 451-554 Set the entire environment to meet ones needs. Enable and disable the system parameters. ENVIRONMENT

Additional Reference Material: 1) Instructors Guide to Microsoft FoxPro For Windows Step by Step.

Olympia Business School

Page 30

SCIS/HOD/971201

School of Computing & Information Science

Programming Language (Foxpro)

Tutorials Subject: Tutorials Objectives:

ENVIRONMENT

On completion of this tutorial, the student will have acquired the following: Using the various commands of setting the environment (SET commands). Using the various predefined functions for setting and getting the system status (SET() functions).

Questions to prepare for discussion during the tutorial: 1) 2) 3) Write a program that display the current date in many formats. Write a program that read a Dbfile from your computer and copy it to your floppy disk. Write a program that compare if two strings are exactly the same and in an other occasion, if two strings equivalent from the point of view that one is at least equal to the other. Write a program that display the clock in a location that you specify. Write a program that direct the output (records of a database) to the printer.

4) 5)

Questions available for self-assessment: 1) Explain the DISPLAY STATUS command. 2) Explain the LIST STATUS command. 3) Write a program that illustrates usage of SET BORDER command. 4) How can you specify a COLOR clause to override the current color of an object to the screen? 5) Explain the COLOR clause. 6) Explain the SET COLOR OF SCHEME? 7) What does the SET CURRENCY command control? 8) What does the SET CURSOR command control? 9) What does the SET DATE command change? 10) What does the SET DEVICE command control?

Olympia Business School

Page 31

SCIS/HOD/971201

School of Computing & Information Science

Programming Language (Foxpro)

W EEK 12
Lectures Subject: Lectures Objectives: On completion of this lecture, the student will have acquired the following: Textbook: Chapter(s) FoxPro 3.0 for MS-Windows: Developers Guide Reference Books: Chapter(s) FoxPro through examples: A reference for beginners and developers. Pages Pages Ability to integrate all aspects covered up to this stage SYNTHESIS

Additional Reference Material: 1) 2) Instructors Guide to Microsoft FoxPro For Windows Step by Step. Microsoft Visual FoxPro 3 for Windows Step by Step By Catapult, Inc; Softcover; 266 Pages Published by Microsoft Press; 12/95; ISBN: 1556158467 3) Teach Yourself... Visual FoxPro 5.0 for Windows By King, Nelson; Softcover; 525 Pages Published by MIS Press; 01/97; ISBN: 1558285199

Tutorials Subject: Tutorials Objectives:

SYNTHESIS

On completion of this tutorial, the student will be ready to sit for the final examination Good luck!
Olympia Business School Page 32 SCIS/HOD/971201

Você também pode gostar