Advertisement
yllikelani

Untitled

May 21st, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.23 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <string>
  4.  
  5. using namespace std;
  6. class Kasetofoni
  7. {
  8. public: bool Statusi; int Sasia_e_Kengve, Perqindja_e_bateris; string Kenga_aktuale;
  9.  
  10.         void NdezKasetofonin()
  11.         {
  12.             if (Statusi == true)
  13.             {
  14.                 cout << "Kasetofoni eshte i ndezur " << endl;
  15.             }
  16.             else
  17.             {
  18.                 cout << "Kasetofoni nuk eshte i ndezur" << endl;
  19.             }
  20.         };
  21.  
  22.         void ShtoKenge()
  23.         {
  24.  
  25.  
  26.             int i;
  27.             cout << "Sa kenge deshironi te shtoni : ";
  28.             cin >> i;
  29.             if (i >= 100)
  30.             {
  31.                 cout << "Keni shtuar shum kenge " << endl;
  32.  
  33.             }
  34.             else
  35.             {
  36.                 Sasia_e_Kengve = Sasia_e_Kengve + i;
  37.             }
  38.         };
  39.  
  40.         void LargoKenge()
  41.         {
  42.  
  43.             int i;
  44.             cout << "Sa kenge deshironi te largoni : ";
  45.             cin >> i;
  46.             if (i <= Sasia_e_Kengve)
  47.             {
  48.  
  49.                 Sasia_e_Kengve = Sasia_e_Kengve - i;
  50.             }
  51.             else {
  52.                 cout << "Nuk mund te largoni ket shum te kengve " << endl;
  53.             }
  54.         };
  55.  
  56.         void Kengaaktuale()
  57.         {
  58.             if (0<=Sasia_e_Kengve) {
  59.                 cout << "Ju keni fshir te gjitha kenget." << endl;
  60.            
  61.             }
  62.             else {
  63.                 cout << "Kenga aktuale eshte : " << Kenga_aktuale;
  64.             }
  65.  
  66.         };
  67. };
  68.  
  69. int _tmain(int argc, _TCHAR* argv[])
  70. {
  71.     Kasetofoni kaset;
  72.     kaset.Sasia_e_Kengve = 10;
  73.     kaset.Perqindja_e_bateris = 45;
  74.     kaset.Kenga_aktuale = "Baresha";
  75.     kaset.Statusi = true;
  76.     if (kaset.Statusi == true) {
  77.         kaset.NdezKasetofonin();
  78.         cout << "Sasia e bateri eshte : " << kaset.Perqindja_e_bateris << " %" << endl;
  79.     }
  80.    
  81.     if (kaset.Statusi == true)
  82.     {
  83.  
  84.  
  85.         int pytsori;
  86.         cout << "Shtyp 1 qe te shtoni kenge " << endl;
  87.         cout << "Shtyp 2 qe te largoni kenge " << endl;
  88.         cout << "Shtyp 3 qe te shikoni sasin e kengeve ne playlist  " << endl;
  89.  
  90.         cout << "Shtypni:  ";
  91.         cin >> pytsori;
  92.  
  93.         if (pytsori == 1)
  94.         {
  95.             kaset.ShtoKenge();
  96.         }
  97.  
  98.         else if (pytsori == 2)
  99.         {
  100.             kaset.LargoKenge();
  101.         }
  102.  
  103.         else if  (pytsori == 3)
  104.         {
  105.             cout << "Ne play listen ton kemi : " << kaset.Sasia_e_Kengve << endl;
  106.         }
  107.  
  108.     }
  109.  
  110.         else
  111.         {
  112.             cout << "Kasetofoni nuk eshte i ndezur " << endl;
  113.         }
  114.  
  115.     if (kaset.Statusi == true)
  116.     {
  117.        
  118.         cout << "Ju keni ne play list : " << kaset.Sasia_e_Kengve << " kenge" << endl;
  119.         cout << "Kenga e momentetit eshte : " << kaset.Kenga_aktuale << endl;
  120.     }
  121.    
  122.  
  123.     system("pause");
  124.     return 0;
  125. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement