├── Student_MiniProject_Manager ├── SMPM └── SMPM.CPP ├── Calculator ├── style.css └── index.html ├── Credit_Card_Validator └── CCValidator.cpp ├── README.md └── Bus_Ticket_Reservation_System └── BTRS.c /Student_MiniProject_Manager/SMPM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lohitkolluri/Mini-Projects/HEAD/Student_MiniProject_Manager/SMPM -------------------------------------------------------------------------------- /Calculator/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: rgb(214, 214, 214); 3 | } 4 | 5 | .container { 6 | width: 250px; 7 | height: 400px; 8 | margin: 80px auto; 9 | border-radius: 10px; 10 | background-color: rgb(214, 214, 214); 11 | 12 | box-shadow: 5px 5px 10px #b6a9a9, 13 | -5px -5px 10px #ffffff; 14 | } 15 | 16 | .cal-box { 17 | width: 200px; 18 | margin: 20px auto; 19 | } 20 | 21 | #display { 22 | border: none; 23 | outline: none; 24 | color: black; 25 | text-align: right; 26 | font-weight: 600; 27 | padding: 15px; 28 | margin: 30px 0 20px 0; 29 | background: transparent; 30 | 31 | box-shadow: inset 2px 2px 5px #babecc, 32 | inset -5px -5px 10px #ffffff; 33 | } 34 | 35 | .button { 36 | margin: 15px 0 0 5px; 37 | width: 42px; 38 | height: 42px; 39 | border: none; 40 | outline: none; 41 | font-size: 18px; 42 | font-weight: bold; 43 | cursor: pointer; 44 | border-radius: 8px; 45 | background-color: rgb(214, 214, 214); 46 | 47 | box-shadow: 5px 5px 10px #b6acac, 48 | -5px -5px 10px #faf4f4; 49 | display: inline-block; 50 | } 51 | 52 | .button:active { 53 | 54 | box-shadow: inset 1px 1px 2px #babecc, 55 | inset -1px -1px 2px #fff; 56 | } 57 | 58 | .clearButton { 59 | color: white; 60 | background-color: red; 61 | } 62 | 63 | .mathbutton { 64 | color: white; 65 | background-color: black; 66 | } 67 | 68 | -------------------------------------------------------------------------------- /Credit_Card_Validator/CCValidator.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | bool isNumberString(const string &s) 8 | { 9 | int len = s.length(); 10 | for (int i = 0; i < len; i++) 11 | { 12 | if (s[i] < '0' || s[i] > '9') 13 | return false; 14 | } 15 | return true; 16 | } 17 | 18 | int main() 19 | { 20 | string ccNumber; 21 | 22 | cout << "This program uses the Luhn Algorigthm to validate a CC number." << endl; 23 | cout << "You can enter 'exit' anytime to quit." << endl; 24 | 25 | while (true) 26 | { 27 | 28 | cout << "Please enter a CC number to validate: "; 29 | cin >> ccNumber; 30 | 31 | if (ccNumber == "exit") 32 | break; 33 | 34 | else if (!isNumberString(ccNumber)) 35 | { 36 | cout << "Bad input! "; 37 | continue; 38 | } 39 | 40 | int len = ccNumber.length(); 41 | int doubleEvenSum = 0; 42 | 43 | for (int i = len - 2; i >= 0; i = i - 2) 44 | { 45 | int dbl = ((ccNumber[i] - 48) * 2); 46 | if (dbl > 9) 47 | { 48 | dbl = (dbl / 10) + (dbl % 10); 49 | } 50 | doubleEvenSum += dbl; 51 | } 52 | 53 | for (int i = len - 1; i >= 0; i = i - 2) 54 | { 55 | doubleEvenSum += (ccNumber[i] - 48); 56 | } 57 | 58 | cout << (doubleEvenSum % 10 == 0 ? "Valid!" : "Invalid!") << endl; 59 | 60 | continue; 61 | } 62 | 63 | return 0; 64 | } 65 | -------------------------------------------------------------------------------- /Calculator/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | lohit's Calculator 9 | 10 | 11 | 12 | 13 |
14 |
15 |
16 | 17 |
18 | 20 | 22 | 24 | 26 |
27 | 29 | 31 | 33 | 35 |
36 | 38 | 40 | 42 | 44 |
45 | 47 | 49 | 52 | 53 | 54 | 56 |
57 |
58 |
59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Mini Projects Archive 2 | 3 | This repository serves as an archive for a collection of mini projects implemented in different programming languages, showcasing various concepts and skills. 4 | 5 | ## Projects: 6 | 7 | ### 1. Calculator 8 | 9 | - The Calculator project is a simple web-based application built using HTML, CSS, and JavaScript. It provides a user-friendly interface for performing basic arithmetic calculations, supporting addition, subtraction, multiplication, and division operations. 10 | 11 | ### 2. Bus Ticket Reservation System 12 | 13 | - The Bus Ticket Reservation System is implemented in C. It allows users to interact with a bus reservation system, enabling them to view a list of buses, book tickets, cancel bookings, and check the status of buses. The code utilizes file handling to store and retrieve passenger details and seat availability. 14 | 15 | ### 3. CCValidator Using Luhn's Algorithm 16 | 17 | - This program employs the Luhn algorithm to validate credit card numbers. Upon prompting the user to enter a credit card number, it checks whether it is valid or not based on the Luhn algorithm. If the entered number is valid, it prints "Valid!" to the console; otherwise, it prints "Invalid!". The program continues to prompt for input until the user enters "exit" to quit. 18 | 19 | ### 4. Student Mini Project Management System 20 | 21 | - The Student Mini Project Management System assists faculty in managing students' mini projects. Users can perform operations such as adding projects, viewing project details, and editing project marks. The program utilizes a class named "Project" to store information about each project, including roll number, name, and marks. It offers a menu-based interface for easy navigation and interaction with the system. 22 | 23 | ## Usage 24 | 25 | - Clone this repository: 26 | 27 | ```bash 28 | git clone [https://github.com/your-username/Mini_Projects_Archive.git](https://github.com/your-username/Mini_Projects_Archive.git) 29 | ``` 30 | 31 | - Explore each project in its respective directory to find implementation details. 32 | 33 | ## Contributing 34 | 35 | We encourage contributions! If you'd like to add your own mini-project or improve existing ones, or just add your name to the contributor list, please follow these steps: 36 | 37 | 1. **Fork the repository.** 38 | 2. **Clone your forked repository to your local machine.** 39 | 3. **Create a new branch for your contribution:** `git checkout -b feature/your-feature-name` or `git checkout -b fix/your-fix-name`. 40 | 4. **Make your changes.** 41 | 5. **Commit your changes with a descriptive message:** `git commit -m "Add/Update: [Your Contribution Description]"`. 42 | 6. **Push your changes to your forked repository:** `git push origin feature/your-feature-name`. 43 | 7. **Create a pull request (PR) to the `main` branch of this repository.** 44 | 45 | For adding your name to the contributor list, simply edit the `README.md` file and add your name to the list below, then follow the steps above. 46 | 47 | Once your PR is reviewed and approved, your contributions will be merged. 48 | 49 | **Contributors List:** 50 | 51 | - Lohit Kolluri 52 | - Garvesh Singh Rathore 53 | -------------------------------------------------------------------------------- /Student_MiniProject_Manager/SMPM.CPP: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | using namespace std; 9 | 10 | class Project { 11 | public: 12 | Project(const string& rollNumber, const string& name, int marks) 13 | : rollNumber_(rollNumber), name_(name), marks_(marks) {} 14 | string getRollNumber() const { return rollNumber_; } 15 | string getName() const { return name_; } 16 | int getMarks() const { return marks_; } 17 | void setMarks(int marks) { marks_ = marks; } 18 | 19 | private: 20 | string rollNumber_; 21 | string name_; 22 | int marks_; 23 | }; 24 | 25 | void displayMenu() { 26 | cout << "====================================" << endl; 27 | cout << setw(18) << "STUDENT PROJECT MANAGER" << endl; 28 | cout << "====================================" << endl; 29 | cout << "1. Add Project" << endl; 30 | cout << "2. View Projects" << endl; 31 | cout << "3. Edit Marks" << endl; 32 | cout << "4. Quit" << endl; 33 | cout << "Enter your choice: "; 34 | } 35 | 36 | void clearScreen() { 37 | #ifdef _WIN32 38 | 39 | #else 40 | system("clear"); 41 | #endif 42 | } 43 | 44 | void displayProjects(const vector& projects) { 45 | cout << "====================================" << endl; 46 | cout << setw(18) << "VIEW PROJECTS" << endl; 47 | cout << "====================================" << endl; 48 | cout << left << setw(15) << "Roll Number" << setw(20) << "Name" << setw(10) << "Marks" << endl; 49 | cout << "------------------------------------" << endl; 50 | for (const Project& project : projects) { 51 | cout << left << setw(15) << project.getRollNumber() << setw(20) << project.getName() << setw(10) 52 | << project.getMarks() << endl; 53 | } 54 | } 55 | 56 | int main() { 57 | vector projects; 58 | int choice; 59 | 60 | while (true) { 61 | clearScreen(); 62 | displayMenu(); 63 | cin >> choice; 64 | 65 | switch (choice) { 66 | case 1: { 67 | string rollNumber, name; 68 | int marks; 69 | cout << "Enter Roll Number: "; 70 | cin.ignore(); 71 | getline(cin, rollNumber); 72 | cout << "Enter Name: "; 73 | getline(cin, name); 74 | cout << "Enter Marks: "; 75 | cin >> marks; 76 | projects.emplace_back(rollNumber, name, marks); 77 | cout << "Project added successfully!" << endl; 78 | break; 79 | } 80 | case 2: { 81 | displayProjects(projects); 82 | break; 83 | } 84 | case 3: { 85 | string rollNumber; 86 | int newMarks; 87 | cout << "Enter Roll Number: "; 88 | cin.ignore(); 89 | getline(cin, rollNumber); 90 | bool found = false; 91 | for (Project& project : projects) { 92 | if (project.getRollNumber() == rollNumber) { 93 | found = true; 94 | cout << "Enter New Marks: "; 95 | cin >> newMarks; 96 | project.setMarks(newMarks); 97 | cout << "Marks updated successfully!" << endl; 98 | break; 99 | } 100 | } 101 | if (!found) { 102 | cout << "Project with Roll Number " << rollNumber << " not found." << endl; 103 | } 104 | break; 105 | } 106 | case 4: { 107 | cout << "Exiting..." << endl; 108 | return 0; 109 | } 110 | default: { 111 | cout << "Invalid choice, please enter a valid choice." << endl; 112 | break; 113 | } 114 | } 115 | 116 | cout << endl; 117 | cout << "Press Enter to continue..."; 118 | cin.ignore(numeric_limits::max(), '\n'); 119 | cin.get(); 120 | } 121 | 122 | return 0; 123 | } 124 | -------------------------------------------------------------------------------- /Bus_Ticket_Reservation_System/BTRS.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | char ch[10][130] = {"Bhubaneswar Express", "Jodhpur Liner", "Manali Express", "Northern Bus Lines", "Chennai Express"}; 6 | char name[32][100] = {'\0'}; 7 | char number[32][2] = {'\0'}; 8 | int num1[32] = {0}; 9 | int trno; 10 | 11 | void bus(); 12 | void name_number(int booking, char numstr[100]); 13 | void booking(); 14 | int read_number(int trno); 15 | void read_name(int trno); 16 | void status(); 17 | void status_1(int trno); 18 | void cancel(); 19 | 20 | int main() 21 | { 22 | int num, i; 23 | do 24 | { 25 | system("cls"); 26 | printf("\n\n \xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\n"); 27 | printf("\t PPS MINI PROJECT"); 28 | printf("\n \xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\n"); 29 | printf("\t BUS RESERVATION"); 30 | printf("\n \xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\n\n"); 31 | printf(" \xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd MAIN MENU \xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\n\n"); 32 | printf(" [1] View Bus List\n\n"); 33 | printf(" [2] Book Tickets\n\n"); 34 | printf(" [3] Cancel Booking\n\n"); 35 | printf(" [4] Bus Status Board\n\n"); 36 | printf(" [5] Exit\n\n"); 37 | printf(" \xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\n"); 38 | printf(" ENTER YOUR CHOICE: "); 39 | scanf("%d", &num); 40 | switch (num) 41 | { 42 | case 1: 43 | bus(); //for list of bus 44 | break; 45 | case 2: 46 | booking(); //for booking the tickets 47 | break; 48 | case 3: 49 | cancel(); //for cancelling the tickets 50 | break; 51 | case 4: 52 | status(); //to exit the app 53 | break; 54 | } 55 | getch(); 56 | } while (num != 5); 57 | system("CLS"); 58 | printf("\n\n \xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\n"); 59 | printf("\t\tTHANK YOU"); 60 | printf("\n \xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\n\n"); 61 | return 0; 62 | } 63 | 64 | void bus() 65 | { 66 | int i; 67 | printf("\n\n\n\n\n"); 68 | printf("\t \xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\n"); 69 | printf("\t BUS LIST"); 70 | printf("\n\t \xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\n\n"); 71 | printf("\t BUS NAME\t\t\t BUS NO.\n"); 72 | printf("\t ________\t\t\t ______\n\n"); 73 | for (i = 0; i <= 4; i++) 74 | { 75 | printf("\t %-30s %s\n", ch[i], number[i]); 76 | } 77 | printf("\n\t \xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\n"); 78 | } 79 | 80 | void name_number(int booking, char numstr[100]) 81 | { 82 | int i; 83 | FILE *fileptr; 84 | fileptr = fopen("bus.dat", "r"); 85 | for (i = 1; i <= booking; i++) 86 | { 87 | fscanf(fileptr, "%s\t\t%s\n", name[i], numstr); 88 | } 89 | fclose(fileptr); 90 | } 91 | 92 | void booking() 93 | { 94 | int booking, i, j; 95 | char numstr[100] = "\0"; 96 | FILE *fileptr1, *fileptr2; 97 | fileptr1 = fopen("bus.dat", "r"); 98 | fscanf(fileptr1, "%d", &trno); 99 | fclose(fileptr1); 100 | fileptr1 = fopen("bus.dat", "w"); 101 | printf("\n\n\t ENTER THE BUS NO.: "); 102 | scanf("%d", &booking); 103 | fprintf(fileptr1, "%d\n", booking); 104 | fclose(fileptr1); 105 | if (booking > 4 || booking < 0) 106 | { 107 | printf("\n\n\t INVALID BUS NUMBER\n\n"); 108 | getch(); 109 | return; 110 | } 111 | fileptr1 = fopen("bus.dat", "a"); 112 | printf("\n\n\t ENTER THE NUMBER OF TICKETS TO BE BOOKED: "); 113 | scanf("%d", &booking); 114 | if (booking < 1 || booking > 32) 115 | { 116 | printf("\n\n\t INVALID NUMBER OF TICKETS\n\n"); 117 | getch(); 118 | return; 119 | } 120 | fprintf(fileptr1, "%d\n", booking); 121 | fclose(fileptr1); 122 | name_number(booking, numstr); 123 | fileptr2 = fopen("bus.dat", "a"); 124 | for (i = 1; i <= booking; i++) 125 | { 126 | printf("\n\n\t ENTER THE NAME OF PASSENGER NO. %d: ", i); 127 | scanf("%s", name[i]); 128 | fprintf(fileptr2, "%s\t\t%s\n", name[i], numstr); 129 | for (j = 1; j <= trno; j++) 130 | { 131 | if (strcmp(numstr, number[j]) == 0) 132 | { 133 | num1[j] = num1[j] + 1; 134 | } 135 | } 136 | } 137 | fclose(fileptr2); 138 | } 139 | 140 | int read_number(int trno) 141 | { 142 | FILE *fileptr1; 143 | int i, number1; 144 | fileptr1 = fopen("bus.dat", "r"); 145 | fscanf(fileptr1, "%d", &number1); 146 | for (i = 1; i <= number1; i++) 147 | { 148 | fscanf(fileptr1, "%s", number[i]); 149 | } 150 | fclose(fileptr1); 151 | return number1; 152 | } 153 | 154 | void read_name(int trno) 155 | { 156 | FILE *fileptr2; 157 | int i, booking; 158 | char namestr[100] = "\0"; 159 | fileptr2 = fopen("bus.dat", "r"); 160 | fscanf(fileptr2, "%d", &booking); 161 | for (i = 1; i <= booking; i++) 162 | { 163 | fscanf(fileptr2, "%s", namestr); 164 | } 165 | fclose(fileptr2); 166 | } 167 | 168 | void status() 169 | { 170 | int i; 171 | printf("\n\n\n\n\n"); 172 | printf("\t \xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\n"); 173 | printf("\t BUS STATUS BOARD"); 174 | printf("\n\t \xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\n\n"); 175 | printf("\t BUS NO.\t BUS NAME\t\tBOOKING STATUS\n"); 176 | printf("\t ______\t ________\t\t______________\n\n"); 177 | read_number(trno); 178 | read_name(trno); 179 | for (i = 1; i <= trno; i++) 180 | { 181 | printf("\t %s\t %-30s %d/32\n", number[i], ch[i - 1], num1[i]); 182 | } 183 | printf("\n\t \xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\n"); 184 | } 185 | 186 | void cancel() 187 | { 188 | int i, booking, flag = 0; 189 | char namestr[100] = "\0", ch1; 190 | FILE *fileptr1, *fileptr2; 191 | printf("\n\n\t ENTER THE BUS NO. : "); 192 | scanf("%d", &booking); 193 | if (booking > trno || booking < 0) 194 | { 195 | printf("\n\n\t INVALID BUS NUMBER\n\n"); 196 | getch(); 197 | return; 198 | } 199 | fileptr1 = fopen("bus.dat", "r"); 200 | fscanf(fileptr1, "%s\t\t%s\n", namestr, number[1]); 201 | fclose(fileptr1); 202 | fileptr1 = fopen("bus.dat", "w"); 203 | fprintf(fileptr1, "%d\n", trno); 204 | fclose(fileptr1); 205 | fileptr2 = fopen("bus.dat", "a"); 206 | for (i = 1; i <= trno; i++) 207 | { 208 | if (i != booking) 209 | { 210 | fprintf(fileptr2, "%s\t\t%s\n", namestr, number[i]); 211 | } 212 | else if (i == booking) 213 | { 214 | printf("\n\n\t ENTER THE NAME OF PASSENGER TO BE CANCELLED: "); 215 | scanf("%s", namestr); 216 | if (strcmp(namestr, "X") == 0 || strcmp(namestr, "x") == 0) 217 | { 218 | fclose(fileptr2); 219 | return; 220 | } 221 | else if (strcmp(namestr, "ALL") == 0 || strcmp(namestr, "all") == 0) 222 | { 223 | printf("\n\n\t ARE YOU SURE TO CANCEL ALL PASSENGERS (Y/N): "); 224 | scanf("%s", &ch1); 225 | if (ch1 == 'y' || ch1 == 'Y') 226 | { 227 | flag = 1; 228 | } 229 | else 230 | { 231 | flag = 0; 232 | fprintf(fileptr2, "%s\t\t%s\n", namestr, number[i]); 233 | } 234 | } 235 | else 236 | { 237 | flag = 0; 238 | fprintf(fileptr2, "%s\t\t%s\n", namestr, number[i]); 239 | } 240 | } 241 | if (flag == 1) 242 | { 243 | num1[i] = 0; 244 | } 245 | if (flag == 0) 246 | { 247 | for (i = 1; i <= trno; i++) 248 | { 249 | if (strcmp(namestr, number[i]) == 0) 250 | { 251 | num1[i] = num1[i] - 1; 252 | flag = 1; 253 | break; 254 | } 255 | } 256 | } 257 | } 258 | fclose(fileptr2); 259 | } 260 | --------------------------------------------------------------------------------