cout<<"daftarning sahifalar soni:"<
return 0;
}
2.
Oquv xonasi nomli sinf yarating.
Unda kamida 5 ta maydon va ularni ekranga chiqaruvchi , qayta ishlovchi usullarni yarating.
#include
using namespace std;
class MyClassroom{
public:
string name;
string raqami;
string teacher;
string i;
string k;
string savol;
};
int main()
{
MyClassroom Myroom;
resin:
cout<<"xonaning nomi:";cin>>Myroom.name;
cout<<"xonaning raqami:";cin>>Myroom.raqami;
cout<<"xonaning oqituvchisi:";cin>>Myroom.teacher;
cout<<"xonaning interneti bormi ?"<<" ";cin>>Myroom.i;
cout<<"xonaning kompyuteri bormi ?"<<" ";cin>>Myroom.k;
cout<<" "<
cout<<"xonaning nomi-"<
cout<<"xonaning raqami-"<
cout<<"xonaning oqituvchisi-"<
cout<<"internet-"<
cout<<"kompyuter-"<
cout<<"qayta kiritasiz?";cin>>Myroom.savol;
if(Myroom.savol=="ha")
goto resin;
else
return 0;
}
3.
Nuqta nomlin sinf yaratilsin.Kamidaikkita sinf konstruktri yaratilsin.
Birinchi sinf konturi ikki nuqta orasida gi masofani topilsin
2- konsturuktordauchburchak yuzi topilsin.
#include
#include
using namespace std;
class Nuqta
{
private:
int d,c,e,b;
int q,w;
public:
Nuqta()
{
cout<<"dasturni boshlash"<
}
Nuqta(int y,int z,int x,int k,int g,int m)
{
g=q;
m=w;
d=x;
b=y;
c=z;
e=k;
}
float Masofa(int c,int b,int d,int e)
{float s;
s=sqrt(pow(c-b,2)+pow(d-e,2));
return s;
}
float Yuzasi(int g,int m){
float v;
v=(g*m)/2;
return v;
}
~Nuqta(){
cout<<"dasturni tugatish";
}
};
int main()
{
float x,y,z,q,w,k;
cout<<"1-tomoni kiriting :";