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;
}
How to grab certain words ??
I am working with this APIReturns JSON.curl http://letsbetrends.com/api/current_trendsHow to grab just the trending topics Which come after "name" : "xxxxxxxx" (the x's)Or how to
PHP/Database issue
My friend is helping me make a database where you go to a certain webpage of my site and the page will use code to pull information from a database and display it on the page in a formatted way.Code:
Get keys and values from an array
Hellow,I have an array $Data with keys and values. With a foreach I can display all the values:foreach($Data as $var){ echo $var;}but I also want to display al the keys... how can i do that?
Need help urgant
why down my code ony return one item instead of all the items selected. $arr =
Re-Order by ID Number
I have a cms set up for inputting an image, thumb, title, pdf, and eps. When input the database assigns an ID number. The front end displays each upload by ID number. I'm trying to set up the back
Snapshot from video
anyone knw how to make a snapshot maker from avi n mkv format.for example if i give a direct link (mysite.com/song.avi) then it will give a snapshot in jpg format
Not "Just Another" MMORPG - text based.
Hello,I've been learning MySQL and PHP for the last 2-3 years.Though, I've had long pauses and months without touching PHP.Now, I started at a new school this autumn, and I found that some of my old
Code Help.. If txt input box empty search X instead..
I am having a problem with my search script. At current it will simply search by a selected date which is a java based calendar that displays when using id='datedisplay' in the input form field below.
A href problem under php
Hello...I tried to explain the issue in an earlier post.. but was not clear enough....So let me try again:I think that the problem happens in Loops (while).When I add a simple html a href (link)...
timezone change with date()
so i put all my times for posts in my made from scratch forum(not phpbb3 or sm)in my mysql db using the time()and when i show the time on webpages i use the date('ymd/h:i:s', $time) kind of thing.now