Mavzu : C++ dasturlash tilida obyektga yo’naltirilgan dasturlashdan foydalansh. Masala


Download 42.4 Kb.
Sana21.04.2023
Hajmi42.4 Kb.
#1367841
Bog'liq
Laboratoriya (2)


Mavzu : C++ dasturlash tilida obyektga yo’naltirilgan dasturlashdan foydalansh .


Masala : Qoshiqchilar guruhi berilgan uning maydonlariga qiymat o’zlashtirilsin.
Dastur kodi quyidagicha :

#include


#include
using namespace std;

class musician


{

public :
string group_name;
string album_name;
int cassette;
int number_of_songs;
string date;
string name_of_studio;
public :
void input();
void output();
};

void musician::input()
{
cout<<"Gruh nomi : "; cin>>group_name;
cout<<"Albom nomi " ; cin>>album_name;
cout<<"Kassette " ; cin>>cassette;
cout<<"Qoshiqlar soni :" ; cin>>number_of_songs;
cout<<"Ishlab chiqilgan sana : " ; cin>>date ;
cout<<" studia nomi : " ; cin>>name_of_studio;
}

void musician::output()


{
cout<<"-------------------------------"<cout<cout<cout<cout<cout<cout< }
int main(int argc, char** argv) {

musician m;
m.input();
m.output();

return 0;


}



Download 42.4 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling