-
Oct 2nd, 2007, 08:08 PM
#1
Thread Starter
Member
I need a little bit of help. Please look here
Last edited by fix23; Nov 8th, 2008 at 06:02 PM.
-
Oct 2nd, 2007, 08:10 PM
#2
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...
-
Oct 2nd, 2007, 08:12 PM
#3
Thread Starter
Member
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
-
Oct 2nd, 2007, 08:16 PM
#4
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...
-
Oct 2nd, 2007, 08:17 PM
#5
Thread Starter
Member
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
-
Oct 2nd, 2007, 08:20 PM
#6
Re: I need a little bit of help. Please look here
How would that be quicker than here with many more people to help???
-
Oct 2nd, 2007, 08:20 PM
#7
Thread Starter
Member
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.
-
Oct 2nd, 2007, 08:29 PM
#8
Thread Starter
Member
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
-
Oct 2nd, 2007, 08:32 PM
#9
Frenzied Member
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
-
Oct 2nd, 2007, 08:33 PM
#10
Re: I need a little bit of help. Please look here
-
Oct 2nd, 2007, 08:33 PM
#11
Thread Starter
Member
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
-
Oct 2nd, 2007, 08:35 PM
#12
Frenzied Member
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
-
Oct 2nd, 2007, 08:36 PM
#13
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...
-
Oct 2nd, 2007, 08:36 PM
#14
Thread Starter
Member
Re: I need a little bit of help. Please look here
yea but i dont kno the codes and stuff... like the formulas
-
Oct 2nd, 2007, 08:40 PM
#15
Thread Starter
Member
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 ><
-
Oct 2nd, 2007, 08:44 PM
#16
Re: I need a little bit of help. Please look here
Then post what you have and someone will help you with that...
-
Oct 2nd, 2007, 08:47 PM
#17
Thread Starter
Member
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()
-
Oct 2nd, 2007, 08:54 PM
#18
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?
-
Oct 2nd, 2007, 08:55 PM
#19
Thread Starter
Member
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?
-
Oct 2nd, 2007, 08:56 PM
#20
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)
-
Oct 2nd, 2007, 09:01 PM
#21
Thread Starter
Member
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.
-
Oct 2nd, 2007, 09:04 PM
#22
Re: I need a little bit of help. Please look here
It's not complete. There is no end to your Do loop.
-
Oct 2nd, 2007, 09:05 PM
#23
Thread Starter
Member
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)
-
Oct 2nd, 2007, 09:07 PM
#24
Re: I need a little bit of help. Please look here
Don't see it... It's the same as before.
-
Oct 2nd, 2007, 09:08 PM
#25
Thread Starter
Member
Re: I need a little bit of help. Please look here
-
Oct 2nd, 2007, 09:13 PM
#26
Re: I need a little bit of help. Please look here
Looks good, did you run it?
-
Oct 2nd, 2007, 09:14 PM
#27
Thread Starter
Member
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
-
Oct 2nd, 2007, 09:15 PM
#28
Re: I need a little bit of help. Please look here
What numbers are you using?
Try 5, 7, 5
-
Oct 2nd, 2007, 09:17 PM
#29
Thread Starter
Member
Re: I need a little bit of help. Please look here
Its still saying successful triangle... i cant get a fail triangle...
-
Oct 2nd, 2007, 09:19 PM
#30
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...
-
Oct 2nd, 2007, 09:20 PM
#31
Thread Starter
Member
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
-
Oct 2nd, 2007, 09:24 PM
#32
Re: I need a little bit of help. Please look here
I don't currently have VB.NET installed on my computer...
-
Oct 2nd, 2007, 09:25 PM
#33
Thread Starter
Member
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
-
Oct 2nd, 2007, 09:28 PM
#34
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.
-
Oct 2nd, 2007, 09:29 PM
#35
Thread Starter
Member
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
-
Oct 2nd, 2007, 09:30 PM
#36
Re: I need a little bit of help. Please look here
You should probably PM a mod to get their attention...
-
Oct 2nd, 2007, 10:51 PM
#37
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.
-
Oct 3rd, 2007, 04:08 PM
#38
Thread Starter
Member
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
-
Oct 3rd, 2007, 04:21 PM
#39
Thread Starter
Member
Re: I need a little bit of help. Please look here
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
-
Oct 3rd, 2007, 07:15 PM
#40
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|