Arc2571
Sep 2nd, 2007, 10:19 AM
Hey everyone im new here but am in dire need of help.
Below is a program that i am required to write;
Develop a windows application for a leisure barge and cargo barge rental company. To create this application a parent Barge class must be created and two separate child classes for both the Leisure barge and Cargo barge. In the Barge class store a text description of the type of Barge, the rental cost and the max number of Barges of this type that will be available to rent. Additionally, since the Barges will be rented, a counter should be maintained to determine the number of Barges of this type still available to rent.
For the Leisure barge you will need to store the maximum number of passengers which can be accommodated in the Barge, but for the Cargo barge you will need to store the maximum load in tonnes which can be carried.
Create an overridable function to calculate the total rent which must be paid. The total rent must be calculated by adding the VAT to the rental cost (at 17.5%) then adding the following:-
- For leisure barges, add £75.50 multiplied by the max passengers
- For car barges, add £152.25 per 100 tonne
The application will require a form to be displayed containing:-
- buttons for adding a new leisure barge and cargo barge type
- a list box to display the Barge types available and to allow a Barge type to be selected.
- buttons to allow the selected Barge to be rented and returned by updating the Barge counter mentioned above.
- a label to display the rental cost when a Barge is selected in the listbox
Two further forms will be required, one each to display the values which must be entered to create a new Leisure barge or Cargo barge.
The code for displaying a new form from a button is shown below:
Dim addForm As AddLeisureBargeForm
Dim result As DialogResult
Dim BargeType As String
' Create the AddLeisure bargeForm form
addForm = New AddLeisureBargeForm
' Display the form and read the result returned
result = addForm.ShowDialog()
' Check the result and read the values from the
' form
If result = Windows.Forms.DialogResult.OK Then
BargeType = addForm.TypeTextBox.Text
.
.
End If
We need to return OK or Cancel from this new form, heres the code (shown in bold):
Private Sub OkButton_Click( )Handles OkButton.Click
DialogResult = Windows.Forms.DialogResult.OK
Me.Close()
End Sub
Hint:
To display the data in the ListBox use a List class and set the DataSource property of the ListBox as follows:-
Me.BargeListBox.DataSource = Nothing
Me.BargeListBox.DataSource = theList
You will need to set the DataSource each time you wish to update the contents of the ListBox.
i understand that it is a very simple program to write but unfortunatly i do not have a clue i was hoping that one of the people from this forum can show me how/ write it for me in Visual Studio 2005. i would be willing to pay them for their time.
thanks in advance
arc
Below is a program that i am required to write;
Develop a windows application for a leisure barge and cargo barge rental company. To create this application a parent Barge class must be created and two separate child classes for both the Leisure barge and Cargo barge. In the Barge class store a text description of the type of Barge, the rental cost and the max number of Barges of this type that will be available to rent. Additionally, since the Barges will be rented, a counter should be maintained to determine the number of Barges of this type still available to rent.
For the Leisure barge you will need to store the maximum number of passengers which can be accommodated in the Barge, but for the Cargo barge you will need to store the maximum load in tonnes which can be carried.
Create an overridable function to calculate the total rent which must be paid. The total rent must be calculated by adding the VAT to the rental cost (at 17.5%) then adding the following:-
- For leisure barges, add £75.50 multiplied by the max passengers
- For car barges, add £152.25 per 100 tonne
The application will require a form to be displayed containing:-
- buttons for adding a new leisure barge and cargo barge type
- a list box to display the Barge types available and to allow a Barge type to be selected.
- buttons to allow the selected Barge to be rented and returned by updating the Barge counter mentioned above.
- a label to display the rental cost when a Barge is selected in the listbox
Two further forms will be required, one each to display the values which must be entered to create a new Leisure barge or Cargo barge.
The code for displaying a new form from a button is shown below:
Dim addForm As AddLeisureBargeForm
Dim result As DialogResult
Dim BargeType As String
' Create the AddLeisure bargeForm form
addForm = New AddLeisureBargeForm
' Display the form and read the result returned
result = addForm.ShowDialog()
' Check the result and read the values from the
' form
If result = Windows.Forms.DialogResult.OK Then
BargeType = addForm.TypeTextBox.Text
.
.
End If
We need to return OK or Cancel from this new form, heres the code (shown in bold):
Private Sub OkButton_Click( )Handles OkButton.Click
DialogResult = Windows.Forms.DialogResult.OK
Me.Close()
End Sub
Hint:
To display the data in the ListBox use a List class and set the DataSource property of the ListBox as follows:-
Me.BargeListBox.DataSource = Nothing
Me.BargeListBox.DataSource = theList
You will need to set the DataSource each time you wish to update the contents of the ListBox.
i understand that it is a very simple program to write but unfortunatly i do not have a clue i was hoping that one of the people from this forum can show me how/ write it for me in Visual Studio 2005. i would be willing to pay them for their time.
thanks in advance
arc