troubleshooting Question

Hotel Ratings

Avatar of vectormcp
vectormcp asked on
Visual Basic Classic
6 Comments1 Solution1063 ViewsLast Modified:
I need to finish the code for the following project:
I need to display a bar chart: very simple:
HOTEL 1: ****
HOTEL 2: ******
HOTEL 3: ***
HOTEL 4: ******
HOTEL 5: **
The program allows the user to enter the hotel rating for each of five hotels. The rating can be from 1 through 6 only. If the user enters and invalid rating, the procedure should display an appropriate message, similar to the one listed here, and ask the user for the hotel rating again. When the user enters a number then this should be used to display the appropriate number of asterisks in the bar chart.
Name:         Hotel Project
' Purpose:      Display hotel ratings in a bar chart
' Programmer:   Vincent McPatrick on 12/15/2009

Public Class frmMain

    Private Sub btnExit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExit.Click
    End Sub

    Private Sub btnCreate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCreate.Click
        ' create a chart depicting ratings for five hotels
        ' input will be made by user using 1 through 6 only

        ' declare variables

        Dim strRating As Integer

        'Dim lblHotel As Double

        ' clear message box
        lblStars.Text = String.Empty

        strRating = InputBox("Please enter your rating for this hotel:", "Hotel Rating")
        If strRating = 0 AndAlso strRating > 6 Then
            MessageBox.Show("Please enter a rating number between 1 and 6", "Hotel Rating", _
                                        MessageBoxButtons.OK, MessageBoxIcon.Information)
            ' start rating the hotels
            'For strClientRating As Integer = 1 To 6
            'lblStars.Text = lblStars.Text _
            '& "HOTEL 1:" & strClientRating.ToString & ControlChars.NewLine

            'Next strClientRating
            lblStars.Text = lblStars.Text & ControlChars.NewLine

        End If
    End Sub
End Class
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 6 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros