24
C++ Implementation C++ Implementation ( Version 1 – Text ( Version 1 – Text Interface ) Interface ) Elimination of services of Elimination of services of our system. our system. General Flow of the General Flow of the program. program. Sample Output Results. Sample Output Results. Programming Algorithm Programming Algorithm Analysis. Analysis. Presented by Peter

C++ Implementation ( Version 1 – Text Interface ) Elimination of services of our system. Elimination of services of our system. General Flow of the program

Embed Size (px)

Citation preview

Page 1: C++ Implementation ( Version 1 – Text Interface ) Elimination of services of our system. Elimination of services of our system. General Flow of the program

C++ ImplementationC++ Implementation( Version 1 – Text Interface )( Version 1 – Text Interface )

Elimination of services of our Elimination of services of our system.system. General Flow of the program.General Flow of the program. Sample Output Results.Sample Output Results. Programming Algorithm Analysis.Programming Algorithm Analysis.

Presented by Peter

Page 2: C++ Implementation ( Version 1 – Text Interface ) Elimination of services of our system. Elimination of services of our system. General Flow of the program

Elimination of services of the Elimination of services of the system.system.

Functions that we will remain in our system:Functions that we will remain in our system: A manageable of database system that stores about the patients A manageable of database system that stores about the patients records.records. Provide a neat and tidy prescription to patients.Provide a neat and tidy prescription to patients. Information system that provide lists of suggested nutrition recipe, Information system that provide lists of suggested nutrition recipe, some details about the medical properties of the herbs, etc.some details about the medical properties of the herbs, etc.

Functions that we have to modify:Functions that we have to modify: A clear and detail described receipt to patients.A clear and detail described receipt to patients.

Functions that we have to eliminate:Functions that we have to eliminate: A simple simulated query system about the registered patients.A simple simulated query system about the registered patients. A manageable database system that concerns about the storage.A manageable database system that concerns about the storage. An accounting system that calculates the income and expenditure of An accounting system that calculates the income and expenditure of the shop.the shop.

Page 3: C++ Implementation ( Version 1 – Text Interface ) Elimination of services of our system. Elimination of services of our system. General Flow of the program

How we will present our How we will present our program.program.

We have built two stage of C++ program We have built two stage of C++ program implementations. One is in text-mode version, implementations. One is in text-mode version, and the other one with GUI.and the other one with GUI.The difference between them is noticeable, but The difference between them is noticeable, but they are still logical and acceptable.they are still logical and acceptable.we want to emphasize the problems in we want to emphasize the problems in implementation of the GUI from text mode and implementation of the GUI from text mode and the change in problem ideas the change in problem ideas To show there is a linkage within the two To show there is a linkage within the two versions of the programs.versions of the programs.

Page 4: C++ Implementation ( Version 1 – Text Interface ) Elimination of services of our system. Elimination of services of our system. General Flow of the program

General flow of the programGeneral flow of the program Herb System

Patients Records and Medical Records

Information System

Patients Records and Medical Records

Management of Patients’ Records

Management of Medical Records

Information System

Herbs and Medicine Properties

Nutrition Recipe

Page 5: C++ Implementation ( Version 1 – Text Interface ) Elimination of services of our system. Elimination of services of our system. General Flow of the program

General flow of the programGeneral flow of the program

Management of Patients’ Records

Create Records Delete Records Search Records

Modify Records

List Records

Page 6: C++ Implementation ( Version 1 – Text Interface ) Elimination of services of our system. Elimination of services of our system. General Flow of the program

General flow of the programGeneral flow of the program

Management of Medical Records

List Past Medical Records

Create New Medical Records

Search Records

Produce Prescription

Produce Receipt

Page 7: C++ Implementation ( Version 1 – Text Interface ) Elimination of services of our system. Elimination of services of our system. General Flow of the program

The relationship between each The relationship between each object inside the system. object inside the system.

Menu Records History

HerbsOrderHerbsInfo Herbs

Prescription

Receipt

Herbs Info.

Inheritance Inheritance

Output Result Output Result

Page 8: C++ Implementation ( Version 1 – Text Interface ) Elimination of services of our system. Elimination of services of our system. General Flow of the program

The format of data files.The format of data files.

FileNameList.datFileNameList.dat : Stores the sorted order of Patients ID of valid : Stores the sorted order of Patients ID of valid patient records.patient records.Patient’sID.datPatient’sID.dat ( e.g. 1536.dat ) : Stores the general information of ( e.g. 1536.dat ) : Stores the general information of the particular patient. It has a particular format and it only consists of the particular patient. It has a particular format and it only consists of a list of strings only.a list of strings only.Patients’sIDHistory.datPatients’sIDHistory.dat ( e.g. 1536History.dat ) : stores the past ( e.g. 1536History.dat ) : stores the past medical information of that particular patient. This file can be medical information of that particular patient. This file can be appended for new medical records but unable to be modified. ( but appended for new medical records but unable to be modified. ( but not physically )not physically )herb_noList.txtherb_noList.txt : stores the simplest information for all herbs. ( e.g. : stores the simplest information for all herbs. ( e.g. Herb ID, Its Name, Its First Division and its second Division )Herb ID, Its Name, Its First Division and its second Division )HerbsDetail.datHerbsDetail.dat : stores the full information that will be used in the : stores the full information that will be used in the information system for all herbs. It includes the medical function and information system for all herbs. It includes the medical function and the main cure.the main cure.

Page 9: C++ Implementation ( Version 1 – Text Interface ) Elimination of services of our system. Elimination of services of our system. General Flow of the program

