Presentation is loading. Please wait.

Presentation is loading. Please wait.

Developing a solution A staged design process. Initial requirements Car Hire business Three types of car Small, medium, large Different rates – hire,

Similar presentations


Presentation on theme: "Developing a solution A staged design process. Initial requirements Car Hire business Three types of car Small, medium, large Different rates – hire,"— Presentation transcript:

1 Developing a solution A staged design process

2 Initial requirements Car Hire business Three types of car Small, medium, large Different rates – hire, insurance, mileage Requirement to enter details, calculate and print bill Refund balance of deposit paid

3 Rates and charges Car typeEngine size Daily Hire rate £ / day Insurance rate £ / day Mileage rate £ / mile A<1200cc15.952.250.45 B1200 – 1600 cc 20.503.250.55 C> 1600 cc26.754.750.65

4 Process Definition When car booked pay deposit of £50 Cost is calculated from type of car, number of days on loan Hirer must be informed of excess charge or refund Application user to input details of car type, start miles and finish miles A print out of the bill to be printed

5 Possible Screen What are the design considerations ? Who will be using the system? Where will it be sited? What other activities are performed? How frequently will it be used? How much is response time critical ?

6  Option buttons  Frame control Alternatives to Command Buttons

7 What is a mutually exclusive decision ? When the user can only choose one from the list of options

8 Option buttons The best way to offer the user such a choice Allows the user to select a single item from a number of alternatives

9 Option buttons When grouped together, then - when one is selected and switched ‘on’, all the other option buttons are automatically deselected and switched ‘off’

10 Option buttons Buttons are grouped by placing them inside a Frame The Frame must be drawn first! If a frame is made invisible, so are the controls within it

11 Key properties of Option buttons Caption the words next to the button Alignment writing to left / right of button?

12 Key properties of Option buttons Valueis the button selected or not? – When Value = True, the button is selected A button can be set on either by the user clicking it, or within the code: – optFrance.Value = True When a button is selected all other buttons automatically have their Value set to False

13 Command vs Option Buttons Option buttons mutually exclusive Frame provides logical grouping HCI chunking But….. Extra code to cater for controlling operations Less intuitive for initiating processes

14 Idle Car B Car A Car C Exit Clear Input Data Clear / hide All input & output Exit to system Calc & display

15 Process Design High Level Design Nassi-Schneidermann Jackson Structured Low level design Pseudo-code Structured English Object-Oriented UML All use program logic to represent problem i.e. selection, iteration, etc. Represents solution in terms of data

16 Nassi-Shneidermann If condition ElseThen While or For condition Actions….. Case option else Sequence

17 NSD While not Exit Clear Calculate Car A details and display bill Case of Enter mileage and hire period Calculate Car B details and display bill Calculate Car C details and display bill

18 Pseudo Code Command buttons Car A,Car B,Car C 1. Input data from screen 1.1 Get days on hire and validate 1.2 Get start and finish miles and validate 1.3 Calculate mileage 2 Calculate the bill 2.1 Hire charge = days hire * Hire rate 2.2 Insurance charge = days hired * insurance rate 2.3 Mileage charge = mileage * Mileage rate 3 Display the bill 3.1 display car details 3.2 Display component charges 3.3 Display total bill charge 3.4 Refund

19 Pseudocode 2 Command Button Clear 1 Clear all input fields 1.1 Clear days on hire input 1.2 clear start mileage 1.3 clear finish mileage 2 Clear all output fields 2.1 clear car details 2.2 clear component charges 2.3 clear total bill 2.4 clear refund 3 set focus for input 3.1 set the focus to days on hire field

20 Variable List Data Input Private iDaysOnHire As Integer Private iStartMiles As Long Private iFinishMiles As Long Private iMileage As Long 'Component Charges Private cDayHireCharge As Currency Private cInsuranceCharge As Currency Private cMileageCharge As Currency 'Totalbill and refund variables Private cTotalCharge As Currency Private cRefund As Currency

21 Constant list Const HIRERATEA = 15.95 'daily hire car A Const INSURANCERATEA = 2.25 'insurance car A Const MILEAGERATEA = 0.45 'mileage car A Const HIRERATEB = 20.5 'daily hire car B Const INSURANCERATEB = 3.25 'insurance car B Const MILEAGERATEB = 0.55 'mileage car B Const HIRERATEC = 26.75 'daily hire car C Const INSURANCERATEC = 4.75 'insurance car C Const MILEAGERATEC = 0.65 'mileage car C

22 Capture data from input Private Sub Command1_Click() 'getting information from inputs iDaysOnHire = Val(Text1.Text) iStartMiles = Val(Text2.Text) iFinishMiles = Val(Text3.Text) iMileage = iFinishMiles - iStartMiles cDayHireCharge = iDaysOnHire * HIRERATEA cInsuranceCharge = iDaysOnHire * INSURANCERATEA cMileageCharge = iMileage * MILEAGERATEA cTotalCharge = cDayHireCharge + cInsuranceCharge + cMileageCharge cRefund = DEPOSIT - cTotalCharge

23 Display Bill details 'display car bill - command1_click continued’ Label3.Caption = "Car type A hired Engine Capacity <1200cc" Label7.Caption = iDaysOnHire & "days @" & Format$(HIRERATEA, "£0.00") Label8.Caption = iDaysOnHire & "days @" & Format$(INSURANCERATEA, "£0.00") Label9.Caption = iMileage & "miles @" & Format$(MILEAGERATEA, "£0.00") Label10.Caption = Format$(cDayHireCharge, "£0.00") Label11.Caption = Format$(cInsuranceCharge, "£0.00") Label12.Caption = Format$(cMileageCharge, "£0.00") Label13.Caption = Format$(cTotalCharge, "£0.00") Label14.Caption = Format$(cRefund, "£0.00") End Sub

24 Clear inputs and outputs Private Sub Form_Load() Text1.Text = "" Text2.Text = "" Text3.Text = "" Label3.Caption = "" Label7.Caption = "" Label8.Caption = "" Label9.Caption = "" Label10.Caption = "" Label11.Caption = "" Label12.Caption = "" Label13.Caption = "" Label14.Caption = "" End Sub

25 Result

26 Next …. Test the design !! Create a test plan Dry run the code design Amend the code design accordingly


Download ppt "Developing a solution A staged design process. Initial requirements Car Hire business Three types of car Small, medium, large Different rates – hire,"

Similar presentations


Ads by Google