Sunteți pe pagina 1din 9
UNIVERSITY EXAMINATIONS UNIVERSITEITSEKSAMENS. UNISA Fee INF2611 ‘October/November 2013 VISUAL PROGRAMMING II Duration = 2 Hours 70 Marks EXAMINERS : FIRST MRS PM GOUWS ‘SECOND MRL ARON Closed book examination. This examination question paper romaine the property of the University of South Africa and may not be removed from the examination venue ‘Thus paper consists of 9 pages. Instructions ‘* Answer all questions in the answer book. © Answers in pencil will be marked. © Marks are given in the brackets next to the question. © Enjoy! Please Turn Over INE2611 October/November 2013 ion 1 — Menus (15) Menus provide lists of items on which the user can click to invoke different program operations, Given the options alongside, select 3 of the menu options AND motivate when such an option 1s included in an application You may refer to the application developed in your project. (6) Give 4 reasons why 1s it necessary to include menus in an application? (4) Explain how different sources can be used to trigger the same operation Refer to duplication of identical procedures, the one-way centralization through a component's event handler and two-way centralization through an action (5) Please Turn Over INF2611 October/November 2013 Question 2 ~ Multiple forms (15) “More than one form is required for an application!” ‘a Name the two options for adding forms to an application Motivate why these options were used in your project application (3) b_ Explain the difference between ‘Auto-create forms’ and ‘Available forms’ Explain which of these options you used in the development of your project (3) ¢ Explain the difference between modal and modeless forms, AND motivate why the form type ‘was (or was not) used in your database application (3) d__ Discuss 3 reasons for multiple forms in an application, AND give motivation with reference to the development of the project application (6) Please Turn Over INF2611 October/November 2013 Question 3 - Database applic: (21 A potential chent approaches you and asks: ‘Thave an existing database of data stored in records and tables. I would ke all staff to have digital access Yo the business data Iam sure that the business will benefit from digital updating and reporting of business data Can you assist?" You are required to compile an inital conceptual application development proposal, based on what you have leamt this semester You need to explain the concepts clearly, and may need to add relevant code and or examples from your project to substantiate your explanations Use the following headin ‘© Anexplanation. © Amotivation with an example from your project application Explain why the connections are used to make this possible (4) b The access to the data in the database Explam why access is required? Motivate by refernng to data manipulation functions that you included in your application? (4) ¢. Adatamodule Explain the purposes of a data module Motvate by referring to the ‘components included in your application data module module? (4) 4 Data aware controls_ Explain what data aware controls are and why they are used Motivate by naming and discussing at least two such controls that you used in your project (4) Recommend incremental development Conclude your proposal by explaining why incremental development and RAD are recommended Motivate the benefits with reference to the development of your project application (4) Please Turn Over INF2611 October/November 2013 Consider the following demo program that stores the name of the client, and then the current amount that can be adjusted by deposits and withdrawals The information is shown on the user mterface, Please Turn Over INF2611 October/November 2013 Gent ame dams Updete Name hee Déiphus :R 2001.00 unit £m2013ClientDetar1s¥, interface Dialogs, Buttons, stdctrls, type ‘TérmClient = class (TForn) + gpbClient: TcroupBox, : gpbAmount: TGroupBox, edtClaent. Tedat; edtamount. TEdat, : btnName ‘TButton, btnDeposit: TButton; : benWithDraw TButton, : bmbReset TBitatn, Iblinfo Thabel, procedure FornCreate(Sender Tobyect), Procedure btnNameClick (Sender: TObyect) ; + procedure btnDepositClick (Sender: TObject) ; : procedure btnWithDrawClick(Sender TObyect) ; Procedure bnbResetClaick (Sender Tobyect), : private Windows, Messages, SysUtiis, Variants, Classes, Graphics, controls, Forns, Please Turn Over INF2611 October/November 2013 { Private declarations } - procedure Showinfo; + public { Publae declarations } 2 end, var frmClient Tfrmclient; implementation uses £m2013Person! : var TheClient : TClient, (5k *.afm} + procedure TérmClient .bmbResetClack (Sender: Tobject) ; begin edtClaent.Text = ''; ‘TheClient .Setname(edtClient .Text) , edtAmount Text = '0.0", ‘TheClaent -ResetAmount, ShowInfo, end, : procedure TfrmClient -btnDepositClick (Sender: Tobyect) ; begin : TheClient Deposit (edtAmount .Text) , : ShowInfo; end, procedure TfrnClient .btnNameClick (Sender: TObject) + begin ‘TheClaent .Setname (edtClient .Text), : ShowInfo; + end, procedure TfrmClient .btnWathDrawClick (Sender. Tobject) , begin ‘TheCLient.WithDraw(edcamount Text), : ShowInfo; end, procedure TfrmClient FormCreate(Sender TObject), begin : TheClient := TClient create, end, 2 procedure TfrmClient.ShowInfo; begin AblInfo.Caption := TheClient.GetName + ' : ' + TheClaent GetAmount, ‘end, end. 2: undt £m2013PersonU; 3: interface Please Turn Over INF2611 October/November 2013 SyeUtais, type : TPerson = claes (robject) : private 2 Name public function CetName string, : procedure SetName (aName . String), end, String, : TClaent = clase (TPerson) private Amount Double, public Procedure Deposit (ADeposit - string), : function GetAmount - string, procedure WithDraw (AWithDrawal String), . procedure ResetAmount ; end, implementation {7Pexson} function TPerson GetName tring, begin : result := Name, 2 end, procedure Terson SetNane(ANane: string) begin Name := ANane, end, {reLient} : Procedure TClient Deposit (ADeposit: string), ahesum : Double; - 2 begin @TheSun :+ StxToFloat (ADeposit), : Amount = Amount + ATheSum; 2 end; function ‘TClient .Getanount; begin : Result = FloatToStrF(amount, ffCurrency, 10, 2), ond; : procedure TClient WithDraw(AWithDrawal string); : dTheSum : Double; : begin + dTheSum := StrToFloat (AWathDrawal), Amount = Amount - aTheSum : end, Please Turn Over INF2611 ‘October/November 2013 : procedure TClient .ResetAmount ; begin Amount :- 0.00, end, end. ‘Answer the set of questions that follow, referring where appropriate to the code above by unit and line number(s). 1 Give a definition of object orientation in terms of objects and classes Give a reference and line number from the code above.(4) 2 Explain the concept of inheritance in object orientation with reference to lines 9 and 10 of the unit fm2013ClientDetailsu;, (4) 9: type 10 TérmClient = class (TForm) 8. Identify and explain the data transfer, the method and the calls in the event handler TérmClient .btnWithDrawClick (Sender TObject) in terms of the operation and effect’ (6) 4. Explain the concept of encapsulation Give a reference to the implementation of encapsulation from the code above (2) 5. Which data fields does TChent class provide? Provide unit name and line number in which there are declared (2) 6. Name two methods associated with the TCent class? (2) UNISA 2013

S-ar putea să vă placă și