Go Back  Xtreme Visual Basic Talk > Visual Basic .NET (2002/2003/2005/2008, including Express editions) > .NET General > Student... looking for help, but definitely not answers


Reply
 
Thread Tools Display Modes
  #1  
Old 11-16-2010, 07:18 PM
tskubeljr tskubeljr is offline
Newcomer
 
Join Date: Nov 2010
Posts: 3
Unhappy Student... looking for help, but definitely not answers


I am working on a few assignments for Visual Basic 2008. The book just doesn't give me enough example. I learn by example best and this is a new "web-enhanced" course where we are only in the classroom every other week for 3 hours. This being said I don't get a lot from reading a book, I learn much more from example. With that here is the program I am working on:

Workshop Selector:
3 list boxes, 4 buttons, 2 labels.
The application allows the user to select a workshop from lstWorkshop, Then select a location from lstLocation. Next btnAdd takes the selected workshop and location attached to a set amount of days and a registration fee and multiplies the days by a Lodging fee and outputs this number in dollar form. After multiple workshops/locations have been added btnCalc adds each of these and places them in lblTotal. The other two buttons are exit and clear which have already understand (of course the "easy" stuff)

Here is my code:
Code:
Public Class Form1
    Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click

        'Declare values from both listboxes
        Dim Day, Fee, Stay, Total As Integer

        'Workshop selection
        Dim workshop As String = lstWorkshop.SelectedIndex()
        If lstWorkshop.SelectedItem = "Handling Stress" Then
            Day = 3 And Fee = 595
        ElseIf lstWorkshop.SelectedItem = "Time Management" Then
            Day = 3 And Fee = 695
        ElseIf lstWorkshop.SelectedItem = "Supervision Skills" Then
            Day = 3 And Fee = 995
        ElseIf lstWorkshop.SelectedItem = "Negotiation" Then
            Day = 5 And Fee = 1295
        ElseIf lstWorkshop.SelectedItem = "How to Interview" Then
            Day = 1 And Fee = 395
        ElseIf lstWorkshop.SelectedItem Is Nothing Then
            MsgBox("Please choose a workshop first")
        End If

        'Location selection
        Dim location As String = lstLocation.SelectedIndex()
        If lstLocation.SelectedItem = "Austin" Then
            Stay = Day * 95
        ElseIf lstLocation.SelectedItem = "Chicago" Then
            Stay = Day * 125
        ElseIf lstLocation.SelectedItem = "Dallas" Then
            Stay = Day * 110
        ElseIf lstLocation.SelectedItem = "Orlando" Then
            Stay = Day * 100
        ElseIf lstLocation.SelectedItem = "Phoenix" Then
            Stay = Day * 92
        ElseIf lstLocation.SelectedItem = "Raleigh" Then
            Stay = Day * 90
        ElseIf lstLocation.SelectedItem Is Nothing Then
            MsgBox("Please choose a location first")
        End If

        'Total cost
        Total = Stay + Fee

        'Display in list box
        lstCost.Items.Add(Total.ToString("c"))
    End Sub

    Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
        lstWorkshop.SetSelected(0, False)
        lstLocation.SetSelected(0, False)   ' clear all listboxes and Total label
        lstCost.Items.Clear()
        lblTCost.Text = ""

    End Sub
    Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
        Me.Close()  'exit application
    End Sub

    Private Sub btnCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalc.Click

    End Sub
End Class
My btnAdd button will only place "$0.00 in the third listbox from there I am stuck... Please if you care to take the time and read this and help me please explain that will be the most help of all. Thank you all for your time

Tom

Last edited by Cerian Knight; 11-16-2010 at 09:34 PM. Reason: Added [code]...[/code] tags
Reply With Quote
  #2  
Old 11-17-2010, 07:36 AM
AtmaWeapon's Avatar
AtmaWeapon AtmaWeapon is offline
Fabulous Florist

Forum Leader
* Guru *
 
Join Date: Feb 2004
Location: Austin, TX
Posts: 9,505
Default

Wow. This is the third question this month about the same assignment. It's also the third question with exactly the same problem, and the code between the two isn't exactly unique. Interesting.

Anyway, I don't feel like typing out the answer to the same question again. Have a look at my explanation to the last guy who copied from that source.

And if your course is rubbish, the only thing you do by trying to copy/paste your way to some credit is swell their number of "satisfied customers". The only way to change things is to stick it to them and demand a refund, laying out your proof that you've spent your two weeks studying the course material and your 3 hours of course time trying to squeeze answers out of the instructor. If you don't prove that, they might claim you spent your two weeks goofing off then showed up unprepared for the 3 hour classroom time and spent it fiddling with your phone instead and refuse a refund. Obviously this would be more effective if you can get a few of your friends (maybe the other 2 guys who had exactly the same problem) to show up at the same time as you and demand a refund as well.

I don't know what you paid for the course, but there's $50 VB .NET books that are full of examples you could have bought instead; I'd be willing to wager you could have bought 3 or 4 for the cost of the course.
__________________
.NET Resources
My FAQ threads | Tutor's Corner | Code Library
I would bet money 2/3 of .NET questions are already answered in one of these three places.
Reply With Quote
  #3  
Old 11-17-2010, 10:17 AM
tskubeljr tskubeljr is offline
Newcomer
 
Join Date: Nov 2010
Posts: 3
Default Thank you.... I think...

Thank you for your response. I am excited to get home and work on this code now. I appreciate at least linking me to a better explaination. I am on my lunch break at work and can not get to my code right now but it will be the first thing I do tonight.

In my defense, my code is MY code. How unique could the code be, it is a couple groups of IF statements, and could of clear statement and an exit statement. Give me a little credit, I said I was NOT here for answers only some explaination and a nudge in the right direction. I just recently joined this forum , as short while ago, in the attempt receive a little help not the answer.

I have had this instructor before and if there was another option I would take it, however I am stuck becasue he is the only one teaching the course, and it is only offered as a "web enhanced class" he has never explained things well enough for me to understand, but everyone learns differently. This is a community college so "sticking it to them" is not really an option, I need classes to complete an associates degree. These are the instructors, that oversee these classes and that is that. If it were a class that met normally I may not be asking for as much help, or have as many questions and as far as tutors, they work 9-5, well so do I, also not an option.

On top of it all this instructor has been with the school for years, and a few guys whining about a class probably isn't going to combat that well. I choose instead to take it upon myself, as adult, to use the internet as a learning tool rather than a toy.

Thank you once again, I appreciate your knowledge and any other information recieved in the future
Reply With Quote
  #4  
Old 11-18-2010, 06:52 AM
tskubeljr tskubeljr is offline
Newcomer
 
Join Date: Nov 2010
Posts: 3
Default

Quote:
Originally Posted by AtmaWeapon View Post

Anyway, I don't feel like typing out the answer to the same question again. Have a look at my explanation to the last guy who copied from that source.
Thanks Atma, this assisted me in resolving my problem, the last part I had to do was write a for loop and ouput to a label, and though it took a bit of time I got it!

Thanks again, Tom

Last edited by Flyguy; 11-18-2010 at 08:45 AM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->