Question: I am trying to have an range error message that says please enter values from 0-30 . Right now the code shows the error
Humber of floors Click Const intFLOORS As Integer Total number of rooms on all floors const int-TOTAL-ROOS As Integer t ntFLOORS . ntROOS Hold the overall occupancy rate for all rooms and floors Dim dbloveralloccupancyRate As Double -.e . Din dbl TextOccupied AsDouble - Private Sub btnExit click(sender As object, e As EventArgs) Handles btnExit.click close the application He.CloseO End Sub Private Sub btnsave_Click(sender As object, e As EventArgs) Handles btnSave.Click declare the variables of integers and double types Dim intRoomsOccupied As Integer Dim dbloccupancyRate As Double If Integer.TryParse(txtoccupied. Text, intRoomsoccupied) Then If val(txtoccupiedText> 39 Then MessageBox.Show"Please enter values from e-38) intTotalRoomsoccupiedint Roomsoccupied dblOccupancyRate intRoomsOccupied intROOMS displat the results in the listboc istoccupancyRate. Items. Add("Floor:" & cboFloor. Text & "Rooms Occupied :" & tRoonsoccupied. ToString &-occupancy Rat calculate the overall occupancy rate for all the floors dbloverall0ccupancyRate intTotalRoomsoccupied int TOTAL ROOPS display the results to the user txtTotalRooms.Textint TotalRoomsoccupied. ToString) txtoccupancyRate.Text dbloveralloccupancyRate.Tostring"p) If cboFloor.SelectedIndex
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
