<?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>cpp class | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/cpp-class/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Sun, 11 Dec 2022 09:24:47 +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 to illustrate Hybrid Inheritance.</title>
		<link>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-illustrate-hybrid-inheritance/</link>
					<comments>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-illustrate-hybrid-inheritance/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Sat, 13 Mar 2010 16:34:11 +0000</pubDate>
				<category><![CDATA[Advanced programs]]></category>
		<category><![CDATA[c program]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[cpp class]]></category>
		<category><![CDATA[public]]></category>
		<category><![CDATA[protected]]></category>
		<category><![CDATA[Hybrid Inheritance]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1062</guid>

					<description><![CDATA[<p>C++ program to illustrate Hybrid Inheritance. #include #include class stu { protected: int rno; public: void get_no(int a) { rno=a; } void put_no(void) { out</p>
<p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-illustrate-hybrid-inheritance/">C++ program to illustrate Hybrid Inheritance.</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>C++ program to illustrate Hybrid Inheritance.</p>
<pre lang="cpp">
#include<iostream.h>
#include<conio.h>
class stu
{
protected:
  	int rno;
public:
 	void get_no(int a)
{
rno=a;
 	}
void put_no(void)
 	{
 		out<<"Roll no"<<rno<<"\n";
 	}
};
class test:public stu
{
  	protected:
  	float part1,part2;
public:
  void get_mark(float x,float y)
  {
   	part1=x;
   	part2=y;
  }
void put_marks()
{
 cout<<"Marks obtained:"<<"part1="<<part1<<"\n"<<"part2="<<part2<<"\n";
}
};
class sports
{
 	protected:
 	float score;
public:
 void getscore(float s)
 {
  	score=s;
 }
void putscore(void)
{
 	cout<<"sports:"<<score<<"\n";

}
};

class result: public test, public sports
{
 	float total;
public:
 	void display(void);
};
void result::display(void)
{
 	total=part1+part2+score;
 	put_no();
 	put_marks();
 	putscore();
 	cout<<"Total Score="<<total<<"\n";
}
int main()
{
 	clrscr();
 	result stu;
 	stu.get_no(123);
 	stu.get_mark(27.5,33.0);
 	stu.getscore(6.0);
 	stu.display();
 	return 0;
}
</pre>
<p><strong>OUTPUT</strong></p>
<p>	Roll no  123<br />
	Marks obtained : part1=27.5<br />
	Part2=33<br />
	Sports=6<br />
	Total score = 66.5</p><p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-illustrate-hybrid-inheritance/">C++ program to illustrate Hybrid Inheritance.</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-hybrid-inheritance/feed/</wfw:commentRss>
			<slash:comments>15</slash:comments>
		
		
			</item>
		<item>
		<title>C++ program to print student details using constructor and destructor</title>
		<link>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-print-student-details-using-constructor-and-destructor/</link>
					<comments>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-print-student-details-using-constructor-and-destructor/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Fri, 12 Mar 2010 18:22:49 +0000</pubDate>
				<category><![CDATA[Advanced programs]]></category>
		<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[c programs]]></category>
		<category><![CDATA[constructor]]></category>
		<category><![CDATA[destructor]]></category>
		<category><![CDATA[cpp class]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1046</guid>

					<description><![CDATA[<p>AIM: A program to print student details using a constructor and destructor. ALGORITHM: PROGRAM Output:</p>
<p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-print-student-details-using-constructor-and-destructor/">C++ program to print student details using constructor and destructor</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><strong>AIM: </strong></p>



<p>A program to print student details using a constructor and destructor.</p>



<p><strong>ALGORITHM:</strong></p>



<ol>
<li>Start the process</li>



<li>Invoke the classes</li>



<li>Call the read() function
<ul>
<li>Get the inputs name, roll number and address</li>
</ul>
</li>



<li>Call the display() function
<ul>
<li>Display the name, roll number, and address of the student</li>
</ul>
</li>



<li>Stop the process</li>
</ol>



<p><strong>PROGRAM</strong></p>



<pre class="wp-block-code"><code lang="cpp" class="language-cpp">#include &lt;iostream>
using namespace std;

class student
{
	private: char name[20],add[20];
	  	int roll,zip;
	public: student ( ); //Constructor
		~student( ); //Destructor
		void read( );
		void disp( );			
};

student :: student( )
{
	cout&lt;&lt;"Student class constructor called."&lt;&lt;endl;
}

void student :: read( )
{
	cout&lt;&lt;"Enter the student Name: ";
	cin>>name;
	cout&lt;&lt;"Enter the student roll no: “;
	cin>>roll;
	cout&lt;&lt;"Enter the student address: ";
	cin>>add;
	cout&lt;&lt;"Enter the Zipcode: ";
	cin>>zip;
}

void student :: disp( )
{
	cout&lt;&lt;"Studet details"&lt;&lt;endl;
	cout&lt;&lt;"Student Name   :"&lt;&lt;name&lt;&lt;endl;
	cout&lt;&lt;"Roll no is     :"&lt;&lt;roll&lt;&lt;endl;
	cout&lt;&lt;"Address is     :"&lt;&lt;add&lt;&lt;endl;
	cout&lt;&lt;"Zipcode is     :"&lt;&lt;zip&lt;&lt;endl;
}

student :: ~student( )
{
	cout&lt;&lt;"Student class destructor called.";
}
 
int main( )
{
	student s;
	s.read();
	s.disp();
}</code></pre>



<p><strong>Output:</strong></p>



<pre class="wp-block-code"><code lang="" class="">Student class constructor called.

Enter the student Name: Rajesh
Enter the student roll no: 1234
Enter the student address: Bangalore
Enter the Zipcode: 560001

Studet details
Student Name   :Rajesh
Roll no is     :1234
Address is     :Bangalore
Zipcode is     :560001

Student class destructor called.</code></pre>



<p></p><p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-print-student-details-using-constructor-and-destructor/">C++ program to print student details using constructor and destructor</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-print-student-details-using-constructor-and-destructor/feed/</wfw:commentRss>
			<slash:comments>34</slash:comments>
		
		
			</item>
	</channel>
</rss>
