Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
triangle
- Page 1
Triangle
Programming
Software Development
18 Years Ago
by indulgence
…client’s three points, e.g. right angle
triangle
, isosceles
triangle
and equilateral
triangle
, 2. whether the three points are collinear (…points are on the same line), 3. area of the
triangle
if the three points are not collinear. [code=cpp]…*c)) cout<<"It is a right-angled
triangle
."<<endl; } } [/code] Hello Everyone! I…
Triangle.
Programming
Software Development
15 Years Ago
by jjf3rd77
… the length is double the height and base of the
triangle
it is to be isosceles this is my Isosceles code…
Re: Triangle.
Programming
Software Development
15 Years Ago
by daviddoria
What you have there is simply a hard coded
triangle
. You need to write the code to setup the
triangle
's height and width. Give it a shot and post your problem once you try it.
Re: Triangle.
Programming
Software Development
15 Years Ago
by daviddoria
Here you have declared the variables, but then output just constant expressions... I'd suggest googling for "basic c++" and trying some of the simple examples you find until you get familiar with the basics. Then you can try to write this
triangle
program as a demonstration to yourself that you've learned something! Dave
Re: Triangle.
Programming
Software Development
15 Years Ago
by jjf3rd77
Well i know how to do basic programming, I am in a class. I just do not know what to do next. Hence why I am asking on the forum. They are always my last resort. That is exactly what I do, I do basic programs first and then I elaborate on those. But I am entirely lost on where to go from my basic
triangle
program.
Re: Triangle.
Programming
Software Development
15 Years Ago
by restrictment
… a number, so I may calculate the size of your
triangle
: "; cin >> dimension; for(int x=0;x…
Re: Triangle.
Programming
Software Development
15 Years Ago
by jjf3rd77
if it shows the
triangle
after calculating then it should be ok. Thank a lot!
Triangle
Programming
Software Development
15 Years Ago
by Unidennn
… get it to work but it should be a pascal
triangle
and this is what i get * *** ***** ******* heres the code: [CODE…
Triangle class,how to make it work ??im desperate:(
Programming
Software Development
16 Years Ago
by TAboy24
…, int deltaY) { //supposed to move the whole
triangle
using the function "move" (see the …formula it finds us the area of the
triangle
double perimeter=getPerimeter(); return Math.sqrt(perimeter*(perimeter…(p3,p1));} boolean isIsosceles() { //checking if the
triangle
is isosceles.... if ( getLengthOfSide(p1,p2)==getLengthOfSide(p2,p3…
triangle, rectangle and TwoDShape
Programming
Software Development
17 Years Ago
by piers
… height and width in my calculateArea method in the
triangle
class when the height and the width are private…: • A String holding the name of the style of the
triangle
, e.g. Scalene, Isosceles, Equilateral. (Note: Your program …does not have to calculate the type of
triangle
) It will have a constructor which takes three parameters …
Re: triangle, rectangle and TwoDShape
Programming
Software Development
17 Years Ago
by piers
… correct area and for the style for the
triangle
. for the rectangle I just need to print… code it only ever displays for both rectangle and
Triangle
the result 0.0. [CODE]class TwoDShapeDriver { …public static void main (String []args) {
Triangle
t1 = new
Triangle
(44,55,"scalene"); System.out.println(t1…
Triangle Class/Tester Help
Programming
Software Development
13 Years Ago
by cecsFTL
…perimeter; private double area; private double s; public
Triangle
(double x1, double y1, double x2, double … point: "); double y3 = scanObject.nextInt();
Triangle
myTriangle = new
Triangle
(x1, y1, x2, y2, x3, y3); …out.println(myTriangle); else System.out.println("This
triangle
is invalid"); } } }[/CODE] I know…
Re: Triangle Class/Tester Help
Programming
Software Development
13 Years Ago
by Taywin
…you that any addition of 2 sides of a
triangle
must be greater than the other side. Let…. 1)If these points do form an arbitrary
triangle
, and you want to go from your house …ANY of your starting and end point in a
triangle
. 2)If these points form any equal or…any of them are true, you have an invalud
triangle
. [/QUOTE] I'm sorry to tell you that…
Re: triangle, rectangle and TwoDShape
Programming
Software Development
17 Years Ago
by new_2_java
…driver class.[/QUOTE] Do you ever call the calculateAre of
Triangle
and Rectangle? you should call calculateArea to actually calculate … [code] class TwoDShapeDriver { public static void main (String []args) {
Triangle
t1 = new
Triangle
(44,55,"scalene"); t1.calculateArea(); System.out…
Re: Triangle class,how to make it work ??im desperate:(
Programming
Software Development
16 Years Ago
by quuba
…--------------- TAboy24 try this [icode] boolean isIsosceles() { //checking if the
triangle
is isosceles.... if (getLengthOfSide(p1, p2) == getLengthOfSide(p2, p3))…public static void main(String[] args) { System.out.println((new
Triangle
()).toString()); System.out.println((new Point(1,2)).toString()); } }…
Triangle Drawer
Programming
Software Development
14 Years Ago
by JudeV
…invalid value was entered. Enter the size of the
triangle
: 10 TTTTTTTTTT TTTTTTTTT TTTTTTTT TTTTTTT TTTTTT TTTTT TTTT TTT…{ bError = false; Console.Write("\nEnter the size of the
triangle
: "); iSize = int.Parse(Console.ReadLine()); if ((iSize &…
Re: Triangle Class/Tester Help
Programming
Software Development
13 Years Ago
by hiddepolen
… (yes, I do find that reliable information): [QUOTE]A
triangle
is one of the basic shapes of geometry: a polygon… Euclidean geometry any three non-collinear points determine a unique
triangle
and a unique plane (i.e. a two-dimensional …Euclidean space).[/QUOTE] A
triangle
made with the defenition above CAN have an area of…
Re: triangle, rectangle and TwoDShape
Programming
Software Development
17 Years Ago
by piers
… of then it didnt work. 3. The different styles of
triangle
. however I will go and code some more and then…
Re: triangle, rectangle and TwoDShape
Programming
Software Development
17 Years Ago
by shinnxennosagga
If you need a Rectangle class, then you can just inherit it from TwoDShape and code it all over again, or you may inherit it from
Triangle
class and override method calculateArea(), but the latter is not suggested.
Re: triangle, rectangle and TwoDShape
Programming
Software Development
17 Years Ago
by piers
I have to create the rectangle class. I can't inherit it from
triangle
.
Re: Triangle Class/Tester Help
Programming
Software Development
13 Years Ago
by cecsFTL
… the sides, and perimeter. [CODE]public class
Triangle
{ private double x1; private double y1; private…; private double x3; private double y3; public
Triangle
(double x1, double y1, double x2, double…point: "); double y3 = scanObject.nextDouble();
Triangle
myTriangle = new
Triangle
(x1, y1, x2, y2, x3, y3);…
Re: Triangle Class/Tester Help
Programming
Software Development
13 Years Ago
by cecsFTL
… not calculating the area. [CODE]public class
Triangle
{ private double x1; private double y1; …point: "); double y3 = scanObject.nextDouble();
Triangle
myTriangle = new
Triangle
(x1, y1, x2, y2, x3, y3);… + myTriangle.getArea()); } else System.out.println("This
triangle
is invalid"); } } } [/CODE] I used …
triangle help I'm kinda new ><
Programming
Software Development
13 Years Ago
by xenan
hi can someone helped me in my
triangle
><? my prof told me … the user to input the height of the
triangle
and the user must be able to input… the height.. and the
triangle
must be a
triangle
not a right
triangle
.. this are my codes but …<<"please input the height of the
triangle
"<<endl; cin>>a; …
Triangle Implement measurable error
Programming
Software Development
13 Years Ago
by Sbing
…double getPerimeter(); public double getArea(); } public class
Triangle
implements Measurable // error at
Triangle
- can't have // the same name as …{ private double mySide1; private double mySide2; private double mySide3; public
Triangle
(double Side1, double Side2, double Side3) { mySide1 = side1; mySide2…
Re: Triangle Class/Tester Help
Programming
Software Development
13 Years Ago
by hiddepolen
Taywin is right here. You don't want to check is a+b > c, that is valid for any
triangle
. You should check for a+b < c. Make sure that your isValid method includes: a+b < c, a+c < b and b+c < a. If any of them are true, you have an invalud
triangle
.
Re: Triangle Class/Tester Help
Programming
Software Development
13 Years Ago
by hiddepolen
… a like like you say. Would you call that a
triangle
? I wouldn't. [QUOTE] I'm sorry to tell you… am saying. If any of the following is true, the
triangle
is INvalid: a+b<c, a+c<b…
Re: Triangle Class/Tester Help
Programming
Software Development
13 Years Ago
by cecsFTL
…. I think i have one more error. [CODE]public class
Triangle
{ private double x1; private double y1; private double x2; private…; private double perimeter; private double area; private double s; public
Triangle
(double x1, double y1, double x2, double y2, double x3…
Re: Triangle Class/Tester Help
Programming
Software Development
13 Years Ago
by hiddepolen
True, getArea() should call getPerimeter(), getPerimeter() should call all the getSides(). What is your definition then of a
triangle
? Because I think we must both agree that we need three points, and two points (B and C) in the same spot are not two different points. I wouldn't consider that a
triangle
at all...
Re: Triangle Class/Tester Help
Programming
Software Development
13 Years Ago
by Taywin
I know that it is not a
triangle
. What is "isValid()" method for if it is not for checking whether 3 points are forming a
triangle
? And if B and C are at the same location, it is still valid for the requirement for given 3 points.
Triangle class
Programming
Software Development
13 Years Ago
by alteran
… NervousShapes program and knows how to create a
triangle
please help (even if you have not).…just fine. [CODE] import java.awt.*; public class
Triangle
extends Shape { // Instance variables private int diameter; private…static int[] y = new int[3]; // Constructor public
Triangle
(int x, int y, Color color, int diameter) {…
1
2
3
17
Next
Last
Search
Search
Forums
Forum Index
Hardware/Software
Recommended Topics
Programming
Recommended Topics
Digital Media
Recommended Topics
Community Center
Recommended Topics
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2025 DaniWeb® LLC