Advertisement
DarkShard22

GanttChart

Jul 17th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.48 KB | None | 0 0
  1. cout<< "\t\t\t\tGantt Chart" << endl;
  2.     cout << "      ";
  3.     // print Gantt chart (6 spaces)
  4.      for(int a = 0 ; a < 68; a++)
  5.     {
  6.         cout << "-";
  7.     }
  8.    
  9.     cout << endl;
  10.  
  11.    
  12.     cout << "      ";
  13.     for(int b = 0; b < 204; b++)
  14.     {
  15.         switch (b)
  16.         {
  17.             case 0:
  18.             case 7:
  19.             case 14:
  20.             case 21: // first line of barlines
  21.             case 28:
  22.                
  23.             case 34:
  24.            
  25.             case 41:
  26.             case 48:
  27.             case 55:
  28.             case 62:
  29.                  // 89 90 91 92 93 94 95 96 // 96 97 98 99 100 101 102 103
  30.                 //79 //  86 //  93 //
  31.         /*  case 74: // middle
  32.             case 80:
  33.             case 86:
  34.             case 92:
  35.            
  36.             case 95:
  37.             case 99:
  38.             case 109:
  39.             case 115:
  40.                
  41.             case 121: */
  42.            
  43.             case 125:
  44.            
  45.             case 133:
  46.             case 140:
  47.             case 147:
  48.             case 154:
  49.            
  50.             case 160:
  51.             case 167:
  52.             case 174:
  53.             case 181:
  54.             case 188:  
  55.             case 193:
  56.            
  57.            
  58.             case 67:
  59.                
  60.            
  61.                 //135 middle barline right
  62.                 cout << "|";
  63.                 if(b == 67 || b == 125)
  64.                 {
  65.                     cout << endl;
  66.                 }
  67.                 break;
  68.                        
  69.             case 68:
  70.             case 126:
  71.                 //68 middle barline left
  72.                 if(b == 126)
  73.                 {
  74.                     cout << "      |";
  75.                     break;
  76.                 }
  77.                 cout << "      |";
  78.                
  79.                 break;
  80.            
  81.             case 71: //1
  82.             case 77:// 2
  83.             case 83://3
  84.             case 89: //4
  85.             case 94: //5
  86.             case 100: //6
  87.             case 106: // 7
  88.             case 112:
  89.             case 118:
  90.             case 123:
  91.                
  92.                
  93.                 if(counter <= row)
  94.                 {
  95.                     cout << "P"  << counter;
  96.                     counter++;
  97.                 }
  98.                 else{
  99.                     cout << "x ";
  100.                 }
  101.                 break;
  102.        
  103.             default:
  104.                 cout << " ";
  105.                 break;
  106.         }
  107.     }
  108.     cout << endl;
  109.     cout << "      ";
  110.     for(int a = 0 ; a < 68; a++)
  111.     {
  112.         cout << "-";
  113.     }
  114.    
  115.     cout << endl;
  116.     cout << "      ";
  117.     for(int label = 0 ; label < 68; label++)
  118.     {
  119.         switch(label)
  120.         {
  121.             case 0:
  122.             case 7:
  123.             case 14:
  124.             case 21:
  125.             case 28:
  126.             case 35:
  127.             case 42:
  128.             case 49:
  129.             case 56:
  130.             case 63:
  131.             case 70:
  132.                 if(arraycounter <= row)
  133.                 {
  134.                     if(arraycounter == row)
  135.                     {
  136.                         cout << final_time;
  137.                         arraycounter++;
  138.                         break;
  139.                     }
  140.                     cout << array[arraycounter][6];
  141.                     arraycounter++;
  142.                 }
  143.                 else{
  144.                     cout << "-";
  145.                 }
  146.                 break;
  147.                
  148.             default:
  149.                 cout << " ";
  150.                 break;
  151.         }
  152.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement