54 Replies - 4787 Views - Last Post: 14 July 2012 - 05:31 PM
#1
Trying to do a rating for five hotels, using asterisks and input box
Posted 13 July 2012 - 02:54 PM
Replies To: Trying to do a rating for five hotels, using asterisks and input box
#2
Re: Trying to do a rating for five hotels, using asterisks and input box
Posted 13 July 2012 - 03:01 PM
No one on this site is going to do your homework for you as it will teach you nothing.
Try! something then we will help you with your problems
This post has been edited by m_wylie85: 13 July 2012 - 03:03 PM
#3
Re: Trying to do a rating for five hotels, using asterisks and input box
Posted 13 July 2012 - 03:13 PM
#4
Re: Trying to do a rating for five hotels, using asterisks and input box
Posted 13 July 2012 - 03:28 PM
#5
Re: Trying to do a rating for five hotels, using asterisks and input box
Posted 13 July 2012 - 03:36 PM
m_wylie85, on 13 July 2012 - 03:28 PM, said:
would you prefer it if i posted the problem with the program i am trying to do
#6
Re: Trying to do a rating for five hotels, using asterisks and input box
Posted 13 July 2012 - 03:37 PM
#7
Re: Trying to do a rating for five hotels, using asterisks and input box
Posted 13 July 2012 - 03:53 PM
m_wylie85, on 13 July 2012 - 03:37 PM, said:
You code an application that displays a bar chart. The bar chart depicts the ratings for five hotels. The Create Bar Chart button click event procedure should allow the user to enter the hotel rating for each of five hotels. The rating can be through 1 to 6 only. Use the inputbox function to get each rating. If the user enters an invalid rating, the procedure should display an appropriate message in a message box and then ask the user for the hotel's rating again. (In other words, the procedure should not accept an invalid rating) Use each hotel's rating to display the appropiate number of asterisks in the bar chart.
#8
Re: Trying to do a rating for five hotels, using asterisks and input box
Posted 13 July 2012 - 04:27 PM
Ok so you need to look up how to use the bar chart control(as for asterisks that's just stupid):
this should get started.
http://www.dreaminco...draw-bar-chart/
Then you need to look up button click events:
then you need to look up if else statments to check for int values between 0 and 6.
for example (sudo code) :
If i as int < 7 Then 'do something else messgaebox.show("sorry you need to enter a value between 0 and 6") end if
try what i have said then get back to me but check with you teacher about the asterisks part i don't get why he wants asterisks
#9
Re: Trying to do a rating for five hotels, using asterisks and input box
Posted 13 July 2012 - 04:30 PM
m_wylie85, on 13 July 2012 - 04:27 PM, said:
Ok so you need to look up how to use the bar chart control(as for asterisks that's just stupid):
this should get started.
http://www.dreaminco...draw-bar-chart/
Then you need to look up button click events:
then you need to look up if else statments to check for int values between 0 and 6.
for example (sudo code) :
If i as int < 7 Then 'do something else messgaebox.show("sorry you need to enter a value between 0 and 6") end if
try what i have said then get back to me but check with you teacher about the asterisks part i don't get why he wants asterisks
i am going to try this and its a she lol just giving us a problem from the book
#10
Re: Trying to do a rating for five hotels, using asterisks and input box
Posted 13 July 2012 - 04:39 PM
#11
Re: Trying to do a rating for five hotels, using asterisks and input box
Posted 13 July 2012 - 04:46 PM
#12
Re: Trying to do a rating for five hotels, using asterisks and input box
Posted 13 July 2012 - 04:51 PM
m_wylie85, on 13 July 2012 - 04:39 PM, said:
m_wylie85, on 13 July 2012 - 04:39 PM, said:
i tried to attach a pic of what she want it to look like but it wont let me
#13
Re: Trying to do a rating for five hotels, using asterisks and input box
Posted 13 July 2012 - 05:23 PM
- Get several user ratings of 5 hotels (A rating being within the range 1 - 5 inclusive).
- Generate an average rating for each other.
Apply some problem analysis skills to each part.
- I'm going need some form loop structure pattern.
- Over the users
- Over the user rating each hotel. - I'm going need get user input.
- I need to verify that input is valid. Valid being a number within range 1 - 6
- I need to devise so way keeping a record of the ratings.
part 2
- I need to find out how calculate an average.
- I need to find out how to generate an out of stars.
etc etc
Now it time to start coding.
#14
Re: Trying to do a rating for five hotels, using asterisks and input box
Posted 13 July 2012 - 07:04 PM
m_wylie85, on 13 July 2012 - 04:39 PM, said:
i have actually done some coding still not coming out right
Dim strRating As String strRating = InputBox("Hotel Rating", "Enter Here") For intCounter As Integer = 1 To 6 lblStars.Text = lblStars.Text & "*" Next intCounter If IsDate(strRating) Then MsgBox("The student was born on " & CDate(strRating).ToString("D"), _ MsgBoxStyle.OkOnly Or MsgBoxStyle.Information, _ "Hotel Rating") Else If strRating <= 7 Then MsgBox("Enter Hotel Rating again", _ MsgBoxStyle.OkOnly Or MsgBoxStyle.Information, _ "Hotel Rating") End If End If End Sub End Class
*** Edit ***
Please use code tags when posting code.

This post has been edited by GunnerInc: 13 July 2012 - 07:14 PM
Reason for edit:: Added Code tags
#15
Re: Trying to do a rating for five hotels, using asterisks and input box
Posted 13 July 2012 - 07:35 PM
Dim strRating As String strRating = InputBox("Hotel Rating", "Enter Here") For intCounter As Integer = 1 To 6 lblStars.Text = lblStars.Text & "*" Next intCounter If strRating >= 7 Then MsgBox("Enter Hotel Rating again", _ MsgBoxStyle.OkOnly Or MsgBoxStyle.Information, _ "Hotel Rating") End If End Sub End Class
This post has been edited by AdamSpeight2008: 13 July 2012 - 07:54 PM