Page 1 of 2 12 LastLast
Results 1 to 40 of 43

Thread: I need a little bit of help. Please look here

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    58

    I need a little bit of help. Please look here

    ok ok ok ok
    Last edited by fix23; Nov 8th, 2008 at 06:02 PM.

  2. #2
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: I need a little bit of help. Please look here

    Begging does not help... And besides no one in their right mind is going to give you unchecked access to them in MSN. Especially since you don't know that you shouldn't leave your email address in posts...

  3. #3

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    58

    Re: I need a little bit of help. Please look here

    I didnt beg, i just asked.... its sorta for school, i got another assignment but this one i find more difficult, and besides somone already added my msn when i needed help.

    thanks guys

  4. #4
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: I need a little bit of help. Please look here

    It would help if you have a proper thread title to describe your problem not to plead for help. The forum is for people to help already...

    Well, that someone that added MSN has to be about 16...

    Why would you come to a forum to ask for help then go offline??? The situations and help here are for others as well...

  5. #5

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    58

    Re: I need a little bit of help. Please look here

    Im not going offline, im just saying i need some help quickly becuase i have to leave soon and threw msn aim or xfire would be the quickest thats all

  6. #6
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: I need a little bit of help. Please look here

    How would that be quicker than here with many more people to help???

  7. #7

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    58

    Re: I need a little bit of help. Please look here

    ok here is the question.


    A right-angled triangle has the property that when the values of the lengths of the sides are
    squared, the sum of the two smaller values is equal to the larger value. For example, 12, 5, and 13
    make a right angled triangle, because 12 * 12 = 144, 5 * 5 = 25, 13 * 13 = 169, and 144 + 25 =
    169.
    Write a program that asks the user to enter three values and then determines whether the triangle
    created is a right-triangle or not.

  8. #8

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    58

    Re: I need a little bit of help. Please look here

    yea.... i deffiatly think it would be quicker threw msn or xfire or AIm

  9. #9
    Frenzied Member Motoxpro's Avatar
    Join Date
    Sep 2001
    Location
    Spiro, OK
    Posts
    1,211

    Re: I need a little bit of help. Please look here

    Just make some checks, Somthing like

    Code:
    text1.text = Side1
    text2.text = Side2
    Text3.text = Side3
    
    If (Side1 * Side1) + (Side2 * Side2) = (Side3 * Side3) then
    msgbox "right triangle"
    else
    msg "Not a right triangle"
    end if

    Thats super basic man you should try thinking about it next time

  10. #10
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: I need a little bit of help. Please look here

    Simple Trig question...

  11. #11

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    58

    Re: I need a little bit of help. Please look here

    i am brand new to this, its not simple to me, i just started VB. its very difficult to me

  12. #12
    Frenzied Member Motoxpro's Avatar
    Join Date
    Sep 2001
    Location
    Spiro, OK
    Posts
    1,211

    Re: I need a little bit of help. Please look here

    you dont have to know VB....its math :\ you pretty much answered your own question when you asked it. Im sure they taught you how to do if statements and thats all you need. Just dont use the forums to pass class and youll do fine lol

  13. #13
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: I need a little bit of help. Please look here

    Trigonometry has nothing to do with VB. VB is just a way to show it.

    That is why you should ask the question here to see who can help... You might be surprised by who can help write a VB program in A VB Forum...

  14. #14

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    58

    Re: I need a little bit of help. Please look here

    yea but i dont kno the codes and stuff... like the formulas

  15. #15

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    58

    Re: I need a little bit of help. Please look here

    actually im so retarded i cant even get the code you gave me to work ><

  16. #16
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: I need a little bit of help. Please look here

    Then post what you have and someone will help you with that...

  17. #17

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    58

    Re: I need a little bit of help. Please look here

    ok here is what i have, tell me if this is correct.


    Dim side1 As Double
    Dim side2 As Double
    Dim side3 As Double
    Console.WriteLine("Please enter a Value for side 1.")
    side1 = Console.ReadLine
    Console.WriteLine("Please enter a value for side 2.")
    side2 = Console.ReadLine
    Console.WriteLine("Please enter a Value for side 3.")
    side3 = Console.ReadLine
    If (side1 * side1) + (side2 * side2) = side3 Then
    Console.WriteLine("right triangle")
    Else
    Console.WriteLine("Not a right triangle")
    End If
    Console.ReadLine()

  18. #18
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: I need a little bit of help. Please look here

    You will also need to learn forum code tag usage...

    Are you using VB.NET?

  19. #19

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    58

    Re: I need a little bit of help. Please look here

    Im using Visual Basics 2005 express edition.. if that helps.... did my code thing work, or do i need to fix it?

  20. #20
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: I need a little bit of help. Please look here

    Well, this is the wrong forum... but anyway you did not copy the formula exactly
    It should be:
    Code:
    (Side1 * Side1) + (Side2 * Side2) = (Side3 * Side3)

  21. #21

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    58

    Re: I need a little bit of help. Please look here

    O ok, thanks for the help guys. also i got another question....i did this one all by myself earlier....

    here is the question....

    Three numbers represent the sides of a triangle, when the sum of any two sides is greater than the
    third side. For example, 3, 4, and 5 are the sides of a triangle because the sum of any pair of sides
    is bigger than the third side. But 12, 3, and 8 are not sides of a traingle because 3 + 8 = 11 is not
    greater than 12.
    Write a program to have the user enter three lengths of sides and determine whether the figure is a
    triangle or not.

    --------------------------------------------------

    Heres what i got, im not sure if it is correct though :S

    Code:
           
            Console.BackgroundColor = ConsoleColor.Green
            Console.ForegroundColor = ConsoleColor.DarkRed
            Console.Clear()
            Console.WriteLine("The Purpose of this program to have the user enter three lengths of sides and determine whether the figure is a triangle or not. Please press Enter to start the Program.")
            Console.ReadLine()
            Console.BackgroundColor = ConsoleColor.Blue
            Console.ForegroundColor = ConsoleColor.Cyan
            Console.Clear() 'Clears screen
            Console.Beep()
            Do
                Dim Side1 As Double 'This is the First side of the Triangle.
                Dim Side2 As Double 'This is the Second side of the Triangle.
                Dim Side3 As Double 'This is the Third side for the Triangle
                Console.Clear()
                Console.WriteLine("Please enter a Value for Side 1")
                Side1 = Console.ReadLine
                Console.WriteLine("Please enter a Value for Side 2")
                Side2 = Console.ReadLine
                Console.WriteLine("Please enter a Value for Side 3")
                Side3 = Console.ReadLine
                Console.ForegroundColor = ConsoleColor.Yellow
                If Side1 + Side2 > Side3 Then Console.WriteLine("Congradulations, That is a Successful Triangle!")
                Console.ForegroundColor = ConsoleColor.Red
                If Side1 + Side2 < Side3 Then Console.WriteLine("Sorry, That is not a Triangle!")
                Console.ForegroundColor = ConsoleColor.Gray
                Console.WriteLine("Would you like to try again? Press enter and then Type in 3 lengths to determine if it is a Triangle or not")
                Console.ReadLine()
                Console.ForegroundColor = ConsoleColor.Cyan
    Loop
    Last edited by fix23; Oct 2nd, 2007 at 09:08 PM.

  22. #22
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: I need a little bit of help. Please look here

    It's not complete. There is no end to your Do loop.

  23. #23

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    58

    Re: I need a little bit of help. Please look here

    Oh, oops it was there but i didnt copy it all.... is it perfect with is now?? (i hav the loop)

  24. #24
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: I need a little bit of help. Please look here

    Don't see it... It's the same as before.

  25. #25

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    58

    Re: I need a little bit of help. Please look here

    There. now how is it?

  26. #26
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: I need a little bit of help. Please look here

    Looks good, did you run it?

  27. #27

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    58

    Re: I need a little bit of help. Please look here

    Yea, problem is it only says " Congradulations, That is a Successful Triangle!"

    it never says it failed... i thingk somthing is wrong

  28. #28
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: I need a little bit of help. Please look here

    What numbers are you using?

    Try 5, 7, 5

  29. #29

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    58

    Re: I need a little bit of help. Please look here

    Its still saying successful triangle... i cant get a fail triangle...

  30. #30
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: I need a little bit of help. Please look here

    That is impossible with the numbers I gave you. Step thru the debugger to see where it fails...

  31. #31

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    58

    Re: I need a little bit of help. Please look here

    how do i step threw the debugger?

    and could you try my code on your computer with your numbers??

    thanks

  32. #32
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: I need a little bit of help. Please look here

    I don't currently have VB.NET installed on my computer...

  33. #33

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    58

    Re: I need a little bit of help. Please look here

    could you quickly install the trial from microsoft?

    i just dont have any clue on how this is not working

  34. #34
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: I need a little bit of help. Please look here

    Have a mod move this thread to the .NET forum. You would have a larger .NET audience.

  35. #35

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    58

    Re: I need a little bit of help. Please look here

    dam... ok thanks for your input...

    Mods please move this i guess then, thanks

  36. #36
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: I need a little bit of help. Please look here

    You should probably PM a mod to get their attention...

  37. #37
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: I need a little bit of help. Please look here

    You didn't test all possible combinations of the test. You just tested one equation and went on with congratulating the user. If the user assigned the lengths differently then your test will fail. Pseudo code follows

    If A + B <= C Then Failed
    If B + C <= A Then Failed
    If A + C <= B Then Failed
    All Tests passed Then Success

    It's simple logic and has nothing to do with the programming language. Before you can write code you need to analyze... the task given to you was an exercise to that end. Always resorting to asking others to do it for you defeats the purpose of learning from experience.

    Not that I'm saying you should never ask questions, rather try to also learn debugging skills while you still have time to do so.
    Last edited by leinad31; Oct 3rd, 2007 at 12:13 AM.

  38. #38

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    58

    Re: I need a little bit of help. Please look here

    Can somone try and tell me why i cant get it to say som things failed... here is the question

    Three numbers represent the sides of a triangle, when the sum of any two sides is greater than the
    third side. For example, 3, 4, and 5 are the sides of a triangle because the sum of any pair of sides
    is bigger than the third side. But 12, 3, and 8 are not sides of a traingle because 3 + 8 = 11 is not
    greater than 12.
    Write a program to have the user enter three lengths of sides and determine whether the figure is a
    triangle or not.

    ----------------------------------------------------------------

    This is my code...

    Code:
           
            Console.BackgroundColor = ConsoleColor.Green
            Console.ForegroundColor = ConsoleColor.DarkRed
            Console.Clear()
            Console.WriteLine("The Purpose of this program to have the user enter three lengths of sides and determine whether the figure is a triangle or not. Please press Enter to start the Program.")
            Console.ReadLine()
            Console.BackgroundColor = ConsoleColor.Blue
            Console.ForegroundColor = ConsoleColor.Cyan
            Console.Clear() 'Clears screen
            Console.Beep()
            Do
                Dim Side1 As Double 'This is the First side of the Triangle.
                Dim Side2 As Double 'This is the Second side of the Triangle.
                Dim Side3 As Double 'This is the Third side for the Triangle
                Console.Clear()
                Console.WriteLine("Please enter a Value for Side 1")
                Side1 = Console.ReadLine
                Console.WriteLine("Please enter a Value for Side 2")
                Side2 = Console.ReadLine
                Console.WriteLine("Please enter a Value for Side 3")
                Side3 = Console.ReadLine
                Console.ForegroundColor = ConsoleColor.Yellow
                If Side1 + Side2 > Side3 Then Console.WriteLine("Congradulations, That is a Successful Triangle!")
                Console.ForegroundColor = ConsoleColor.Red
                If Side1 + Side2 < Side3 Then Console.WriteLine("Sorry, That is not a Triangle!")
                Console.ForegroundColor = ConsoleColor.Gray
                Console.WriteLine("Would you like to try again? Press enter and then Type in 3 lengths to determine if it is a Triangle or not")
                Console.ReadLine()
                Console.ForegroundColor = ConsoleColor.Cyan
    loop

  39. #39

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    58

    Re: I need a little bit of help. Please look here

    Quote Originally Posted by leinad31
    You didn't test all possible combinations of the test. You just tested one equation and went on with congratulating the user. If the user assigned the lengths differently then your test will fail. Pseudo code follows

    If A + B <= C Then Failed
    If B + C <= A Then Failed
    If A + C <= B Then Failed
    All Tests passed Then Success

    It's simple logic and has nothing to do with the programming language. Before you can write code you need to analyze... the task given to you was an exercise to that end. Always resorting to asking others to do it for you defeats the purpose of learning from experience.

    Not that I'm saying you should never ask questions, rather try to also learn debugging skills while you still have time to do so.

    thanks for the help, but i dont understand, im trying everything i can do

  40. #40
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: I need a little bit of help. Please look here

    Maintain a boolean variable initially set to true, set it to false when a test fails. After the three tests have been conducted, check if the boolean is still true. If it is then success you have a triangle, inform the user. Else inform the user that it is not a triangle.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width