Output ScreenOutput Screen

Page 10: C++ Implementation ( Version 1 – Text Interface ) Elimination of services of our system. Elimination of services of our system. General Flow of the program

Output Screen – Create RecordsOutput Screen – Create Records

Page 11: C++ Implementation ( Version 1 – Text Interface ) Elimination of services of our system. Elimination of services of our system. General Flow of the program

Output Screen – Create RecordsOutput Screen – Create Records

Page 12: C++ Implementation ( Version 1 – Text Interface ) Elimination of services of our system. Elimination of services of our system. General Flow of the program

Output Screen – Delete RecordsOutput Screen – Delete Records

Page 13: C++ Implementation ( Version 1 – Text Interface ) Elimination of services of our system. Elimination of services of our system. General Flow of the program

Output Screen – Delete RecordsOutput Screen – Delete Records

Page 14: C++ Implementation ( Version 1 – Text Interface ) Elimination of services of our system. Elimination of services of our system. General Flow of the program

Output Screen – Search RecordsOutput Screen – Search Records

Page 15: C++ Implementation ( Version 1 – Text Interface ) Elimination of services of our system. Elimination of services of our system. General Flow of the program

Output Screen – Modify RecordsOutput Screen – Modify Records

Page 16: C++ Implementation ( Version 1 – Text Interface ) Elimination of services of our system. Elimination of services of our system. General Flow of the program

Output Screen – Modify RecordsOutput Screen – Modify Records

Page 17: C++ Implementation ( Version 1 – Text Interface ) Elimination of services of our system. Elimination of services of our system. General Flow of the program

Output Screen – View Past Medical Output Screen – View Past Medical RecordsRecords

Page 18: C++ Implementation ( Version 1 – Text Interface ) Elimination of services of our system. Elimination of services of our system. General Flow of the program

Output Screen – Create New Output Screen – Create New Medical RecordsMedical Records

Page 19: C++ Implementation ( Version 1 – Text Interface ) Elimination of services of our system. Elimination of services of our system. General Flow of the program

Output Screen – Create New Output Screen – Create New Medical RecordsMedical Records

Page 20: C++ Implementation ( Version 1 – Text Interface ) Elimination of services of our system. Elimination of services of our system. General Flow of the program

Output Screen – Create New Output Screen – Create New Medical RecordsMedical Records

Page 21: C++ Implementation ( Version 1 – Text Interface ) Elimination of services of our system. Elimination of services of our system. General Flow of the program

Output Prescriptions and Receipt.Output Prescriptions and Receipt.

Page 22: C++ Implementation ( Version 1 – Text Interface ) Elimination of services of our system. Elimination of services of our system. General Flow of the program

Noticeable Programming Noticeable Programming Algorithm in the system.Algorithm in the system.

In the first version of C++ Implementation of program, there In the first version of C++ Implementation of program, there are some noticeable programming algorithms and are some noticeable programming algorithms and techniques that is necessary to be introduced. They are:techniques that is necessary to be introduced. They are:

1. Binary Search.1. Binary Search.

2. Insertion Sort2. Insertion Sort

3. Overloading of Constructors.3. Overloading of Constructors.

4. Inheritance of basic class.4. Inheritance of basic class.

Page 23: C++ Implementation ( Version 1 – Text Interface ) Elimination of services of our system. Elimination of services of our system. General Flow of the program

Noticeable Programming Noticeable Programming Algorithm in the system.Algorithm in the system.

Binary SearchBinary Search played a large role in the writing the program. For example, creation played a large role in the writing the program. For example, creation of patient records, searching of a patient record through Patient’s ID of patient records, searching of a patient record through Patient’s ID and Searching the Herb’s ID. and Searching the Herb’s ID. good advantage in its running time good advantage in its running time great dependence in the order of the data structure great dependence in the order of the data structure The program has a lot of searching processes when proceeding The program has a lot of searching processes when proceeding with the above serviceswith the above servicesthe running time is greatly reduced when the number of patient the running time is greatly reduced when the number of patient records is increased records is increased

Insertion Sort.Insertion Sort. this function has played a main role in the creation and deletion of this function has played a main role in the creation and deletion of Patient Records and Herbs Records.Patient Records and Herbs Records.Insertion Sort has a great advantage in running time when the input Insertion Sort has a great advantage in running time when the input records are almost sorted. records are almost sorted.

Page 24: C++ Implementation ( Version 1 – Text Interface ) Elimination of services of our system. Elimination of services of our system. General Flow of the program

Noticeable Programming Noticeable Programming Algorithm in the system.Algorithm in the system.

Overloading of ConstructorsOverloading of Constructors Widely used in creating objects. Foe example: Widely used in creating objects. Foe example: the Herbs, the the Herbs, the Patient Records, the History records, etc.Patient Records, the History records, etc.reduce a lot of assignment and initialization task while there is a reduce a lot of assignment and initialization task while there is a reading of data from data files reading of data from data files It provides a convenience to programmers.It provides a convenience to programmers.

Inheritance of basic classInheritance of basic class In our program, we have created a basic class “Herbs” and two In our program, we have created a basic class “Herbs” and two inherited classes “HerbsOrder” and “HerbsInfo”inherited classes “HerbsOrder” and “HerbsInfo”They are a good example in implementation of inheritance.They are a good example in implementation of inheritance.to provide the overloading of functions from the basic class “Herb” to provide the overloading of functions from the basic class “Herb” and provides some private functions that related to the new and provides some private functions that related to the new objects. objects. everything will become very clear and easy to understand. everything will become very clear and easy to understand.