Computer Science Canada Triangles |
Author: | Jessica359 [ Mon Feb 25, 2008 2:37 pm ] |
Post subject: | Triangles |
ok so we have to ask a use for the base and height of the triangle to get the surface area. But we also need to give them a picture of that triangle. How do you make a triangle that meets the users entries? Code: var base :real var height: real var diameter: real var radius: real put "What is the base of the triangle?" get base put "What is the height of the triangle?" get height put "The area of your triangle is ",base*height/2 delay(1500) cls put "What is the diameter of the circle" get diameter put "The area of your circle is ",3.14*diameter radius :=diameter/2 Draw.Oval (50,50,round (radius),round (radius),50) delay(1500) cls drawline (250,250,300,310,2) drawline (300,310,350,250,2) drawline (250,250,350,250,2) drawfill (275,275,1,2) thanks |
Author: | BigBear [ Mon Feb 25, 2008 3:02 pm ] | ||||||||
Post subject: | Re: Triangles | ||||||||
After you get the dimensions the length of the base and the hieght you could set an intially point for the bottom line and add the length that they want
Then you ask them for the hight.
So once you choose a starting point just use the input to draw the sides. Hope this helps. Also for future posts use code tags meaning type this before your code
|
Author: | A.J [ Tue Feb 26, 2008 7:28 pm ] |
Post subject: | Re: Triangles |
or you could use Draw.Polygon It is helpful ![]() |
Author: | Nick [ Wed Feb 27, 2008 6:25 am ] |
Post subject: | RE:Triangles |
BigBear, you can over comment |
Author: | Jessica359 [ Mon Mar 10, 2008 3:40 pm ] |
Post subject: | RE:Triangles |
Awesome thanks! There is no such thing as over commeting ![]() |
Author: | Tallguy [ Thu Apr 03, 2008 7:53 am ] |
Post subject: | RE:Triangles |
what unit did we do that program in jess? |
Author: | andrew. [ Mon Apr 07, 2008 6:18 pm ] | ||
Post subject: | Re: Triangles | ||
Is this what you wanted?
The only thing that I put in is the drawline thing to draw your triangle, and I made the circle center, and I also made it so you press any key to continue. |
Author: | BigBear [ Mon Apr 07, 2008 8:51 pm ] |
Post subject: | Re: Triangles |
I thought this problem was solved, also the circle part was understood and posted in the beginning. |