<?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>c++ class | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/c-class/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Sat, 13 Mar 2010 18:08:00 +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++ class program to illestrate File operations</title>
		<link>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-class-program-to-illestrate-file-operations/</link>
					<comments>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-class-program-to-illestrate-file-operations/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Sat, 13 Mar 2010 18:08:00 +0000</pubDate>
				<category><![CDATA[Advanced programs]]></category>
		<category><![CDATA[file write]]></category>
		<category><![CDATA[file open]]></category>
		<category><![CDATA[File operations]]></category>
		<category><![CDATA[c++ class]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1070</guid>

					<description><![CDATA[<p>AIM Write a program to illustrate the write() member function which are usually used for transfer of data blocks to the file. ALGORITHM 1. Start the process 2. Invoke the class a. Create two inline member functions .ie, getdata() and dispdata() i. getdata() for input ii. dispdata() for display 3. Open the file in fstream</p>
<p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-class-program-to-illestrate-file-operations/">C++ class program to illestrate File operations</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><strong>AIM</strong><br />
	Write a program to illustrate the write() member function which are usually used for transfer of data blocks to the file.</p>
<p><strong>ALGORITHM</strong></p>
<p>1.	Start the process<br />
2.	Invoke the class<br />
a.	Create two inline member functions .ie, getdata() and dispdata()<br />
i.	getdata() for input<br />
ii.	dispdata() for display<br />
3.	Open the file in fstream mode<br />
4.	Write the data in to the file<br />
5.	Slose the file<br />
6.	Stop the process</p>
<p><strong>PROGRAM</strong></p>
<pre lang="cpp">
#include<iostream.h>
#include<conio.h>
#include<fstream.h>
class student
{
private:
int rno;
char name[10];
float fees;
public:
void getdata()
{
cout<<"roll number";
cin>>rno;
cout<<endl;
cout<<"enter name:";
cin>>name;
cout<<endl<<"enter fees:";
cin>>fees;
}
void dispdata()
{
cout<<"Roll number"<<rno<<endl;
cout<<"Name"<<name<<endl;
cout<<"Fees"<<fees;
}
};

void main()
{
student s1;
clrscr();
ofstream stdfile("c:\\std.txt");
//fstream stdfile;
//stdfile.open("c:\\std.txt",ios::out|ios::in);  //open file for output
char wish;
//writing to the file
do
{
s1.getdata();
stdfile.write((char*)&#038;s1,sizeof(student));
cout<<"continue ? y/n";
cin>>wish;
}
while(wish=='y'||wish=='Y');
stdfile.close();   //close the file

getch();
}
</pre>
<p><strong>OUTPUT</strong></p>
<p>Roll number  121<br />
Enter name  Jacob<br />
Enter fees   10000</p><p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-class-program-to-illestrate-file-operations/">C++ class program to illestrate File operations</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-class-program-to-illestrate-file-operations/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>c++ Program to illustrate the use of difference operators using friend function</title>
		<link>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-illustrate-the-use-of-difference-operators-using-friend-function/</link>
					<comments>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-illustrate-the-use-of-difference-operators-using-friend-function/#respond</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Sat, 13 Mar 2010 04:29:18 +0000</pubDate>
				<category><![CDATA[Advanced programs]]></category>
		<category><![CDATA[difference operators]]></category>
		<category><![CDATA[friend function]]></category>
		<category><![CDATA[c++ class]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[C Programs]]></category>
		<category><![CDATA[Source Codes]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1048</guid>

					<description><![CDATA[<p>AIM: A program to illustrate the use of difference operators to access the class member using friend function ALGORITHM: 1) Start the process 2) Invoke the classes 3) Call the set_xy() first a) Assign the value of x and y b) Print the value of x and y 4) Call the sum() for second(friend) a)</p>
<p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-illustrate-the-use-of-difference-operators-using-friend-function/">c++ Program to illustrate the use of difference operators using friend function</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 illustrate the use of difference operators to access the class member using friend function<br />
<strong><br />
ALGORITHM: </strong></p>
<p>1)	Start the process<br />
2)	Invoke the classes<br />
3)	Call the set_xy() first<br />
a)	Assign the value of x and y<br />
b)	Print the value of x and y<br />
4)	Call the sum() for second(friend)<br />
a)	Again assign the temp value of x and y<br />
5)	Print the value of x and y<br />
6)	Stop the process</p>
<p><strong>PROGRAM</strong></p>
<pre lang="cpp">
#include<iostream.h>
class M
{
int x;
int y;
public:
void set_xy(int a,int b)
{
x=a;
y=b;
}
friend int sum(M m);
};
int sum(M m)
{
int M ::* px=&M :: x;
int M ::* py=&M :: y;
M *pm=&m;
int s=m.*px + pm->*py;
return s;
}
main()
{
M n;
void (M :: *pf)(int,int)=&M :: set_xy;
(n.*pf)(10,20);
cout<<"Sum="<<sum(n)<<"\n";
M *op=&n;
(op->*pf)(30,40);
cout<<"Sum="<<sum(n)<<"\n";
return(0);
}
</pre>
<p><strong>Output:</strong></p>
<p>	Sum=30<br />
	Sum=70</p><p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-illustrate-the-use-of-difference-operators-using-friend-function/">c++ Program to illustrate the use of difference operators using friend function</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-to-illustrate-the-use-of-difference-operators-using-friend-function/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<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[Algorithms]]></category>
		<category><![CDATA[class implementations]]></category>
		<category><![CDATA[c++ class]]></category>
		<category><![CDATA[C++ Programs]]></category>
		<category><![CDATA[Source Codes]]></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>
