Note - Double Click to Copy Code Contact Us!

Apartment Management System using C++

Tech Doubility
Apartment Management System using C++


 
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4. string i, name, dob, ph, address, gender, complaint=(""), suggestion=("");
  5. int flag=0;
  6.  
  7. //function to display personal details of the user
  8. void personal_details(){
  9. cout<<"Your Personal Details are :"<<endl<<"Name - "<<name<<endl<<"Date of Birth - "<<dob<<endl<<"Gender - "<<gender<<endl<<"Phone Number - "<<ph<<endl<<"Address - "<<address<<endl;
  10. }
  11.  
  12. //function to register a complaint given by the user
  13. void register_complaint(){
  14. cout<<"Enter Your Complaint - ";
  15. cin.ignore();
  16. getline(cin,complaint);
  17. cout<<"Complaint Registered Successfully."<<endl;
  18. }
  19.  
  20. //function to display complaint registered by the user
  21. void view_complaint(){
  22. if(complaint==""){
  23. cout<<"Currently You Have No Registered Complaint"<<endl;
  24. }
  25. else cout<<"Your Registered Complaint - "<<complaint<<endl;
  26. }
  27.  
  28. //function to book a parking slot for the user
  29. void book_parkingSlot(){
  30. if(flag==0){
  31. cout<<"Parking Slot Booked Successfully."<<endl;
  32. flag=1;
  33. }
  34. else cout<<"Parking Slot Already Booked, No More Parking Slots Available."<<endl;
  35. }
  36.  
  37. //function to display all the notices available
  38. void notices_section(){
  39. cout<<"This is Notices Section."<<endl<<"All notices will be displayed here."<<endl;
  40. }
  41.  
  42. //function to register a suggestion for the user
  43. void register_suggestion(){
  44. cout<<"Enter Your Suggestion - ";
  45. cin.ignore();
  46. getline(cin,suggestion);
  47. cout<<"Suggestion Recieved Successfully."<<endl;
  48. }
  49.  
  50. //function to display suggestion resigtered by the user
  51. void view_suggestion(){
  52. if(suggestion==""){
  53. cout<<"Currently You Have No Suggestion"<<endl;
  54. }
  55. else cout<<"Your Personal Suggestion - "<<suggestion<<endl;
  56. }
  57.  
  58. //main function for driver code
  59. int main() {
  60. //Welcome message to the user
  61. cout<<"Welcome to Apartment Management System"<<endl<<"In this system you can do various tasks like Register a Complaint, Book a Parking Slot, View Notices Section, Convey Your Personal Suggestions to the Concerned Authorities."<<endl;
  62.  
  63. //Taking personal details from the user
  64. cout<<"---------------------------------------------------------"<<endl;
  65. cout<<"Enter Your Name - ";
  66. getline(cin,name);
  67. cout<<"Enter Your Date of Birth - ";
  68. getline(cin,dob);
  69. cout<<"Enter Your Gender - ";
  70. getline(cin,gender);
  71. cout<<"Enter Your Phone Number - ";
  72. getline(cin,ph);
  73. cout<<"Enter Your Address - ";
  74. getline(cin,address);
  75. cout<<"---------------------------------------------------------"<<endl;
  76.  
  77.  
  78. do{
  79. //Providing various options to user to navigate through the program
  80. cout<<"To view your Personal Details enter 1 and press enter"<<endl<<"Or to Register a Complaint enter 2 and press enter"<<endl<<"Or to View the Registered Complaint enter 3 and press enter"<<endl<<"Or to Book a Parking Slot enter 4 and press enter"<<endl<<"Or to View Notices Section enter 5 and press enter"<<endl<<"Or to Convey Your Personal Suggestion enter 6 and press enter"<<endl<<"Or to View Your Personal Suggestion enter 7 and press enter"<<endl<<"Or to End the program enter 0 and press enter : ";
  81.  
  82. cin>>i;
  83. cout<<"---------------------------------------------------------"<<endl;
  84.  
  85. //if user wants to end the program
  86. if(i=="0"){
  87. break;
  88. }
  89.  
  90. else if(i=="1"){
  91. personal_details();
  92. }
  93.  
  94. else if(i=="2"){
  95. register_complaint();
  96. }
  97.  
  98. else if(i=="3"){
  99. view_complaint();
  100. }
  101.  
  102. else if(i=="4"){
  103. book_parkingSlot();
  104. }
  105.  
  106. else if(i=="5"){
  107. notices_section();
  108. }
  109.  
  110. else if(i=="6"){
  111. register_suggestion();
  112. }
  113.  
  114. else if(i=="7"){
  115. view_suggestion();
  116. }
  117.  
  118. else cout<<"Invalid Choice!!"<<endl;
  119.  
  120.  
  121. cout<<"---------------------------------------------------------"<<endl;
  122.  
  123. }while(i!="0");
  124.  
  125. //end line for the program
  126. cout<<endl<<"Thankyou and have a Good Day!!"<<endl<<endl;
  127. cout<<"---------------------------------------------------------"<<endl;
  128.  
  129. return 0;
  130. }

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.