diff --git a/Lab_01/01_hello_world.cpp b/01VariablesAndOperators/01_hello_world.cpp similarity index 100% rename from Lab_01/01_hello_world.cpp rename to 01VariablesAndOperators/01_hello_world.cpp diff --git a/Lab_01/02_take_user_input.cpp b/01VariablesAndOperators/02_take_user_input.cpp similarity index 100% rename from Lab_01/02_take_user_input.cpp rename to 01VariablesAndOperators/02_take_user_input.cpp diff --git a/Lab_01/03_integer_operations.cpp b/01VariablesAndOperators/03_integer_operations.cpp similarity index 100% rename from Lab_01/03_integer_operations.cpp rename to 01VariablesAndOperators/03_integer_operations.cpp diff --git a/Lab_01/04_integer_operations_v2.cpp b/01VariablesAndOperators/04_integer_operations_v2.cpp similarity index 100% rename from Lab_01/04_integer_operations_v2.cpp rename to 01VariablesAndOperators/04_integer_operations_v2.cpp diff --git a/Lab_01/06_division.cpp b/01VariablesAndOperators/06_division.cpp similarity index 100% rename from Lab_01/06_division.cpp rename to 01VariablesAndOperators/06_division.cpp diff --git a/Lab_01/07_circle.cpp b/01VariablesAndOperators/07_circle.cpp similarity index 100% rename from Lab_01/07_circle.cpp rename to 01VariablesAndOperators/07_circle.cpp diff --git a/Lab_01/08_scalene_triangle.cpp b/01VariablesAndOperators/08_scalene_triangle.cpp similarity index 100% rename from Lab_01/08_scalene_triangle.cpp rename to 01VariablesAndOperators/08_scalene_triangle.cpp diff --git a/Lab_01/09_equilateral_triangle.cpp b/01VariablesAndOperators/09_equilateral_triangle.cpp similarity index 100% rename from Lab_01/09_equilateral_triangle.cpp rename to 01VariablesAndOperators/09_equilateral_triangle.cpp diff --git a/Lab_01/10_right_triangle.cpp b/01VariablesAndOperators/10_right_triangle.cpp similarity index 100% rename from Lab_01/10_right_triangle.cpp rename to 01VariablesAndOperators/10_right_triangle.cpp diff --git a/Lab_01/11_rectangle.cpp b/01VariablesAndOperators/11_rectangle.cpp similarity index 100% rename from Lab_01/11_rectangle.cpp rename to 01VariablesAndOperators/11_rectangle.cpp diff --git a/Lab_01/12_square.cpp b/01VariablesAndOperators/12_square.cpp similarity index 100% rename from Lab_01/12_square.cpp rename to 01VariablesAndOperators/12_square.cpp diff --git a/Lab_01/13_swapping.cpp b/01VariablesAndOperators/13_swapping.cpp similarity index 100% rename from Lab_01/13_swapping.cpp rename to 01VariablesAndOperators/13_swapping.cpp diff --git a/Lab_01/README.md b/01VariablesAndOperators/README.md similarity index 100% rename from Lab_01/README.md rename to 01VariablesAndOperators/README.md diff --git a/Lab_02/01_temperature_converter.cpp b/02ControlStructures - IfElses/01_temperature_converter.cpp similarity index 100% rename from Lab_02/01_temperature_converter.cpp rename to 02ControlStructures - IfElses/01_temperature_converter.cpp diff --git a/Lab_02/02_odd_even.cpp b/02ControlStructures - IfElses/02_odd_even.cpp similarity index 100% rename from Lab_02/02_odd_even.cpp rename to 02ControlStructures - IfElses/02_odd_even.cpp diff --git a/Lab_02/03_negative_positive.cpp b/02ControlStructures - IfElses/03_negative_positive.cpp similarity index 100% rename from Lab_02/03_negative_positive.cpp rename to 02ControlStructures - IfElses/03_negative_positive.cpp diff --git a/Lab_02/04_vowel_consonant.cpp b/02ControlStructures - IfElses/04_vowel_consonant.cpp similarity index 100% rename from Lab_02/04_vowel_consonant.cpp rename to 02ControlStructures - IfElses/04_vowel_consonant.cpp diff --git a/Lab_02/05_largest_number.cpp b/02ControlStructures - IfElses/05_largest_number.cpp similarity index 100% rename from Lab_02/05_largest_number.cpp rename to 02ControlStructures - IfElses/05_largest_number.cpp diff --git a/Lab_02/06_leap_year.cpp b/02ControlStructures - IfElses/06_leap_year.cpp similarity index 100% rename from Lab_02/06_leap_year.cpp rename to 02ControlStructures - IfElses/06_leap_year.cpp diff --git a/Lab_02/README.md b/02ControlStructures - IfElses/README.md similarity index 100% rename from Lab_02/README.md rename to 02ControlStructures - IfElses/README.md diff --git a/Lab_03/Digits.cpp b/03ControlStructures - SwitchAndLoops/Digits.cpp similarity index 100% rename from Lab_03/Digits.cpp rename to 03ControlStructures - SwitchAndLoops/Digits.cpp diff --git a/Lab_03/Fibonacci.cpp b/03ControlStructures - SwitchAndLoops/Fibonacci.cpp similarity index 100% rename from Lab_03/Fibonacci.cpp rename to 03ControlStructures - SwitchAndLoops/Fibonacci.cpp diff --git a/Lab_03/Operators.cpp b/03ControlStructures - SwitchAndLoops/Operators.cpp similarity index 100% rename from Lab_03/Operators.cpp rename to 03ControlStructures - SwitchAndLoops/Operators.cpp diff --git a/Lab_03/Prime.cpp b/03ControlStructures - SwitchAndLoops/Prime.cpp similarity index 100% rename from Lab_03/Prime.cpp rename to 03ControlStructures - SwitchAndLoops/Prime.cpp diff --git a/Lab_03/README.md b/03ControlStructures - SwitchAndLoops/README.md similarity index 100% rename from Lab_03/README.md rename to 03ControlStructures - SwitchAndLoops/README.md diff --git a/Lab_03/Sum1.cpp b/03ControlStructures - SwitchAndLoops/Sum1.cpp similarity index 100% rename from Lab_03/Sum1.cpp rename to 03ControlStructures - SwitchAndLoops/Sum1.cpp diff --git a/Lab_03/Sum2.cpp b/03ControlStructures - SwitchAndLoops/Sum2.cpp similarity index 100% rename from Lab_03/Sum2.cpp rename to 03ControlStructures - SwitchAndLoops/Sum2.cpp diff --git a/Lab_03/Weekdays.cpp b/03ControlStructures - SwitchAndLoops/Weekdays.cpp similarity index 100% rename from Lab_03/Weekdays.cpp rename to 03ControlStructures - SwitchAndLoops/Weekdays.cpp diff --git a/Lab_03/mn.cpp b/03ControlStructures - SwitchAndLoops/mn.cpp similarity index 100% rename from Lab_03/mn.cpp rename to 03ControlStructures - SwitchAndLoops/mn.cpp diff --git a/Lab_04/README.md b/04ControlStructures - NestedLoops/README.md similarity index 100% rename from Lab_04/README.md rename to 04ControlStructures - NestedLoops/README.md diff --git a/Lab_04/Source.cpp b/04ControlStructures - NestedLoops/Source.cpp similarity index 100% rename from Lab_04/Source.cpp rename to 04ControlStructures - NestedLoops/Source.cpp diff --git a/Lab_04/Source1.cpp b/04ControlStructures - NestedLoops/Source1.cpp similarity index 100% rename from Lab_04/Source1.cpp rename to 04ControlStructures - NestedLoops/Source1.cpp diff --git a/Lab_04/Source2.cpp b/04ControlStructures - NestedLoops/Source2.cpp similarity index 100% rename from Lab_04/Source2.cpp rename to 04ControlStructures - NestedLoops/Source2.cpp diff --git a/Lab_04/Source3.cpp b/04ControlStructures - NestedLoops/Source3.cpp similarity index 100% rename from Lab_04/Source3.cpp rename to 04ControlStructures - NestedLoops/Source3.cpp diff --git a/Lab_04/Source4.cpp b/04ControlStructures - NestedLoops/Source4.cpp similarity index 100% rename from Lab_04/Source4.cpp rename to 04ControlStructures - NestedLoops/Source4.cpp diff --git a/Lab_05/README.md b/05Functions - Introduction/README.md similarity index 100% rename from Lab_05/README.md rename to 05Functions - Introduction/README.md diff --git a/Lab_05/Source.cpp b/05Functions - Introduction/Source.cpp similarity index 100% rename from Lab_05/Source.cpp rename to 05Functions - Introduction/Source.cpp diff --git a/Lab_05/Source1.cpp b/05Functions - Introduction/Source1.cpp similarity index 100% rename from Lab_05/Source1.cpp rename to 05Functions - Introduction/Source1.cpp diff --git a/Lab_05/Source2.cpp b/05Functions - Introduction/Source2.cpp similarity index 100% rename from Lab_05/Source2.cpp rename to 05Functions - Introduction/Source2.cpp diff --git a/Lab_05/Source3.cpp b/05Functions - Introduction/Source3.cpp similarity index 100% rename from Lab_05/Source3.cpp rename to 05Functions - Introduction/Source3.cpp diff --git a/Lab_06/README.md b/06Functions - Overloading/README.md similarity index 100% rename from Lab_06/README.md rename to 06Functions - Overloading/README.md diff --git a/Lab_06/Source.cpp b/06Functions - Overloading/Source.cpp similarity index 100% rename from Lab_06/Source.cpp rename to 06Functions - Overloading/Source.cpp diff --git a/Lab_07/README.md b/07Functions - Recursion/README.md similarity index 100% rename from Lab_07/README.md rename to 07Functions - Recursion/README.md diff --git a/Lab_07/fibonacci.cpp b/07Functions - Recursion/fibonacci.cpp similarity index 100% rename from Lab_07/fibonacci.cpp rename to 07Functions - Recursion/fibonacci.cpp diff --git a/Lab_07/gcd.cpp b/07Functions - Recursion/gcd.cpp similarity index 100% rename from Lab_07/gcd.cpp rename to 07Functions - Recursion/gcd.cpp diff --git a/Lab_07/power.cpp b/07Functions - Recursion/power.cpp similarity index 100% rename from Lab_07/power.cpp rename to 07Functions - Recursion/power.cpp diff --git a/Lab_07/sum.cpp b/07Functions - Recursion/sum.cpp similarity index 100% rename from Lab_07/sum.cpp rename to 07Functions - Recursion/sum.cpp diff --git a/Lab_08/README.md b/08Arrays - Introduction/README.md similarity index 100% rename from Lab_08/README.md rename to 08Arrays - Introduction/README.md diff --git a/Lab_08/Sort.cpp b/08Arrays - Introduction/Sort.cpp similarity index 100% rename from Lab_08/Sort.cpp rename to 08Arrays - Introduction/Sort.cpp diff --git a/Lab_08/average.cpp b/08Arrays - Introduction/average.cpp similarity index 100% rename from Lab_08/average.cpp rename to 08Arrays - Introduction/average.cpp diff --git a/Lab_08/deleting.cpp b/08Arrays - Introduction/deleting.cpp similarity index 100% rename from Lab_08/deleting.cpp rename to 08Arrays - Introduction/deleting.cpp diff --git a/Lab_08/display.cpp b/08Arrays - Introduction/display.cpp similarity index 100% rename from Lab_08/display.cpp rename to 08Arrays - Introduction/display.cpp diff --git a/Lab_08/inserting.cpp b/08Arrays - Introduction/inserting.cpp similarity index 100% rename from Lab_08/inserting.cpp rename to 08Arrays - Introduction/inserting.cpp diff --git a/Lab_09/Pascal.cpp b/09Arrays - Nested/Pascal.cpp similarity index 100% rename from Lab_09/Pascal.cpp rename to 09Arrays - Nested/Pascal.cpp diff --git a/Lab_09/Pascal2.cpp b/09Arrays - Nested/Pascal2.cpp similarity index 100% rename from Lab_09/Pascal2.cpp rename to 09Arrays - Nested/Pascal2.cpp diff --git a/Lab_09/README.md b/09Arrays - Nested/README.md similarity index 100% rename from Lab_09/README.md rename to 09Arrays - Nested/README.md diff --git a/Lab_09/Source1.cpp b/09Arrays - Nested/Source1.cpp similarity index 100% rename from Lab_09/Source1.cpp rename to 09Arrays - Nested/Source1.cpp diff --git a/Lab_09/Source2.cpp b/09Arrays - Nested/Source2.cpp similarity index 100% rename from Lab_09/Source2.cpp rename to 09Arrays - Nested/Source2.cpp diff --git a/Lab_10/README.md b/10Classes - Introduction/README.md similarity index 100% rename from Lab_10/README.md rename to 10Classes - Introduction/README.md diff --git a/Lab_10/studentCourseEvaluation.cpp b/10Classes - Introduction/studentCourseEvaluation.cpp similarity index 100% rename from Lab_10/studentCourseEvaluation.cpp rename to 10Classes - Introduction/studentCourseEvaluation.cpp diff --git a/Lab_11/README.md b/11Classes - ConstructorsAndDestructors/README.md similarity index 100% rename from Lab_11/README.md rename to 11Classes - ConstructorsAndDestructors/README.md diff --git a/Lab_11/Source.cpp b/11Classes - ConstructorsAndDestructors/Source.cpp similarity index 100% rename from Lab_11/Source.cpp rename to 11Classes - ConstructorsAndDestructors/Source.cpp diff --git a/Lab_12/README.md b/12Classes - ClassSpecificFunctions/README.md similarity index 100% rename from Lab_12/README.md rename to 12Classes - ClassSpecificFunctions/README.md diff --git a/Lab_12/main.cpp b/12Classes - ClassSpecificFunctions/main.cpp similarity index 100% rename from Lab_12/main.cpp rename to 12Classes - ClassSpecificFunctions/main.cpp diff --git a/Lab_13/README.md b/13Classes - OperatorOverloading/README.md similarity index 100% rename from Lab_13/README.md rename to 13Classes - OperatorOverloading/README.md diff --git a/Lab_13/main1.cpp b/13Classes - OperatorOverloading/main1.cpp similarity index 100% rename from Lab_13/main1.cpp rename to 13Classes - OperatorOverloading/main1.cpp diff --git a/Lab_14/README.md b/14Classes - OperatorOverloading2/README.md similarity index 100% rename from Lab_14/README.md rename to 14Classes - OperatorOverloading2/README.md diff --git a/Lab_14/Source.cpp b/14Classes - OperatorOverloading2/Source.cpp similarity index 100% rename from Lab_14/Source.cpp rename to 14Classes - OperatorOverloading2/Source.cpp diff --git a/Lab_15/README.md b/15Classes - InheritanceAndOOP/README.md similarity index 100% rename from Lab_15/README.md rename to 15Classes - InheritanceAndOOP/README.md diff --git a/Lab_15/Source.cpp b/15Classes - InheritanceAndOOP/Source.cpp similarity index 100% rename from Lab_15/Source.cpp rename to 15Classes - InheritanceAndOOP/Source.cpp diff --git a/16Classes - InheritanceAndOOP2/README.pdf b/16Classes - InheritanceAndOOP2/README.pdf new file mode 100644 index 0000000..dee74a5 Binary files /dev/null and b/16Classes - InheritanceAndOOP2/README.pdf differ diff --git a/Lab_16/Source.cpp b/16Classes - InheritanceAndOOP2/Source.cpp similarity index 100% rename from Lab_16/Source.cpp rename to 16Classes - InheritanceAndOOP2/Source.cpp diff --git a/17Classes - InheritanceAndOOP3/Activity-1.pdf b/17Classes - InheritanceAndOOP3/Activity-1.pdf new file mode 100644 index 0000000..47f0bc9 Binary files /dev/null and b/17Classes - InheritanceAndOOP3/Activity-1.pdf differ diff --git a/Lab_17/Education.cpp b/17Classes - InheritanceAndOOP3/Education.cpp similarity index 100% rename from Lab_17/Education.cpp rename to 17Classes - InheritanceAndOOP3/Education.cpp diff --git a/Lab_18/README.md b/18Classes - InheritanceAndOOP4/OOP4/README.md similarity index 100% rename from Lab_18/README.md rename to 18Classes - InheritanceAndOOP4/OOP4/README.md diff --git a/Lab_18/main.cpp b/18Classes - InheritanceAndOOP4/OOP4/main.cpp similarity index 100% rename from Lab_18/main.cpp rename to 18Classes - InheritanceAndOOP4/OOP4/main.cpp diff --git a/Lab_19/README.md b/19Files - Introduction/README.md similarity index 100% rename from Lab_19/README.md rename to 19Files - Introduction/README.md diff --git a/Lab_19/contacts.txt b/19Files - Introduction/contacts.txt similarity index 100% rename from Lab_19/contacts.txt rename to 19Files - Introduction/contacts.txt diff --git a/Lab_19/main.cpp b/19Files - Introduction/main.cpp similarity index 100% rename from Lab_19/main.cpp rename to 19Files - Introduction/main.cpp diff --git a/Lab_19/numbers.txt b/19Files - Introduction/numbers.txt similarity index 100% rename from Lab_19/numbers.txt rename to 19Files - Introduction/numbers.txt diff --git a/Lab_19/one.txt b/19Files - Introduction/one.txt similarity index 100% rename from Lab_19/one.txt rename to 19Files - Introduction/one.txt diff --git a/Lab_19/total.txt b/19Files - Introduction/total.txt similarity index 100% rename from Lab_19/total.txt rename to 19Files - Introduction/total.txt diff --git a/Lab_19/two.txt b/19Files - Introduction/two.txt similarity index 100% rename from Lab_19/two.txt rename to 19Files - Introduction/two.txt diff --git a/Lab_20/Person.cpp b/20Files - FileHandling/Person.cpp similarity index 100% rename from Lab_20/Person.cpp rename to 20Files - FileHandling/Person.cpp diff --git a/Lab_20/README.md b/20Files - FileHandling/README.md similarity index 100% rename from Lab_20/README.md rename to 20Files - FileHandling/README.md diff --git a/Lab_20/contacts b/20Files - FileHandling/contacts similarity index 100% rename from Lab_20/contacts rename to 20Files - FileHandling/contacts diff --git a/Lab_16/README.docx b/Lab_16/README.docx deleted file mode 100644 index 744bfd1..0000000 Binary files a/Lab_16/README.docx and /dev/null differ diff --git a/Lab_17/Activity-1.docx b/Lab_17/Activity-1.docx deleted file mode 100644 index e0a5562..0000000 Binary files a/Lab_17/Activity-1.docx and /dev/null differ diff --git a/Lab_21/city_temperature_control.cpp b/Lab_21/city_temperature_control.cpp deleted file mode 100644 index cb666d0..0000000 --- a/Lab_21/city_temperature_control.cpp +++ /dev/null @@ -1,688 +0,0 @@ -// Rustam Zokirov - (U1910049) - Section 004; -// Second Program - Final Assignment; -// BINARY FILES ARE USED - -#include -#include -#include -#include // for _getch() -#include // for listing in rows and columns - -using namespace std; - -int main(); -void CityTemperatureInfo(); // for temperature case 1 -void CityRainFallInfo(); // for temperature case 2 -void CityHumidityInfo(); // for temperature case 3 - -class City { -protected: - int cityID; - string cityName; - double cityClimateDate[12]; - -public: - // inputing the data for ID and name - void input() { - cout << "Enter ID of the city: "; - cin >> cityID; - cout << "Enter Name of the city: "; - cin >> cityName; - } - - int getCityID() { - return cityID; - } - - void setCityID(int cityID) { - this->cityID = cityID; - } - - string getCityName() { - return cityName; - } - - void setCityName(string cityName) { - this->cityName = cityName; - } - - // diplaying with the binary files - void GetData() { - cout << "ID NAME J F M A M I I A S O N D\n"; - cout << left << setw(10) << cityID << setw(10) << cityName << " "; - } - - virtual void setClimateData() = 0; // virtual functions - virtual void getClimateData() = 0; - -}; - -class CityTemperature : public City -{ -protected: - double average = 0; - -public: - - void setClimateData() { - average = 0; - City::input(); - - cout << "Enter Temperature Degree: " << endl; - - for (int i = 0; i < 12; i++) { - cout << i+1 << " Month: "; - - cin >> cityClimateDate[i]; - // validation check - if (cityClimateDate[i] > -60 && cityClimateDate[i] < 60) { - average = average + cityClimateDate[i]; - } - else { - cout << "Please check your input! " << endl; - i--; // checking and returning - } - } // for ends - - } - - // for displaying from file - void getClimateData() { - - City::GetData(); - - int array = 0; - for (int i = 0; i < 4; i++) { - for (int j = 0; j < 3; j++) { - cout << cityClimateDate[array] << " "; - array++; - } - } - // claculating the average temperature - cout << "\nAverage Temperature: " << average / 12.0 << endl << endl; - array = 0; - } -}; - -// class for rainfall -class CityRainFall : public City -{ -protected: - double average = 0; // average for calculating - -public: - - void setClimateData() { - average = 0; - City::input(); - - cout << "Enter Rainfall Degree: " << endl; - - for (int i = 0; i < 12; i++) { - cout << i+1 << " Month: "; - - cin >> cityClimateDate[i]; - - if (cityClimateDate[i] > 0 && cityClimateDate[i] < 300) { - average = average + cityClimateDate[i]; - } - else { - cout << "Please check your input! " << endl; - i--; // checking and returning - } - } // for ends - - } - - void getClimateData() { - - City::GetData(); - - int array = 0; - for (int i = 0; i < 4; i++) { - for (int j = 0; j < 3; j++) { - cout << cityClimateDate[array] << " "; - array++; - } - ; - } - cout << "\nAverage Rainfall: " << average / 12.0 << endl << endl; - array = 0; - } -}; - -// class for humodity -class CityHumidity : public City -{ -protected: - double average = 0; - -public: - - void setClimateData() { - average = 0; - City::input(); - - cout << "Enter Humidity Degree: " << endl; - - for (int i = 0; i < 12; i++) { - cout << i+1 << " Month: "; - - cin >> cityClimateDate[i]; - - if (cityClimateDate[i] > 0 && cityClimateDate[i] < 500) { - average = average + cityClimateDate[i]; - } - else { - cout << "Please check your input! " << endl; - i--; // checking and returning - } - } // for ends - - } - - void getClimateData() { - - City::GetData(); - - int array = 0; - for (int i = 0; i < 4; i++) { - for (int j = 0; j < 3; j++) { - cout << cityClimateDate[array] << " "; - array++; - } - - } - cout << "\nAverage Humidity: " << average / 12.0 << endl << endl; - array = 0; - } -}; - -void CityTemperatureInfo() { - - CityTemperature Temperature; // creating an object - - for (int i = 0; i < 1000; i++) { - system("cls"); - - cout << "City Temperature Information: \n"; - cout << "1. Add\n"; - cout << "2. Update\n"; - cout << "3. Delete\n"; - cout << "0. Go Back\n"; - - cout << "Your choice: \n"; - - switch (_getch()) - { - case '1': { - system("cls"); - cout << "ADD DATA TO CITY\n"; - cout << "Enter temperature data of city: " << endl; - // Add to List - ofstream outTemperature("Temperature", ios::binary | ios::app); // opening a binary file - Temperature.setClimateData(); - // writing data to file - outTemperature.write((char*)&Temperature, sizeof(CityTemperature)); - outTemperature.close(); - - system("pause"); - }break; - - case '2': { - system("cls"); - - ifstream inP("Temperature", ios::binary); - while (inP.read((char*)&Temperature, sizeof(CityTemperature))) { - Temperature.getClimateData(); - } - inP.close(); // closing the files after execution - - // searching the city by its ID - int ID; - cout << "\nEnter ID of city which you want to delete: "; - cin >> ID; - - ifstream inTemperature1; - inTemperature1.open("Temperature", ios::binary); - while (inTemperature1.read((char*)&Temperature, sizeof(CityTemperature))) { - if (ID == Temperature.getCityID()) { - Temperature.getClimateData(); - } - } - inTemperature1.close(); - - ofstream inTemperatureTemp1("TemperatureTemp", ios::binary); - ifstream inTemperature("Temperature", ios::binary); - // reading file - while (inTemperature1.read((char*)&Temperature, sizeof(CityTemperature))) { - if (ID != Temperature.getCityID()) { - inTemperatureTemp1.write((char*)&Temperature, sizeof(CityTemperature)); - } - - } - inTemperature1.close(); - inTemperatureTemp1.close(); - - // removing and renaming the files - remove("Temperature"); - rename("TemperatureTemp", "Temperature"); - - ofstream out; - out.open("Temperature", ios::binary | ios::app); - cout << "Update data:" << endl; - Temperature.setClimateData(); - out.write((char*)&Temperature, sizeof(CityTemperature)); - out.close(); - cout << "\nSuccessfully updated" << endl; - - system("pause"); - }break; - - case '3': { - system("cls"); - - cout << "DELETING DATA FROM CITY\n"; - - ifstream inP("Temperature", ios::binary); - while (inP.read((char*)&Temperature, sizeof(CityTemperature))) { - Temperature.getClimateData(); - } - inP.close(); // closing the files after execution - // searching the city by its ID - int ID; - cout << "Enter ID of city which you want to delete: "; - cin >> ID; - - ofstream outTemperatureTemp("TemperatureTemp", ios::binary); - ifstream inTemperature("Temperature", ios::binary); - while (inTemperature.read((char*)&Temperature, sizeof(CityTemperature))) { - if (ID != Temperature.getCityID()) { - outTemperatureTemp.write((char*)&Temperature, sizeof(CityTemperature)); - } - } - inTemperature.close(); - outTemperatureTemp.close(); - - remove("Temperature"); - rename("TemperatureTemp", "Temperature"); - - cout << "\nSuccessfully deleted" << endl; - cout << "The new list:\n"; - - ifstream inP2("Temperature", ios::binary); - while (inP2.read((char*)&Temperature, sizeof(CityTemperature))) { - Temperature.getClimateData(); - } - inP2.close(); // closing the files after execution - - system("pause"); - }break; - - case '0': { - main(); - }break; - - - default: { - cout << "Your choice is not available in menu!\n"; - system("pause"); - } - break; - } // switch - - } // for loop - - -} - -void CityRainFallInfo() { - - CityRainFall R; - - for (int i = 0; i < 1000; i++) { - system("cls"); - - cout << "City RainFall Information: \n"; - cout << "1. Add\n"; - cout << "2. Update\n"; - cout << "3. Delete\n"; - cout << "4. Displaying all\n"; - cout << "0. Go Back\n"; - - cout << "Your choice: \n"; - - switch (_getch()) - { - case '1': { - system("cls"); - cout << "ADD DATA TO CITY\n"; - cout << "Enter RainFall data of city: " << endl; - // Add to List - ofstream outR("R", ios::binary | ios::app); - R.setClimateData(); - outR.write((char*)&R, sizeof(CityRainFall)); - outR.close(); - - system("pause"); - }break; - - case '2': { - system("cls"); - - ifstream inP("R", ios::binary); - while (inP.read((char*)&R, sizeof(CityRainFall))) { - R.getClimateData(); - } - inP.close(); // closing the files after execution - - // searching the city by its ID - int ID; - cout << "\nEnter ID of city which you want to delete: "; - cin >> ID; - - ifstream inR1; - inR1.open("R", ios::binary); - while (inR1.read((char*)&R, sizeof(CityRainFall))) { - if (ID == R.getCityID()) { - R.getClimateData(); - } - } - inR1.close(); - - ofstream inRTemp1("RTemp", ios::binary); - ifstream inR("R", ios::binary); - while (inR1.read((char*)&R, sizeof(CityRainFall))) { - if (ID != R.getCityID()) { - inRTemp1.write((char*)&R, sizeof(CityRainFall)); - } - - } - inR1.close(); - inRTemp1.close(); - - remove("R"); - rename("RTemp", "R"); - - ofstream out; - out.open("R", ios::binary | ios::app); - cout << "Update data:" << endl; - R.setClimateData(); - out.write((char*)&R, sizeof(CityRainFall)); - out.close(); - cout << "\nSuccessfully updated" << endl; - - system("pause"); - }break; - - case '3': { - system("cls"); - - cout << "DELETING DATA FROM CITY\n"; - - ifstream inP("R", ios::binary); - while (inP.read((char*)&R, sizeof(CityRainFall))) { - R.getClimateData(); - } - inP.close(); // closing the files after execution - // searching the city by its ID - int ID; - cout << "Enter ID of city which you want to delete: "; - cin >> ID; - - ofstream outRTemp("RTemp", ios::binary); - ifstream inR("R", ios::binary); - while (inR.read((char*)&R, sizeof(CityRainFall))) { - if (ID != R.getCityID()) { - outRTemp.write((char*)&R, sizeof(CityRainFall)); - } - } - inR.close(); - outRTemp.close(); - - remove("R"); - rename("RTemp", "R"); - - cout << "\nSuccessfully deleted" << endl; - cout << "The new list:\n"; - - ifstream inP2("R", ios::binary); - while (inP2.read((char*)&R, sizeof(CityRainFall))) { - R.getClimateData(); - } - inP2.close(); // closing the files after execution - - system("pause"); - }break; - - case '0': { - main(); - }break; - - - default: { - cout << "Your choice is not available in menu!\n"; - system("pause"); - } - break; - } // switch - - } // for loop - - -} - -void CityHumidityInfo() { - - CityHumidity Humidity; - - for (int i = 0; i < 1000; i++) { - system("cls"); - - cout << "City Humidity Information: \n"; - cout << "1. Add\n"; - cout << "2. Update\n"; - cout << "3. Delete\n"; - cout << "0. Go Back\n"; - - cout << "Your choice: \n"; - - switch (_getch()) - { - case '1': { - system("cls"); - cout << "ADD DATA TO CITY\n"; - cout << "Enter Humidity data of city: " << endl; - // Add to List - ofstream outHumidity("Humidity", ios::binary | ios::app); - Humidity.setClimateData(); - outHumidity.write((char*)&Humidity, sizeof(CityHumidity)); - outHumidity.close(); - - system("pause"); - }break; - - case '2': { - system("cls"); - - ifstream inP("Humidity", ios::binary); - while (inP.read((char*)&Humidity, sizeof(CityHumidity))) { - Humidity.getClimateData(); - } - inP.close(); // closing the files after execution - - // searching the city by its ID - int ID; - cout << "\nEnter ID of city which you want to delete: "; - cin >> ID; - - ifstream inHumidity1; - inHumidity1.open("Humidity", ios::binary); - while (inHumidity1.read((char*)&Humidity, sizeof(CityHumidity))) { - if (ID == Humidity.getCityID()) { - Humidity.getClimateData(); - } - } - inHumidity1.close(); - - ofstream inHumidityTemp1("HumidityTemp", ios::binary); - ifstream inHumidity("Humidity", ios::binary); - while (inHumidity1.read((char*)&Humidity, sizeof(CityHumidity))) { - if (ID != Humidity.getCityID()) { - inHumidityTemp1.write((char*)&Humidity, sizeof(CityHumidity)); - } - - } - inHumidity1.close(); - inHumidityTemp1.close(); - - remove("Humidity"); - rename("HumidityTemp", "Humidity"); - - ofstream out; - out.open("Humidity", ios::binary | ios::app); - cout << "Update data:" << endl; - Humidity.setClimateData(); - out.write((char*)&Humidity, sizeof(CityHumidity)); - out.close(); - cout << "\nSuccessfully updated" << endl; - - system("pause"); - }break; - - case '3': { - system("cls"); - - cout << "DELETING DATA FROM CITY\n"; - - ifstream inP("Humidity", ios::binary); - while (inP.read((char*)&Humidity, sizeof(CityHumidity))) { - Humidity.getClimateData(); - } - inP.close(); // closing the files after execution - // searching the city by its ID - int ID; - cout << "Enter ID of city which you want to delete: "; - cin >> ID; - - ofstream outHumidityTemp("HumidityTemp", ios::binary); - ifstream inHumidity("Humidity", ios::binary); - while (inHumidity.read((char*)&Humidity, sizeof(CityHumidity))) { - if (ID != Humidity.getCityID()) { - outHumidityTemp.write((char*)&Humidity, sizeof(CityHumidity)); - } - } - inHumidity.close(); - outHumidityTemp.close(); - - remove("Humidity"); - rename("HumidityTemp", "Humidity"); - - cout << "\nSuccessfully deleted" << endl; - cout << "The new list:\n"; - - ifstream inP2("R", ios::binary); - while (inP2.read((char*)&Humidity, sizeof(CityRainFall))) { - Humidity.getClimateData(); - } - inP2.close(); // closing the files after execution - - system("pause"); - }break; - - case '0': { - main(); - }break; - - - default: { - cout << "Your choice is not available in menu!\n"; - system("pause"); - } - break; - } // switch - - } // for loop - - -} - -int main() { - for (int i = 0; i < 1000; i++) { - system("cls"); - - cout << "Main Menu: \n"; - cout << "1. City temperature information\n"; - cout << "2. City rainfall information\n"; - cout << "3. City humadity information\n"; - cout << "4. Dispalaying all\n"; - - cout << "Your choice: \n"; - - switch (_getch()) - { - - case '1': { - system("cls"); - CityTemperatureInfo(); - system("pause"); - }break; - - case '2': { - system("cls"); - CityRainFallInfo(); - system("pause"); - }break; - - case '3': { - system("cls"); - CityHumidityInfo(); - system("pause"); - }break; - - case '4':{ - system("cls"); - cout << "DISPLAYING ALL\n"; - /*CityTemperature Temperature1; // creating an object - CityRainFall R1; - CityHumidity Humidity1; - - cout << "TEMPERATURE:\n"; - ifstream inP("Temperature", ios::binary); - while (inP.read((char*)&Temperature1, sizeof(CityTemperature))) { - Temperature1.getClimateData(); - } - inP.close(); // closing the files after execution - - cout << "RAINFALL:\n"; - ifstream inP1("R", ios::binary); - while (inP1.read((char*)&R1, sizeof(CityRainFall))) { - R1.getClimateData(); - } - inP1.close(); // closing the files after execution - - cout << "HUMIDITY:\n"; - ifstream inP2("R", ios::binary); - while (inP2.read((char*)&Humidity1, sizeof(CityRainFall))) { - Humidity1.getClimateData(); - } - inP2.close(); // closing the files after execution*/ - - - system("pause"); - - } - break; - - default: { - cout << "Your choice is not available in menu!\n"; - system("pause"); - } - break; - } // switch - - } // for loop - - -} - diff --git a/Lab_21/e-commerce.cpp b/Lab_21/e-commerce.cpp deleted file mode 100644 index d56046c..0000000 --- a/Lab_21/e-commerce.cpp +++ /dev/null @@ -1,442 +0,0 @@ -// Rustam Zokirov - (U1910049) - Section 004; -// First Program - Final Assignment; -// BINARY FILES were used to manage the data; -// Temporary files were used for finding the product; -// Validations for quantity done you cannot decrease less than zero; -// Validations for UIC of product; -// You can buy a product with inputing its UIC; -// Billing system is in the Purchase() function case 3: -// - -#include -#include -#include -#include -#include - -using namespace std; - -int main(); - -// class ITEM base class for two clasees -class Item { // class ITEM which includes the name and universal item code -protected: - string name; - string UIC; -public: - Item() { // default constructor - name = "Unknown"; - UIC = "Unknown"; - } - - Item(string name, string UIC) { // parametirized constructor - this->name = name; - this->UIC = UIC; - } - - void set_name(string name) { // function for inputing the name of item - this->name = name; - } - - void set_UIC(string UIC) { - this->UIC = UIC; - } - - string get_name() { - return name; - } - - string get_UIC() { - return UIC; - } - - void virtual display() { - cout << left << setw(20) << name << setw(15) << UIC; - } - - void virtual input() { - cout << "Enter the name of a new product: "; - cin >> name; - cout << "Enter the UIC of a new product: "; - cin >> UIC; - } - -}; - -// class for Packed Products -class PackedGroceries : public Item { - -private: - double price; - int quantity; - int quantity_purchased; -public: - - PackedGroceries() { - price = 0.0; - quantity = 0; - quantity_purchased = 0; - } - - PackedGroceries(string name, string UIC, double price, int quantity, int quantity_purchased) : Item(name, UIC) { - this->price = price; - this->quantity = quantity; - this->quantity_purchased = quantity_purchased; - } - - void display() { - Item::display(); - cout << left << setw(20) << price << setw(15) << quantity << endl; - } - - void input() { - Item::input(); - cout << "Enter the price of a new product: "; - cin >> price; - cout << "Enter the quantity of a new product: "; - cin >> quantity; - } - - void set_quantity(int quantity) { - this->quantity = quantity; - } - - int get_quantity() { - return quantity; - } - - double get_price() { - return price; - } - - void set_quantity_p(int quantity_purchased) { - this->quantity_purchased = quantity_purchased; - } - - int get_quantity_p() { - quantity_purchased++; - quantity--; - return quantity_purchased; - } - -}; - -// classfor Fresh Products -class FreshGroceries : public Item { -private: - double price; - int quantity; - int quantity_purchased; - -public: - - FreshGroceries() { - price = 0.0; - quantity = 0; - quantity_purchased = 0; - } - - FreshGroceries(string name, string UIC, double price, int quantity, int quantity_purchased) : Item(name, UIC) { - this->price = price; - this->quantity = quantity; - this->quantity_purchased = quantity_purchased; - } - - void display() { - Item::display(); - cout << left << setw(20) << price << setw(15) << quantity << endl; - - } - - int get_quantity() { - return quantity; - } - - double get_price() { - return price; - } - - int get_quantity_p() { - quantity--; - quantity_purchased++; - return quantity_purchased; - } - - void input() { - Item::input(); - cout << "Enter the price of a new product: "; - cin >> price; - cout << "Enter the quantity of a new product: "; - cin >> quantity; - } - -}; - -void Purchase(){ - PackedGroceries p; // declaration of object PackedGroceries - FreshGroceries f; // declaration of object for class FreshGroceri - - for (int i = 0; i < 1000; i++) { - system("cls"); - - string UIC; // UIC for serching the product from the file - - ofstream outBill("Bill", ios::binary | ios::app); - - cout << "Second Main Menu: \n"; - cout << "1. Go to Packed Groceries\n"; - cout << "2. Go to Fresh Groceries \n"; - cout << "3. Bill \n"; - cout << "0. Go Back\n"; - cout << "Your choice: \n"; - - switch (_getch()) { - case '1': { - system("cls"); - ofstream outTempPacked("TempPacked", ios::binary | ios::app); - - // listing the products which exist - ifstream inPacked1("Packed", ios::binary); - cout << left << setw(20) << "Name" << setw(15) << "UIC" << setw(20) << "Price" << setw(15) << "Quantity" << endl; - while (inPacked1.read((char*)&p, sizeof(PackedGroceries))) { - p.display(); - } - inPacked1.close(); // closing the files after execution - - // searching the product by its code - cout << "\nEnter the UIC of product you want to purchase: "; - cin >> UIC; - - bool isFound = false; // bool for cheaking the existance of product - - ifstream inPacked("Packed", ios::binary); - while (inPacked.read((char*)&p, sizeof(PackedGroceries))) { - // serching from the file the product - if (p.get_UIC() == UIC) { - isFound = true; - if (p.get_quantity() > 0) { // validation for quantity - p.get_quantity_p(); // functions for calculating the quantities - } - else if (p.get_quantity() < 0) { // quantity cannot be less than zero - cout << "Sorry, product is over!\n"; - } - // w - outTempPacked.write((char*)&p, sizeof(PackedGroceries)); - outBill.write((char*)&p, sizeof(PackedGroceries)); - - cout << "Successfully purchased 1 pc.\n"; - cout << "Done Great\n"; - } - else if (p.get_UIC() != UIC) { - outTempPacked.write((char*)&p, sizeof(PackedGroceries)); - - } - else { - isFound = false; - } - - } // switch - outTempPacked.close(); // closing temp - inPacked.close(); // closing packed - outBill.close(); - - - if (!isFound) { - cout << "Not Found 404 ERROR\n"; - } - - // removing and renaming temp - remove("Packed"); - rename("TempPacked", "Packed"); - - cout << "\n\nThe new table: \n"; - // for redisplaaying the file - ifstream inPacked1_2("Packed", ios::binary); - cout << left << setw(20) << "Name" << setw(15) << "UIC" << setw(20) << "Price" << setw(15) << "Quantity" << endl; - while (inPacked1_2.read((char*)&p, sizeof(PackedGroceries))) { - p.display(); - } - inPacked1_2.close(); // closing the files after execution - cout << endl << endl; - - - system("pause"); - }break; - - case '2': { - system("cls"); - ofstream outTempFresh("TempFresh", ios::binary | ios::app); - - ifstream inFresh1("Fresh", ios::binary); - cout << left << setw(20) << "Name" << setw(15) << "UIC" << setw(20) << "Price" << setw(15) << "Quantity" << endl; - while (inFresh1.read((char*)&f, sizeof(FreshGroceries))) { - f.display(); - } - inFresh1.close(); // closing the files after execution - - // searching the product by its code - cout << "\nEnter the UIC of product you want to purchase: "; - cin >> UIC; - - bool isFound2 = false; - ifstream inFresh("Fresh", ios::binary); - - while (inFresh.read((char*)&f, sizeof(FreshGroceries))) { - if (f.get_UIC() == UIC) { - isFound2 = true; - if (f.get_quantity() > 0) { - f.get_quantity_p(); // functions for calculating the quantities - } - else if (f.get_quantity() < 0) { - cout << "Sorry, product is over!\n"; - } - - // storing the found data to files - // first for Billing system - // next for Listing - outBill.write((char*)&f, sizeof(FreshGroceries)); - outTempFresh.write((char*)&f, sizeof(FreshGroceries)); - - cout << "Successfully purchased 1 pc.\n"; - cout << "Done Great\n"; - } - else if (f.get_UIC() != UIC) { - outTempFresh.write((char*)&f, sizeof(FreshGroceries)); - } - else { - isFound2 = false; - } - - } // switch - outTempFresh.close(); // closing temp - inFresh.close(); // closing packed - outBill.close(); - - if (!isFound2) { - cout << "Not Found 404 ERROR\n"; - } - - // removing and renaming temp - remove("Fresh"); - rename("TempFresh", "Fresh"); - - // for redisplaying the table - cout << "\n\nThe new table: \n"; - ifstream inFresh1_2("Fresh", ios::binary); - cout << left << setw(20) << "Name" << setw(15) << "UIC" << setw(20) << "Price" << setw(15) << "Quantity" << endl; - while (inFresh1_2.read((char*)&f, sizeof(FreshGroceries))) { - f.display(); - } - inFresh1_2.close(); // closing the files after execution - cout << endl << endl; - - - system("pause"); - }break; - - case '3': { - system("cls"); - double price_final = 0.0; - - // the billing system for Packed - cout << "The billing system:\n"; - ifstream inBill("Bill", ios::binary); - cout << left << setw(20) << "Name" << setw(15) << "UIC" <` -82. [OOP] Temperature converter. Write a class called **`TemperatureConverter`** with methods to convert between Celsius and Fahrenheit. From Celsius Kelvin. to Create an object of this class, and use it to convert a temperature from one scale to another. -83. [OOP] Simple calculator. Create a class called **`Calculator`** that can perform basic arithmetic operations (addition, subtraction, multiplication, division). Create an object of the class and use it to perform some calculations. -84. [OOP] Create a class **`Rectangle`** with attributes for its length and width. Implement a method to calculate the area of the rectangle. Create an object and compute the area for a specific rectangle. -85. [OOP] Simple To-Do List: Design a basic to-do list application where users can add, remove, and display tasks. You can save tasks in an array. -86. [OOP] Define a class student with the following specifications. - - ```cpp - Student - --- - + Student_ID: String - + Student_Name: String - + OOP2_Score: double - + Maths_Score: double - + English_Score: double - + Total_Score: double - --- - + ctotal(): Function to calculate eng + math + OOP-2 with double return type. - + Takedata(): Function to accept values for student ID, Student Name, eng, OOP-2, maths and invoke ctotal() to calculate total. - + Showdata(): Function to display all the data members on the screen. - ``` -87. [OOP] The class Person with private attributes name(string) and age(int). - - The class contains three functions. - - - One with no parameter (for initializing default value). - - With two parameters (one parameter with default value). - - Function to display the data. - - ```cpp - Person - --- - + Name: String - + Age: int - --- - + Display() - + Person() - + Person(a: int) - ``` -88. [OOP] Inheritance: https://github.com/Rustam-Z/cpp-programming/tree/main/OOP2_Lab6 -89. [OOP] Encapsulation: https://github.com/Rustam-Z/cpp-programming/tree/main/OOP2_Lab7 - - Write a C++ menu-driven program to get employee details, display employee details, and display monthly salary details of employees.**** - - ```cpp - Employee - --- - - Employee_ID: String - - Employee_Name: String - - No_of_Hours_Work: int - - Rate_per_Hour: int - --- - + setEmployee_ID(String) - + getEmployee_ID(): String - + setEmployee_Name(String) - + getEmployee_Name(): String - + setNo_of_Hours_Work(int) - + getNo_of_Hours_Work(): int - + setRate_per_Hour(int) - + getRate_per_Hour(): int - + getTotal_Monthly_Salary(): double - ``` -91. [OOP] Polymorphism: https://github.com/Rustam-Z/cpp-programming/tree/main/OOP2_Lab8 - -**More questions can be found in the LAB folders above.** - - -## Projects Ideas -1. Banking system with all banking facilities like – deposit, withdrawal, foreign exchange to any currency, availability of loans for purchasing vehicles, apartments, houses, setting up business, education loan, management of ATMs, and all other features. -2. Airline flight reservation system (online booking of tickets on different flights for different destinations all over the world, cancellation of tickets, clear display of cancellation amount, refund of the amount after cancellation, showing availability of all flights, showing flights timings for all 7 days of a week, seats availability, seat selection for travelers by giving the complete layout of the seating arrangement inside the flights, food availability/non-availability inside the flights, change of travel dates and the amount charged.) -3. Taxi/cab sharing app -4. University education portal (providing all information about undergraduate, postgraduate, and doctoral programs offered, facilities available, location & map, and fee structure in all the universities) -5. Online exam management system (with total security of identifying the students during exam, monitoring the student's activities during the exam, selection of different questions for each student, development of a large question bank containing hundreds of questions in each subject considering all courses taught at the university) -6. Library management system -7. E-content management system -8. Plagiarism checker & file management system -9. Hotel reservation & management portal -10. Restaurant management -11. Healthcare consulting system (doctors with different specializations for consultation, hospitals with all facilities for treating different diseases & abroad - one-stop portal for all consultations and treatments) -12. Electronic health record management system with built-in security -13. Pharmacy - medical store management -14. Blood bank system -15. Online shopping and delivery system (like Amazon) -16. Online car shopping -17. Tourism portal -18. World tourism portal -19. Higher education abroad portal -20. Job search/recruitment portal -21. Company resource management system -22. Attendance monitoring system with fingerprints verification -23. Face recognition - based attendance checking system -24. Aircraft communication and monitoring system -25. Ticket booking management system for concert ceremonies -26. All store stock management (inventory control) -27. Multiplayer gaming applications -28. City traffic monitoring and control system -29. Police traffic violation reporting & control system -30. The marriage function hall booking & food/music arrangement system -31. Any vehicle (car, bus, heavy vehicles for parties, functions, family picnics, long-distance travel) booking portal -32. Teacher-assisted program writing environment for students -33. Doctors reservation system for patients -34. Bus reservation & tracking system -35. Railway booking and train tracking system -36. Warehouse management system -37. Courier tracking, cargo, and freight transportation -38. Online code testing system -39. Online quiz system (with total security of identifying the students during the quiz, monitoring the students’ activities during the quiz, selection of different quiz questions for each student, development of a large quiz question bank containing hundreds of quiz questions in each subject considering all courses taught at the university) -40. Land/house/apartment rental & purchase portal -41. Housecleaning, plumbing, electricity service & maintenance system -42. Human organ transplantation management system -43. Covid-19 tracking, testing, treatment & hospital management system -44. Cryptocurrency trading portal (exchange) allowing trading of all crypto coins using security, confidentiality, and authentication -45. Parking management system -46. Online food delivery system (linked to all restaurants in different districts in different regions in some countries) -47. *Food ordering system | Get order → print cheque as PDF file → see order status on separate HTML page. -48. *Weather app that recommends what to wear as a telegram bot. -49. *QR code generator, as a CLI tool, as a telegram bot. -50. *Remainder application (crontab tool) as a telegram bot, as a CLI application. -51. *Build own URL shortener as a telegram bot, as a CLI application, web app. -52. Math library with functions as a library. -53. Lost and found as a web app. - -## More Project Ideas -- [Coding Challenges: Build Your Own](https://codingchallenges.fyi/challenges/intro) -- [Build your own -](https://github.com/codecrafters-io/build-your-own-x) -- [🔥 200 Project Ideas from Beginner to Advanced with Open Source Contributions 🚀 -](https://dev.to/kishansheth/200-project-ideas-from-beginner-to-advanced-with-open-source-contributions-3g6a) - +## Docs And Useful Tools +- [cppreference](https://cppreference.com/) +- [Compiler Explorer](https://godbolt.org/) +- [C++ Benchmark](https://quick-bench.com/) +- [C++ Insights](https://quick-bench.com/)