• WSNight

    WSNight

    @wsnight

    Viewing 15 replies - 16 through 30 (of 169 total)
    Author
    Replies
    • in reply to: HELP ASAP!! Infinite Loop? (VB.NET) #908176

      Thanks for the tips I ended up figuring it out. When I get home I will post the code if needed.

    • in reply to: HELP ASAP!! Infinite Loop? (VB.NET) #902165

      Narrowed the problem to one line. Some where in the Do Loop statement it is messing up. WHen I get the number calc it is saying something like 11984 for the number of years to double. Ok so then if I have the loop statement like this

      Do While balance < (balance * 2)
      balance = (r + 1) * balance
      numYearsDoub += 1
      Loop

      where is it wrong? I know it is the Do While balance < (balance * 2) but I can't figure out why that is the problem. Any help is appreciated.

      Here is updated code.

      Private Sub btnDetermine_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDetermine.Click
      
              'Declare Variables
              Dim balance, r, amount As Double
              Dim numYearsMil, numYearsDoub As Integer
      
              'Get initial value of balance, and rate from a textbox
              balance = CDbl(txtAmount.Text)
              amount = CDbl(txtAmount.Text)
              r = CDbl(txtRate.Text)
      
              Do While amount < amount * 2
      
                  amount = (1 + r) * amount
                  numYearsDoub += 1
      
              Loop
      
              'Loop determines the number of years it will take to double your money
              Do While balance < 1000000
      
                  balance = (1 + r) * balance
                  numYearsMil += 1
      
              Loop
      
              'Prints the number of years it takes to become a millionare
              txtDouble.Text = "In " & numYearsDoub & " years you will double your money."
              txtMillion.Text = "In " & numYearsMil & " years you will have a million dollars."
      
          End Sub
    • in reply to: HELP ASAP!! Infinite Loop? (VB.NET) #902166

      Narrowed the problem to one line. Some where in the Do Loop statement it is messing up. WHen I get the number calc it is saying something like 11984 for the number of years to double. Ok so then if I have the loop statement like this

      Do While balance < (balance * 2)
      balance = (r + 1) * balance
      numYearsDoub += 1
      Loop

      where is it wrong? I know it is the Do While balance < (balance * 2) but I can't figure out why that is the problem. Any help is appreciated.

      Here is updated code.

      Private Sub btnDetermine_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDetermine.Click
      
              'Declare Variables
              Dim balance, r, amount As Double
              Dim numYearsMil, numYearsDoub As Integer
      
              'Get initial value of balance, and rate from a textbox
              balance = CDbl(txtAmount.Text)
              amount = CDbl(txtAmount.Text)
              r = CDbl(txtRate.Text)
      
              Do While amount < amount * 2
      
                  amount = (1 + r) * amount
                  numYearsDoub += 1
      
              Loop
      
              'Loop determines the number of years it will take to double your money
              Do While balance < 1000000
      
                  balance = (1 + r) * balance
                  numYearsMil += 1
      
              Loop
      
              'Prints the number of years it takes to become a millionare
              txtDouble.Text = "In " & numYearsDoub & " years you will double your money."
              txtMillion.Text = "In " & numYearsMil & " years you will have a million dollars."
      
          End Sub
    • in reply to: HELP ASAP!! Infinite Loop? (VB.NET) #902151

      Ok I’ve narrowed down the problem. It is in the first Do Loop. For some reason the doubleing money is holding up the system. Without that I can easily get the number of years it takes to make a million. But if that loop is there then it bogs up the system and gives me odd numbers. I don’t know what to do with it. Oh I took out the = sign in the first loop and it stoped freezing on me.

    • in reply to: HELP ASAP!! Infinite Loop? (VB.NET) #902152

      Ok I’ve narrowed down the problem. It is in the first Do Loop. For some reason the doubleing money is holding up the system. Without that I can easily get the number of years it takes to make a million. But if that loop is there then it bogs up the system and gives me odd numbers. I don’t know what to do with it. Oh I took out the = sign in the first loop and it stoped freezing on me.

    • in reply to: HELP!! Leap Year checking(VB.NET) #897275

      An assignment of sorts yes. For me not as much as the kids in my class. I had forgoten all about using MOD for some reason or another at first until I went back through old work where I needed to know that and before the IsLeapYear was available to use. I must say that .NET is one of the greatest things though. And Howard is quite right. We are all always students in the world of programming. Can’t know it all though there are people out there that know so much it seems you’ll never catch them, but those are our programming vets who have been doing it for so long that is is almost second nature. I can say those guys have helped me out more than I could ever hope. Thanks for the help though guys. If it weren’t for all of you we could all be lost. cheers

    • in reply to: HELP!! Leap Year checking(VB.NET) #897276

      An assignment of sorts yes. For me not as much as the kids in my class. I had forgoten all about using MOD for some reason or another at first until I went back through old work where I needed to know that and before the IsLeapYear was available to use. I must say that .NET is one of the greatest things though. And Howard is quite right. We are all always students in the world of programming. Can’t know it all though there are people out there that know so much it seems you’ll never catch them, but those are our programming vets who have been doing it for so long that is is almost second nature. I can say those guys have helped me out more than I could ever hope. Thanks for the help though guys. If it weren’t for all of you we could all be lost. cheers

    • in reply to: 2nd Hard disk setup #897274

      You are quite right. I tend to find more information in the search which will prevent me from posting. Of course at times there are so many posts to run through that it is hard so if I post a thread I may be able to get a point to the right one.

    • in reply to: 2nd Hard disk setup #897009

      I like to follow up. Allows me to thank those that helped me out or gave me direction of any kind. Always appreciated. Besides when I help it’s good to know that it got solved.

    • in reply to: 2nd Hard disk setup #897010

      I like to follow up. Allows me to thank those that helped me out or gave me direction of any kind. Always appreciated. Besides when I help it’s good to know that it got solved.

    • in reply to: HELP!! Leap Year checking(VB.NET) #897005

      Ah but I wasn’t allowed to use the IsLeapYear check. Had to do it the old fasion way. I remembered how to after a little while. Just a simple if then statement.

      If ((year Mod 4 = 0) And (year Mod 100 0) Or (year Mod 400 = 0)) Then

      So it all worked out. Thanks for the input.

    • in reply to: HELP!! Leap Year checking(VB.NET) #897006

      Ah but I wasn’t allowed to use the IsLeapYear check. Had to do it the old fasion way. I remembered how to after a little while. Just a simple if then statement.

      If ((year Mod 4 = 0) And (year Mod 100 0) Or (year Mod 400 = 0)) Then

      So it all worked out. Thanks for the input.

    • in reply to: 2nd Hard disk setup #895752

      Well I figured it out. All I had to do was refresh in the bios after I reformated. At least when I went into the BIOS and once the computer restarted the drive was back to where I could see and access it. Thanks for all the help.

    • in reply to: 2nd Hard disk setup #895753

      Well I figured it out. All I had to do was refresh in the bios after I reformated. At least when I went into the BIOS and once the computer restarted the drive was back to where I could see and access it. Thanks for all the help.

    • in reply to: 2nd Hard disk setup #892381

      Ok well my frist statment was probably a jumble of frustrating words. Like I said I have been working on this for a while now. Anyway let me try to rephrase this a bit.

      Ok so I have 2 harddrives that I need to have connected for the various use they are in. Well the problem is that I have my 4 IDE’s used up by 4 other hardware components. A DVD-Rom, CD-Writer, Zip Drive, and my Master Harddrive. Now what I need to be able to do is set up the second harddrive without using the IDE porst seeing as they are all used. With the IDE’s I could pretty much just plug it in and hey there it goes and it’s all good right. Well I need that Zip drive hooked up since I have to hand things in to various professors on disks and a zip disk holds what I need it to (Jump drive’s are a bit expensive to have to many of those). So what do I do? I set up a RAID controller to identify the other Harddisk. I am not actually creating a RAID as most would. I am using the RAID to identify that the other HDD is there so that I can access it. Problem is that it for some reason won’t let me. I know it’s possible because before when I first got the computer it was all working and it was set up in that fasion. Hope this is a bit better of an explination of what I am trying to do.

    Viewing 15 replies - 16 through 30 (of 169 total)