├── README.md ├── library_Mangement_system.cpp ├── Student_Mangement_system.cpp └── bank_Mangement_system.cpp /README.md: -------------------------------------------------------------------------------- 1 | # System_Mangament 2 | C++ language in which System_Mangament project 3 | 4 | # Banking System 5 | This project is a simple banking system application implemented in C++. It allows users to create accounts, view account details, deposit and withdraw money, transfer funds between accounts, view all accounts, calculate interest for savings accounts, and close accounts. The application supports up to 100 accounts, each with details such as account name, account number, balance, account type, and interest rate. 6 | 7 | # Library Management System 8 | This project is a library management system implemented in C++. It enables users to manage books in a library, including adding new books, searching for books by title or author, displaying all books, and borrowing books. The application maintains information about book titles, authors, IDs, and availability status, supporting up to 100 books. 9 | 10 | # Student Management System 11 | This project is a student management system implemented in C++. It allows users to manage student information, including adding new students, deleting student records, updating student details, searching for students by roll number, and displaying all students. The system supports up to 50 students, each with details such as roll number, name, father's name, course, and system ID. 12 | -------------------------------------------------------------------------------- /library_Mangement_system.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | using namespace std; 4 | 5 | const int book = 100; 6 | // declare the string array 7 | string titles[book]; 8 | string authors[book]; 9 | int ids[book]; 10 | bool available[book]; 11 | int bookcount = 0; 12 | 13 | void addBook() 14 | { 15 | 16 | if (bookcount >= book) 17 | { 18 | cout << "library is full. cannot add more books." << endl; 19 | return; 20 | } 21 | // take user input information 22 | 23 | cout << "Enter book title: "; 24 | cin >> titles[bookcount]; 25 | 26 | cout << "Enter book author: "; 27 | cin >> authors[bookcount]; 28 | 29 | cout << "Enter book ID: "; 30 | cin >> ids[bookcount]; 31 | 32 | available[bookcount] = true; 33 | bookcount++; 34 | cout << "book added successfully" << endl; 35 | } 36 | void searchBooks() 37 | { 38 | // choose the choice 39 | int choice; 40 | cout << "search by 1 title or 2 author? "; 41 | cin >> choice; 42 | 43 | // first choice check by title 44 | if (choice == 1) 45 | { 46 | string title; 47 | cout << "Enter title: "; 48 | cin >> title; 49 | 50 | for (int i = 0; i < bookcount; i++) 51 | { 52 | if (titles[i] == title) 53 | { 54 | cout << "Book found: " << titles[i] << " by " << authors[i] << ", ID: " << ids[i]; 55 | if (available[i]==true) 56 | { 57 | cout << ", available" << endl; 58 | } 59 | else{ 60 | cout << ", not available" << endl; 61 | } 62 | 63 | return; 64 | } 65 | } 66 | cout << "Book not found." << endl; 67 | } 68 | // second choice check by author 69 | else if (choice == 2) 70 | { 71 | string author; 72 | cout << "Enter author: "; 73 | cin >> author; 74 | 75 | for (int i = 0; i < bookcount; i++) 76 | { 77 | if (authors[i] == author) 78 | { 79 | cout << "Book found: " << titles[i] << " by " << authors[i] << ", ID: " << ids[i] << endl; 80 | if (available[i]==true) 81 | { 82 | cout << ", available" << endl; 83 | } 84 | else{ 85 | cout << ", not available"<> bookId; 116 | 117 | // loop can display the the borrow book 118 | for (int i = 0; i < bookcount; i++) 119 | { 120 | if (ids[i] == bookId) 121 | { 122 | if (available[i]) 123 | { 124 | available[i] = false; 125 | cout << "You have borrowed: " << titles[i] << " by " << authors[i] << endl; 126 | } 127 | else 128 | { 129 | cout << "sorry, the book is currently not available." << endl; 130 | } 131 | return; 132 | } 133 | } 134 | cout << "book not found." << endl; 135 | } 136 | 137 | int main() 138 | { 139 | 140 | while (true) 141 | { 142 | cout<<"----------------------------"; 143 | cout << "\nlibrary management system\n"; 144 | cout<<"-----------------------------"<> choice; 154 | 155 | switch (choice) 156 | { 157 | case 1: 158 | addBook(); 159 | break; 160 | case 2: 161 | searchBooks(); 162 | break; 163 | case 3: 164 | displayAllBooks(); 165 | break; 166 | case 4: 167 | borrowBook(); 168 | break; 169 | case 5: 170 | cout << "exiting the program." << endl; 171 | return 0; 172 | default: 173 | cout << "invalid choice. please try again." << endl; 174 | } 175 | } 176 | 177 | return 0; 178 | } 179 | -------------------------------------------------------------------------------- /Student_Mangement_system.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | using namespace std; 4 | 5 | // define a structure to hold student information 6 | struct student 7 | { 8 | string rollno; 9 | string name; 10 | string fname; 11 | string course; 12 | string ID; 13 | }; 14 | 15 | // array to store students 16 | student s[50]; 17 | int ts = 0; // total number of students 18 | 19 | // function to add a student 20 | void add_student() 21 | { 22 | system("clear"); 23 | if (ts < 50) 24 | { 25 | cout << "Enter Roll No: "; 26 | cin >> s[ts].rollno; 27 | cout << "Enter Name: "; 28 | cin >> s[ts].name; 29 | cout << "Enter Father's Name: "; 30 | cin >> s[ts].fname; 31 | cout << "Enter the Course name: "; 32 | cin >> s[ts].course; 33 | cout << "Enter the System_ID: "; 34 | cin >> s[ts].ID; 35 | ts++; 36 | cout << "Student added successfully." << endl; 37 | } 38 | else 39 | { 40 | cout << "maximum limit reached." << endl; 41 | } 42 | } 43 | 44 | // function to delete a student by roll number 45 | void delete_student(string delete_rollno) 46 | { 47 | system("clear"); 48 | int index = -1; 49 | // find the student by roll number 50 | for (int i = 0; i < ts; i++) 51 | { 52 | if (s[i].rollno == delete_rollno) 53 | { 54 | index = i; 55 | break; 56 | } 57 | } 58 | 59 | // If student found, delete by shifting elements 60 | if (index != -1) 61 | { 62 | for (int i = index; i < ts - 1; i++) 63 | { 64 | s[i] = s[i + 1]; 65 | } 66 | ts--; 67 | cout << "Student with roll number : " << delete_rollno << " deleted successfully." << endl; 68 | } 69 | else 70 | { 71 | cout << "Student with roll number : " << delete_rollno << " not found." << endl; 72 | } 73 | } 74 | 75 | // function to update student information by roll number 76 | void update_student(string update_rollno) 77 | { 78 | system("clear"); 79 | for (int i = 0; i < ts; i++) 80 | { 81 | if (s[i].rollno == update_rollno) 82 | { 83 | cout << "Enter New Name: "; 84 | cin >> s[i].name; 85 | cout << "Enter New Father's Name: "; 86 | cin >> s[i].fname; 87 | cout << "Enter New course name: "; 88 | cin >> s[i].course; 89 | cout << "Enter New System_ID: "; 90 | cin >> s[i].ID; 91 | return; 92 | } 93 | } 94 | cout << "Student not found." << endl; 95 | } 96 | 97 | // function to search for a student by roll number 98 | void search_student(string search_rollno) 99 | { 100 | system("clear"); 101 | for (int i = 0; i < ts; i++) 102 | { 103 | if (s[i].rollno == search_rollno) 104 | { 105 | cout << "Student found:" << endl; 106 | cout << "Roll No: " << s[i].rollno << endl; 107 | cout << "Name: " << s[i].name << endl; 108 | cout << "Father's Name: " << s[i].fname << endl; 109 | cout << "Course: " << s[i].course << endl; 110 | cout << "System_ID: " << s[i].ID << endl; 111 | return; 112 | } 113 | } 114 | cout << "Student not found." << endl; 115 | } 116 | 117 | // function to display all students 118 | void display_all_student() 119 | { 120 | system("clear"); 121 | if (ts == 0) 122 | { 123 | cout << "No students to display." << endl; 124 | } 125 | else 126 | { 127 | for (int i = 0; i < ts; i++) 128 | { 129 | cout << "\nStudent " << i + 1 << ":" << endl; 130 | cout << "Roll No: " << s[i].rollno << endl; 131 | cout << "Name: " << s[i].name << endl; 132 | cout << "Father's Name: " << s[i].fname << endl; 133 | cout << "Course: " << s[i].course << endl; 134 | cout << "System_ID: " << s[i].ID << endl; 135 | } 136 | } 137 | } 138 | 139 | int main() 140 | { 141 | char choice; 142 | string roll_number; 143 | 144 | // main program menu 145 | cout << "\t------------------------" << endl; 146 | cout << "\tStudent Management System" << endl; 147 | cout << "\t------------------------" << endl; 148 | cout << "\tYou are date limit is 50 Student"; 149 | 150 | while (true) 151 | { 152 | cout << "\n\tWhat do you want to do?" << endl; 153 | cout << "\t----------------------" << endl; 154 | cout << "\t1-Add student" << endl; 155 | cout << "\t2-Delete student" << endl; 156 | cout << "\t3-Update student" << endl; 157 | cout << "\t4-Search student" << endl; 158 | cout << "\t5-Display all students" << endl; 159 | cout << "\t6-Quit Program" << endl; 160 | cout << "\t----------------------" << endl; 161 | 162 | cout << "Enter your choice: "; 163 | cin >> choice; 164 | 165 | switch (choice) 166 | { 167 | case '1': 168 | add_student(); 169 | break; 170 | case '2': 171 | cout << "\t1-Delete Specific student data" << endl; 172 | cout << "\t2-Delete all student data" << endl; 173 | cout << "Enter your choice: "; 174 | cin >> choice; 175 | if (choice == '1') 176 | { 177 | if (ts == 0) 178 | { 179 | cout << "Please add students first." << endl; 180 | } 181 | else 182 | { 183 | cout << "Enter student roll number to delete: "; 184 | cin >> roll_number; 185 | delete_student(roll_number); 186 | } 187 | } 188 | else if (choice == '2') 189 | { 190 | ts = 0; 191 | cout << "All students data deleted successfully." << endl; 192 | } 193 | else 194 | { 195 | cout << "Invalid choice. Please try again." << endl; 196 | } 197 | break; 198 | case '3': 199 | if (ts == 0) 200 | { 201 | cout << "Please add students first." << endl; 202 | } 203 | else 204 | { 205 | cout << "Enter student roll number to update: "; 206 | cin >> roll_number; 207 | update_student(roll_number); 208 | } 209 | break; 210 | case '4': 211 | if (ts == 0) 212 | { 213 | cout << "Please add students first." << endl; 214 | } 215 | else 216 | { 217 | cout << "Enter student roll number to search: "; 218 | cin >> roll_number; 219 | search_student(roll_number); 220 | } 221 | break; 222 | case '5': 223 | display_all_student(); 224 | break; 225 | case '6': 226 | exit(0); 227 | default: 228 | cout << "Invalid choice. Please try again." << endl; 229 | } 230 | } 231 | } 232 | -------------------------------------------------------------------------------- /bank_Mangement_system.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include // using set precision function 4 | using namespace std; 5 | 6 | // define structure for bank account 7 | struct Bank 8 | { 9 | string accountName; 10 | int accountNumber; 11 | float balance; 12 | string accountType; 13 | float interestRate; 14 | }; 15 | 16 | // function to display account information 17 | const int maximum = 100; // only 100 account constant 18 | Bank accounts[maximum]; // define array 19 | int accountCount = 0; 20 | int number = 1001; 21 | 22 | // define the function to create account 23 | void createAccount() 24 | { 25 | if (accountCount >= maximum) 26 | { 27 | cout << "maximum number of accounts reached" << endl; 28 | return; 29 | } 30 | // sign name 31 | cout << "Enter account name: "; 32 | cin >> accounts[accountCount].accountName; 33 | // sign account number 34 | accounts[accountCount].accountNumber = number; 35 | number++; 36 | // sign account type 37 | cout << "Enter account type (savings/checking): "; 38 | cin >> accounts[accountCount].accountType; 39 | if (accounts[accountCount].accountType == "savings") 40 | { 41 | accounts[accountCount].interestRate = 0.03; 42 | } 43 | else 44 | { 45 | accounts[accountCount].interestRate = 0.0; 46 | } 47 | // sign initial balance 48 | accounts[accountCount].balance = 0.0; 49 | 50 | cout << "Account created successfully! Account Number: " << accounts[accountCount].accountNumber << endl; 51 | 52 | accountCount++; 53 | } 54 | // define the function to display specifically account 55 | void viewAccountDetails(int accountNumber) 56 | { 57 | for (int i = 0; i < accountCount; ++i) 58 | { 59 | // check the account and display this account 60 | if (accounts[i].accountNumber == accountNumber) 61 | { 62 | cout << "AccountName: " << accounts[i].accountName << endl; 63 | cout << "Account Number: " << accounts[i].accountNumber << endl; 64 | cout << "Account Type: " << accounts[i].accountType << endl; 65 | cout << "Balance: " << fixed << setprecision(2) << accounts[i].balance << endl; 66 | cout << "Interest Rate: " << accounts[i].interestRate * 100 << "%" << endl; 67 | return; 68 | } 69 | } 70 | cout << "Account not found!" << endl; 71 | } 72 | // define the function to deposit amount 73 | void deposit(int accountNumber, float amount) 74 | { 75 | for (int i = 0; i < accountCount; ++i) 76 | { 77 | // check the account and deposit 78 | if (accounts[i].accountNumber == accountNumber) 79 | { 80 | accounts[i].balance += amount; 81 | cout << "deposit successful new balance: " << fixed << setprecision(2) << accounts[i].balance << endl; 82 | } 83 | } 84 | cout << "Account not found!" << endl; 85 | } 86 | // define the function to withdraw the amount 87 | void withdraw(int accountNumber, float amount) 88 | { 89 | for (int i = 0; i < accountCount; ++i) 90 | { 91 | // check the account 92 | if (accounts[i].accountNumber == accountNumber) 93 | { 94 | // check the amount 95 | if (accounts[i].balance >= amount) 96 | { 97 | accounts[i].balance -= amount; 98 | cout << "withdrawal successful and new balance: " << fixed << setprecision(2) << accounts[i].balance << endl; 99 | } 100 | else 101 | { 102 | cout << "insufficient balance!" << endl; 103 | } 104 | return; 105 | } 106 | } 107 | cout << "Account not found!" << endl; 108 | } 109 | // define the function to withdraw the transfer 110 | void transfer(int fromAccountNumber, int toAccountNumber, float amount) 111 | { 112 | int fromIndex = -1, toIndex = -1; 113 | for (int i = 0; i < accountCount; ++i) 114 | { 115 | // check the both account 116 | if (accounts[i].accountNumber == fromAccountNumber) 117 | fromIndex = i; 118 | if (accounts[i].accountNumber == toAccountNumber) 119 | toIndex = i; 120 | } 121 | // when index is change then if run 122 | if ((fromIndex != -1) && (toIndex != -1)) 123 | { 124 | // check the amount 125 | if (accounts[fromIndex].balance >= amount) 126 | { 127 | accounts[fromIndex].balance -= amount; 128 | accounts[toIndex].balance += amount; 129 | cout << "Transfer successful!" << endl; 130 | } 131 | else 132 | { 133 | cout << "Insufficient balance in source account!" << endl; 134 | } 135 | } 136 | else 137 | { 138 | cout << "accounts not found!" << endl; 139 | } 140 | } 141 | // define the function to view to all account 142 | void viewAllAccounts() 143 | { 144 | if (accountCount == 0) 145 | { 146 | cout << "No accounts found!" << endl; 147 | return; 148 | } 149 | // loop for display the all account 150 | for (int i = 0; i < accountCount; ++i) 151 | { 152 | cout << "Account Name: " << accounts[i].accountName << endl; 153 | cout << "Account Number: " << accounts[i].accountNumber << endl; 154 | cout << "Account Type: " << accounts[i].accountType << endl; 155 | cout << "Balance: " << fixed << setprecision(2) << accounts[i].balance << endl; 156 | cout << "Interest Rate: " << accounts[i].interestRate * 100 << "%" << endl; 157 | cout << "---------------------------------------" << endl; 158 | } 159 | } 160 | // define the function to calculate interest 161 | void calculateInterest() 162 | { 163 | for (int i = 0; i < accountCount; ++i) 164 | { 165 | // check the account and when savings account then run if 166 | if (accounts[i].accountType == "savings") 167 | { 168 | accounts[i].balance += accounts[i].balance * accounts[i].interestRate; 169 | } 170 | } 171 | cout << "Calculates and adds interest to Savings accounts." << endl; 172 | } 173 | // define the function to close the account 174 | void closeAccount(int accountNumber) 175 | { 176 | int index = -1; 177 | // check the account 178 | for (int i = 0; i < accountCount; ++i) 179 | { 180 | if (accounts[i].accountNumber == accountNumber) 181 | { 182 | index = i; 183 | } 184 | } 185 | // when index is change then run if 186 | if (index != -1) 187 | { 188 | for (int i = index; i < accountCount - 1; ++i) 189 | { 190 | accounts[i] = accounts[i + 1]; 191 | } 192 | accountCount--; 193 | cout << "Account closed successfully!" << endl; 194 | return; 195 | } 196 | else 197 | { 198 | cout << "Account not found!" << endl; 199 | } 200 | } 201 | 202 | int main() 203 | { 204 | char choice; 205 | while (true) 206 | { 207 | cout << "-------------------"; 208 | cout << "\nBanking System Menu\n"; 209 | cout << "-------------------" << endl; 210 | 211 | cout << "1. Create a new account\n"; 212 | cout << "2. View account details\n"; 213 | cout << "3. Deposit money\n"; 214 | cout << "4. Withdraw money\n"; 215 | cout << "5. Transfer money between accounts\n"; 216 | cout << "6. View all accounts\n"; 217 | cout << "7. Calculate interest for Savings accounts\n"; 218 | cout << "8. Close an account\n"; 219 | cout << "9. Exit\n"; 220 | cout << "Enter your choice: "; 221 | cin >> choice; 222 | 223 | int accountNumber, toAccountNumber; 224 | float amount; 225 | 226 | switch (choice) 227 | { 228 | case '1': 229 | createAccount(); 230 | break; 231 | case '2': 232 | cout << "Enter account number: "; 233 | cin >> accountNumber; 234 | viewAccountDetails(accountNumber); 235 | break; 236 | case '3': 237 | cout << "Enter account number: "; 238 | cin >> accountNumber; 239 | cout << "Enter amount to deposit: "; 240 | cin >> amount; 241 | deposit(accountNumber, amount); 242 | break; 243 | case '4': 244 | cout << "Enter account number: "; 245 | cin >> accountNumber; 246 | cout << "Enter amount to withdraw: "; 247 | cin >> amount; 248 | withdraw(accountNumber, amount); 249 | break; 250 | case '5': 251 | cout << "Enter from account number: "; 252 | cin >> accountNumber; 253 | cout << "Enter to account number: "; 254 | cin >> toAccountNumber; 255 | cout << "Enter amount to transfer: "; 256 | cin >> amount; 257 | transfer(accountNumber, toAccountNumber, amount); 258 | break; 259 | case '6': 260 | viewAllAccounts(); 261 | break; 262 | case '7': 263 | calculateInterest(); 264 | break; 265 | case '8': 266 | cout << "Enter account number: "; 267 | cin >> accountNumber; 268 | closeAccount(accountNumber); 269 | break; 270 | case '9': 271 | cout << "Exiting program." << endl; 272 | return 0; 273 | default: 274 | cout << "Invalid choice! Please try again." << endl; 275 | } 276 | } 277 | } 278 | --------------------------------------------------------------------------------