The Hong Kong Polytechnic University Computer Programming (ENG236) 2011/2012 Assignment 3 A. Instructions
The Hong Kong Polytechnic University Computer Programming (ENG236) 2011/2012 Assignment 3 A. Instructions
The Hong Kong Polytechnic University Computer Programming (ENG236) 2011/2012 Assignment 3 A. Instructions
fig. 1
fig. 2
fig. 3
fig. 4
fig. 5
fig. 6
fig. 7
fig. 8
fig. 9
fig.10
fig.11
fig.12
Guidelines:
If the data file cant be opened, show a message of dialogue box e.g. fig.11. After reading in data from the file, the
open button disappeared and the filename cant be changed (the textbox becomes grey color).
Only one radio button can be selected and the corresponding options appear. Alert message will be shown when
button Go clicked but no radio button is selected. Input of phone number for searching should be checked: 8 digits
only and not starting with zero. Clicking the button Take All will check all 4 checkboxes.
When the button Go is clicked with one of the first 3 radio buttons is selected, this form should be hidden and another
form as fig. 7 appears.
For searching selection, after searching record displayed, all information cant be changed at the moment (the textbox
is in grey color).
Back button will close the current form and go to the form as fig.2. The total no. of records will be updated.
When the button New Purchase is clicked, new entry is shown as fig. 8. Cancel button discards the input and back to
fig.7. Update button will check the input amount first which is floating-point allowed number greater than zero. Handle
the input of characters to avoid this program failed. Add the input with the current amount and change the class if the
amount meets the range. Save this record to the data file. Go back fig.7 and show the new value of amount and class.
When the button Edit Info. is clicked, honorifics, name and phone can now be changed. Update button will check the
phone data, save the information to the data file and go back fig.7 showing the updated information.
When the button Delete Rec. is clicked, a message is shown as fig.11. Cancel button discard the action and go back
fig.7. OK button will delete the record from the data file and then go back fig.7, update the total no. of records at the
top of the form and show the information of next record.
When adding new customer, the form as fig.10 is shown. A drop down list of Ms, Mr and Mrs should be provided for
selection. Add+Save button will check: one of Ms, Mr and Mrs selected, name is not empty, correct input of phone and
purchased amount as stated in above guidelines. Find out the corresponding class. Add and write this record to the
data file. Go back fig.7, update the total no. of records at the top of the form and show this new information.