Friday, 9 January 2015

Author Messages










This is blogs my project programming c++ language
Blogs provide an online space for reflective writing and commentary. Campus Pack blogs can be viewable by all students in the class and the instructor. Each student posts individual entries to the blog and the rest of the class can comment on their posts. In a Blackboard course campus pack blogs can be deployed for: 
Everybody plz help if these blogs worng talking.These site working running

Write a Object Oriented Program to Display Studnet Information

// Write a Object Oriented Program to Display Studnet Information

#include<iostream>
#include<stdio.h>
#include<cstdlib>
#include<conio.h>
#include<iomanip>
#include<cstring>
using namespace std;

class student
{
public:

char first_name[50], last_name[50];
int roll;
float ban_mark,eng_mark,mat_mark;

};

int main()
{

student infor;

char option, select;


FILE *fp;
fp=fopen("users.txt","rb+");

if (fp == NULL)
{
fp = fopen("users.txt","wb+");

return 0;

}


while(1)
{

system("cls");
cout << "\n\n";
cout << "\t\t****** INFORMATION OF STUDENTS ******";
cout << "\n\n";
cout << "\n \t\t 1. Add Students";
cout << "\n \t\t 2. Show Records";
cout << "\n \t\t 3. Exit";
cout << "\n\n";
cout <<"\t Select What you want:> infor.first_name;
cout << "Last Name : ";
cin >> infor.last_name;
cout << "Roll No : ";
cin >> infor.roll;
cout << "Marks of Bangla : ";
cin >> infor.ban_mark;
cout << "Marks of English : ";
cin >> infor.eng_mark;
cout << "Marks of Mathmetic : ";
cin >> infor.mat_mark;

fwrite(&infor,sizeof(infor),1,fp);
cout << "\n Add Another Record (Y/N) ";
fflush(stdin);
option = getchar();
}
break;
case '2':
system("cls");
rewind(fp);
cout << "=== View the Records in the Database ===";
cout << "\n";
while (fread(&infor,sizeof(infor),1,fp) == 1)
{
cout << "\n";
cout <<"\t Name of Students : "<< infor.first_name << setw(5)<< infor.last_name;
cout << "\n";
cout <<"\t Roll No : " <<infor.roll;
cout << "\n";
cout <<"\t Bangla : " <<infor.ban_mark;
cout << "\n";
cout << "\t English : " <<infor.eng_mark;
cout << "\n";
cout <<"\t Mathmetics : " <<infor.mat_mark<<endl;
cout<<"\t" <<endl<<"================================="<<endl;
}
cout << "\n\n";
system("pause");
break;

case '3':
system("cls");
fclose(fp);
cout << "\n\n";
cout << "\t\t********************************************************"<<endl;
cout << "\t\t* THANKS BY MD.HASMOT HOSSEN. *"<<endl;
cout << "\t\t********************************************************"<<endl;
cout << "\n\n";
exit(0);
}
}

system("pause");
return 0;
}

Write a program calculate square and cube of given number using inheritance

// write a program calculate square and cube of given number using inheritance

#include<iostream>
using namespace std;
//using by inheritence

class hasmot_cal
{

public:
int a,b,output;
void setnub1(int a)
{
 nub1=a;
}

void setnub2( int b)
{
 nub2=b;
}
protected:
   int nub1=a;
   int nub2=b;
};

class addition:public hasmot_cal
{

public:
void ad()
{
int a,b;
cout<<"\n \n"<<"enter your addition digit?";
cin>>a>>b;
output=a+b;
cout<<""<<"your addition output = "<<" "<<output<<endl;
}
};


class Subtraction:public hasmot_cal
{
public:
void su()
{
int a,b;
cout<<"\n \n"<<"enter your Subtraction digit?";
cin>>a>>b;
output=a-b;
cout<<""<<"your Subtraction output = "<<" "<<output<<endl;
}
};

int main()
{
hasmot_cal ajaira;
addition ss;
ss.ad();
Subtraction pp;
pp.su();

return 0;
};

Write a program calculate square and cube of given number using constractor

// write a program calculate square and cube of given number using constractor
#include<iostream>
using namespace std;
class ac
{
public:
int n;
ac();
~ac();
void sq();
void cb();
};
ac::ac()
{
cout<<"Enter the number : ";
cin>>n;
}
ac::~ac()
{
cout<<""<<endl;
}
void ac::sq()
{
cout<<" The value of square is : "<<n*n;
}
void ac::cb()
{
cout<<" The value of cube is : "<<n*n*n;
}

int main()
{
ac sss;
sss.sq();
cout<<endl;
sss.cb();
//return 0;
}

Write a program calculate square and cube of given number using polymafaiom


//write a program calculate square and cube of given number using polymafaiom
#include<iostream>
using namespace std;

class sc
{
public:
void setnum(int n)
{
number=n;
}
protected: int number;
};

class square: public sc
{

public:
int re;
void sq()
{
re=number*number;
cout<<"The result of sq : "<<re;
}

};
class cube: public sc
{

public:
int re;
void cub()
{
re=number*number*number;
cout<<"The result of cube : "<<re;
}

};

int main()
{
int n;
square s;
cube cb;
sc *p1=&s;
sc *p2=&cb;
cout<<"Enter the number ofr sq: ";
cin>>n;
p1->setnum(n);
s.sq();
cout<<"\n\nEnter the number for cube: ";
cin>>n;
p2->setnum(n);
cb.cub();
return 0;
}

Write a program calculate square and cube of given number using inheritance

// write a program calculate square and cube of given number using inheritance

#include<iostream>
using namespace std;
//using by inheritence

class hasmot_cal
{
public:
int a,b,output;
void setnub1(int a)
{
 nub1=a;
}

void setnub2( int b)
{
 nub2=b;
}
protected:
   int nub1=a;
   int nub2=b;
};

class addition:public hasmot_cal
{
public:
void ad()
{
int a,b;
cout<<"\n \n"<<"enter your addition digit?";
cin>>a>>b;
output=a+b;
cout<<""<<"your addition output = "<<" "<<output<<endl;
}
};


class Subtraction:public hasmot_cal
{
public:
void su()
{
int a,b;
cout<<"\n \n"<<"enter your Subtraction digit?";
cin>>a>>b;
output=a-b;
cout<<""<<"your Subtraction output = "<<" "<<output<<endl;
}
};

int main()
{
hasmot_cal ajaira;
addition ss;
ss.ad();
Subtraction pp;
pp.su();

return 0;
};

Write a program Check Whether the given number is Strange or Not

//write a program Check Whether the given number is Strange or Not.

#include<iostream>
using namespace std;
//base class
class strange
{
public:
void setdigit(int d)
{
digit=d;
}
protected:
int digit;
};
//derived class
class number : public strange
{
public:
int i,j,t=1,d;
int devide()
{
while(d!=0)
{
j=d%10;
d=d/10;
for(i=2;i<j;i++)
{
if(j%i==0)
{
t=0;
i=j;
}
}
}
}
int check()
{
if(t==1)
cout<<"number is strange";
else
cout<<"number is not strange";
}
};
int main()
{
number hh;
int a;
cin>>a;
hh.setdigit(a);
hh.check();
}