i have written this program and made 3 constructors in the class and i want to call them in the main and i cant can any one help me and tell me how could i call them in the main
# include
using namespace std ;
class Triangle {
private :
float side1 ;
float side2 ;
float side3 ;
public :
Triangle () ;
Triangle (float , float , float ) ;
Triangle ( float[3] ) ;
float printAverage () ;
};
Triangle :: Triangle ()
{
float firstSide , secondSide , thirdSide ;
side1 = firstSide ;
side2 = secondSide ;
side3 = thirdSide ;
}
Triangle :: Triangle ( float firstSide , float secondSide , float thirdSide )
{
side1 = firstSide ;
side2 = secondSide ;
side3 = thirdSide ;
}
Triangle :: Triangle ( float side[3] )
{
side1 = side[0] ;
side2 = side[1] ;
side3 = side[2] ;
}
float Triangle::printAverage ()
{
return ( side1 + side2 + side3 ) / 3 ;
}
int main ()
{
float firstSide , secondSide , thirdSide ;
cout << "Enter First Side : " ;
cin >> firstSide ;
cout << "Enter Second Side : " ;
cin >> secondSide ;
cout << "Enter Third Side : " ;
cin >> thirdSide ;
Triangle tri1 = Triangle () ;
Triangle tri2 = Triangle () ;
Triangle tri3 = Triangle () ;
system("pause");
return 0;
}
Ten Operator Syntax
Hi Guys,I can't figure out why i am getting a parse error with this basic ten op code:$prodTH = ($prodIA == "Y") ? "<img src=\"" . amazon_display_thumbnail($prodID)
How to add an image/C++ OpenGL?
Hi,
displaying unknown amount of results
I am reading a directory and getting a list of folders in the directory, I want to display the folders in a table which is 6 columns of results across by how ever may rows, here is the code I am using
[newb] Image hosting help.
Hey there, I'm new to php, I know some basics and i can code PWN, I'm only 14 but I'm interested in PHP, I have bought a dedicated server, (With unlimited bandwidth of corse, And 2tb Hard drives), And
Simple code help with redirects
I am trying to figure out a redirect script that detects if the browser is IE 7 and if it does, redirect the user to another page. Is this even possible?
gettext translates ALWAYS?
I'm using gettext with the new version of XAMPP (5.3.0) on Windows Seven RTM (build 7600)gettext-support is enabled.It used to work perfectly a few weeks ago.I'm not quite sure what changed this. Be
Session
I am having a little trouble with a session. Not sure if it is my browser or what. I know I do not have any trouble logging into forums such at these, so not sure why this is not working.first the
Help with forum quoting?
Hi im working on a forum and I have alomost finished it but i want a user quote system like twitter and facebook with the @ sign to start it off, however even though im good at php coding and have
Just a white page
Okay so, my website, when I click SignUp on it it takes me to /join.php but its a complete white page.Take a look below. If you know what it is please helphttp://www.testime.tk/
How to get exact 3 moths post date from today date using javascript
How to get exact 3 moths post date from today date using javascriptPlease help