2-jadval.
Telefon sinfini yarating. Unda kamida 5 ta maydon va ularni ekranga chiqaruvchi, qayta ishlovchi usullarni yarating.
#include
#include
using namespace std;
class telefon{
public:
string name;
int year;
string made_country;
int price ;
int memory ;
void print(){
cout<<"Name: "<
}
telefon(){
};
telefon(string a , int b , string c , int d ,int f){
name=a;
year=b;
made_country=c;
price=d;
memory=f;
};
};
int main()
{
telefon a[5];
a[0]=telefon("Samsung A6+",2018,"South Korea",120,32);
a[1]=telefon("Iphone 8+",2019,"America",400,64);
a[2]=telefon("Redmi note 10",2020,"China",260,64);
a[3]=telefon("Iphone 13 proMax ",2021,"Dubai",1200,128);
a[4]=telefon("Samsung S10+",2019,"Uzbekistan",100,16);
for(int i=0; i<5; i++)
{
a[i].print();
}
}
Do'stlaringiz bilan baham: |