<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>class implementations | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/class-implementations/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Fri, 12 Mar 2010 09:45:07 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>
	<item>
		<title>C++ program for implementation of class</title>
		<link>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-for-implementation-of-class/</link>
					<comments>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-for-implementation-of-class/#respond</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Fri, 12 Mar 2010 09:45:07 +0000</pubDate>
				<category><![CDATA[Advanced programs]]></category>
		<category><![CDATA[Source Codes]]></category>
		<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[C++ Programs]]></category>
		<category><![CDATA[c++ class]]></category>
		<category><![CDATA[class implementations]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1044</guid>

					<description><![CDATA[<p>AIM: A program to solve a quadratic equation, using OOP techniques. ALGORITHM: 1) Start the process 2) Invoke the classes 3) Get the input for a,b,c; 4) Call the function getinfo() and display() 5) Check if a=0 a) True : compute c/b; i) Print the value of a/c; b) False: compute b*b-4*a*c; i) If (</p>
<p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-for-implementation-of-class/">C++ program for implementation of class</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><strong>AIM: 	</strong><br />
	A program to solve a quadratic equation, using OOP techniques.</p>
<p><strong>ALGORITHM: </strong></p>
<p>1)	Start the process<br />
2)	Invoke the classes<br />
3)	Get the input for a,b,c;<br />
4)	Call the function getinfo() and display()<br />
5)	Check if a=0<br />
a)	True : compute c/b;<br />
i)	Print the value of a/c;<br />
b)	False: compute b*b-4*a*c;<br />
i)	If ( b*b-4*a*c)=0<br />
ii)	Call img();<br />
iii)	Otherwise : call real(a,b,c);<br />
6)	Stop the process</p>
<p><strong>PROGRAM:</strong></p>
<pre lang="cpp">
	#include<iostream.h>
	#include<conio.h>
		class equation
		{
			private:float a,b,c;
			public: void getinfo(float  a, float b,float c );
				void display( );
				void equal(float  a, float b);
				void imag( );
				void real(float a,float b,float c);
		};
		void  equation :: getinfo(float aa,float bb,float cc)
		{
	                a=aa;
			b=bb;
		        c=cc;
		}
		void equation::display( )
		{
			cout<<endl;
			cout<<”a=”<<a<<’\t’;
			cout<<”b=”<<b<<’\t’;
			cout<<”c=”<<c<<endl;
		}		

void equation ::equal (float a,float b)
		{
			float x;
			x = -b/(2*a);
			cout<<”Roots are equal “<<x<<endl;
		}
		void equation :: imag( )
		{
			cout<<”Roots are imaginary”;
		}
		void equation :: real(float a,float b,float det)
		{
			float x1,x2,temp;
			temp = sqrt(det);
			x1= (-b + temp)/(2*a);
			x2 = (-b –temp)/(2*a);
			cout<<”Roots are real”;
			cout<<”x1= “<<x1<<endl;
			cout<<”x2 =”<<x2<<endl;
		}
		void main( )
		{
			class equation e;
			float aa,bb,cc;
			clrscr( );
			cout<<”Enter the three numbers”;
			cin>>aa>>bb>>cc;
			e.getinfo(aa,bb,cc);
			e.display( );
			if(aa = =0)
			{
				float temp;
				temp = cc/bb;
				cout<<” Linear Roots”<<temp<<endl;
			}
			else
			{
				float det;
				det = (bb*bb – 4*aa*cc);
				if(det = =0)
				e.equal(aa,bb);
				else if (det<0 )
				          e.imag( );
				else 
				          e.real(aa,bb,cc );
			}
			getch( );
		}	
</pre>
<p><strong>OUTPUT:</strong><br />
	Enter the three numbers 2 4 1<br />
	Roots are imaginary<br />
	X1= - 0.292893<br />
	X2= - 1.707107</p><p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-for-implementation-of-class/">C++ program for implementation of class</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-for-implementation-of-class/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
