fork download
  1. // Lab 8, Working with structs
  2. // Programmer : Maiar Khattab
  3. // Editor(s) used : Code Blocks 13.12
  4. // Compiler(s) used : Code Blocks 13.12
  5.  
  6. #include<iostream>
  7. using std::cout;
  8. using std::endl;
  9.  
  10. #include<cstdlib>
  11.  
  12. //struct def
  13. struct tod
  14. {
  15. int hour;// the hr , 0-23
  16. int minute;// the min, 0-59
  17. int second;//the sec, 0-59
  18. char descr [32];//the description of the time of day
  19.  
  20. };
  21. //void printTod(const tod&);
  22. int main ()
  23. {
  24. cout << "Lab 8, Working With structs\n";
  25. cout << "Programmer: Maiar Khattab\n";
  26. cout << "Editor(s) used: Code Blocks 13.12\n";
  27. cout << "Compiler(s) used: Code Blocks 13.12\n";
  28. cout << "File: " << __FILE__ << endl;
  29. cout << "Complied: " << __DATE__ << " at " << __TIME__ << endl << endl;
  30.  
  31. tod theTime[] = {{12,0,0, "noon"},
  32. {0,0,0," midnight"},
  33. {6,00,00," supper "},
  34. {11,30,0,"bedtime"}};
  35.  
  36. for(int i; i <5; i++)
  37. {
  38. char descr [32];
  39. cout << theTime[i].descr << " is " << theTime[i].hour << ':'
  40. << theTime[i].minute << ":" << theTime[i].second << endl;
  41. }
  42. }
  43.  
  44.  
Success #stdin #stdout 0.01s 5304KB
stdin
 
::-webkit-scrollbar{
  width: 0;
  height: 0;
}
body {
  background-color: #251f1f;
}
#coloured-part {
  width: 200px;
  height: 200px;
  border: none;
  background: linear-gradient(
    20deg,
    #ffdc80 25%,
    #fcaf45,
    #f77737,
    #f56040,
    #fd1d1d,
    #e1306c,
    #c13584,
    #833ab4,
    #5b51d8,
    #405de6
  );
  border-radius: 40px;
  position: relative;
  top: 12rem;
  left: 13rem;
  box-shadow: 0 0 70px #fd1d1d, 0 0 70px #405de6, 0 0 70px #833ab4;
}
#white-circle{
  width: 20px;
  height: 20px;
  border-radius: 50px;
  background-color: white;
  position: relative;
  top: 47px;
  left: 134px;

}
.white-part {
  width: 130px;
  height: 130px;
  border-radius: 40px;
  border: 10px solid white;
  position: relative;
  top: 6px;
  left: 25px;
}
#lense{
  width: 60px;
  height: 60px;
  border-radius: 50px;
  border: 10px solid white;
  position: relative;
  top: 24px;
  left: 25px;
}
.text{
  font-family: sans-serif;
  color: white;
  font-size: 70px;
  font-weight: bold;
  position: relative;
  top: 7vh;
  left: 27rem;
}
stdout
Lab 8, Working With structs
Programmer: Maiar Khattab
Editor(s) used: Code Blocks 13.12
Compiler(s) used: Code Blocks 13.12
File: prog.cpp
Complied: Apr 29 2024 at 18:43:03

noon is 12:0:0
 midnight is 0:0:0
 supper  is 6:0:0
bedtime is 11:30:0
�
g +�� is 1242118248:32764:-1844159232