Created
December 3, 2019 03:40
-
-
Save lianeyue/d8d35648f4ab85b916f3101f13d63387 to your computer and use it in GitHub Desktop.
Hotel Metropole - Pseudocode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Strict On | |
Public Class frmMetropoleNewReservation | |
Private Sub frmMetropoleNewReservation_Load(sender As Object, e As EventArgs) Handles MyBase.Load | |
'1. Form Validations: Reservation Information | |
'validate room type is selected using If statement. | |
'validate check-in date is not in the past using If statement | |
'validate that check-out date is later than check-in date using If statement | |
'validate that user has completed all fields in reservation information groupbox using If statement | |
End Sub | |
Private Sub cboRoomType_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboRoomType.SelectedIndexChanged | |
'2. Room Type Combo Validation | |
'validate to determine price for each room type using If statement (i.e. If strRoomType = "One King" Then dblRoomRate = 179 ...). | |
End Sub | |
Private Sub btnSubmit_Click(sender As Object, e As EventArgs) Handles btnSubmit.Click | |
'3. Validate that only upon user clicking submit button and quote populating, they can input customer information. | |
'4. Declare input variables | |
'Dim dtmCheckIn As DateTime | |
'Dim dtmCheckOut As DateTime | |
'Dim strRoomType As String | |
'Dim strNumOfRooms As String | |
'Dim strNumOfAdults As String | |
'Dim strNumOfChildren As String | |
'Dim dblRoomRate | |
'5. Declare output variables | |
'Dim shoTotalNumberOfNights As Short | |
'Dim dblTotalRatePerNight As Double | |
'Dim dblSubtotal As Double | |
'Dim dblTax As Double | |
'Dim dblConvenienceFee As Double | |
'Dim dblQuoteTotal As Double | |
'6. Declare constants for room type | |
'Const OneKing = 179 | |
'Const OneKingDeluxe = 189 | |
'Const TwoQueens = 189 | |
'Const TwoQueenDeluxe = 214 | |
'Const OneKingSuite = 249 | |
'Const OneKingPresidentialSuite = 289 | |
'7. Assign variables | |
'shoTotalNumberOfNights = lblNumberOfNightsOutput.ToShort | |
'8. Output Calculations | |
'Calculate dblRatePerNight = strNumOfRooms * dblRoomRate | |
'Calculate dblSubtotal = shoTotalNumberOfNights * rate per night | |
'Calculate dblTax = SubTotal * 0.07 | |
'Calculate dblConvenienceFee (10$ per night) = shoTotalNumberOfNights * 10 | |
'Calculate dblQuoteTotal = Subtotal + Tax + Convenience Fee | |
End Sub | |
Private Sub btnConfirmQuote_Click(sender As Object, e As EventArgs) Handles btnConfirmQuote.Click | |
'9. Validate to Customer Information group box active. | |
End Sub | |
Private Sub btnConfirmCustomerInfo_Click(sender As Object, e As EventArgs) Handles btnConfirmCustomerInfo.Click | |
'10. Validate that all fields, except email are completed using If statement. | |
'validate phone number is entered | |
'11. Display confirmation message including room type, check-in date, number of nights, and total cost. | |
'12. Reset form | |
End Sub | |
Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click | |
'13. Returns user to Main Menu | |
End Sub | |
Private Sub btnCloseNewReservation_Click(sender As Object, e As EventArgs) Handles btnCloseNewReservation.Click | |
'14. Closes entire form | |
End Sub | |
'Images sourced from: http://www.metropolehotel.com/ | |
End Class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Strict On | |
Public Class frmMetropoleReservationsReport | |
Private Sub btnSubmitRS_Click(sender As Object, e As EventArgs) Handles btnSubmitRS.Click | |
'Declare variables for from and to dates (DateTime type) and last name(String type) | |
'Validate that the user entered a string value for the last name with an if statement, or else | |
' display a proper error message | |
'Validate that the user selected an appropriate date range and only future reservation dates, or else | |
' display a proper error message | |
'Capture the user input from the date range and last name and assign to the variables | |
'Write a loop that reads the reservation text file and displays reservation results in the list box based on | |
' the user input, or display appropriate message when no records are found with an if statement | |
End Sub | |
Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles lboSearchOutput.SelectedIndexChanged | |
'Validate that the user selected an item from the list box with an if statement | |
'Declare variable to hold a StreamReader class | |
'Create a StreamReader with the relative path | |
'Write a do loop that reads through each line of the text file and splits up the line with a delimiter | |
'Display the reservation data in the right text boxes with appropriate formatting | |
'Close the StreamReader | |
End Sub | |
Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click | |
'Close the form and return to the main menu | |
End Sub | |
Private Sub frmMetropoleReservationsReport_Load(sender As Object, e As EventArgs) Handles MyBase.Load | |
End Sub | |
'Images sourced from: http://www.metropolehotel.com/ | |
End Class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Strict On | |
Imports System.IO | |
'Images sourced from: http://www.metropolehotel.com/ | |
Public Class frmMetropoleRoomManagement | |
Private Sub frmMetropoleRoomManagement_Load(sender As Object, e As EventArgs) Handles MyBase.Load | |
'READ TEXT FILE | |
'Define variables | |
'Loop reader | |
'Display in listbox | |
End Sub | |
Private Sub lstDisplay_SelectedIndexChanged(sender As Object, e As EventArgs) Handles lstDisplay.SelectedIndexChanged | |
'SELECT INPUT | |
'Define variables | |
'Pull information from listbox selected index | |
'Display in text boxes | |
End Sub | |
Private Sub btnSubmit_Click(sender As Object, e As EventArgs) Handles btnSubmit.Click | |
'SUBMIT INPUT | |
'Define variables | |
'Validate input | |
''Room type exists | |
''Price exists | |
'''' Within range(1000 > x > 0) | |
''Quantity exists | |
'''' Within range (30 > x > 0) | |
'''' Whole number | |
'--------------------------------- | |
'WRITE TEXT FILE | |
'Define variables | |
'Convert input to variables | |
'Convert input into new line | |
'Execute writer to overwrite old line | |
'Display in listbox | |
End Sub | |
Private Sub btnClear_Click(sender As Object, e As EventArgs) Handles btnClear.Click | |
'CLEAR FIELDS | |
End Sub | |
Private Sub btnReturn_Click(sender As Object, e As EventArgs) Handles btnReturn.Click | |
'RETURN TO MAIN MENU | |
'Close form | |
'Open main menu | |
End Sub | |
End Class |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment