diff --git a/Lab_01/01_hello_world.cpp b/Lab_01/01_hello_world.cpp new file mode 100644 index 0000000..c5747c4 --- /dev/null +++ b/Lab_01/01_hello_world.cpp @@ -0,0 +1,13 @@ +// Program to print text on the console. +// cout -> console output. + +#include + +using namespace std; + +int main() +{ + cout << "Hello, World!" << endl; + system("pause"); + return 0; +} \ No newline at end of file diff --git a/Lab_01/02_take_user_input.cpp b/Lab_01/02_take_user_input.cpp new file mode 100644 index 0000000..cefb170 --- /dev/null +++ b/Lab_01/02_take_user_input.cpp @@ -0,0 +1,16 @@ +// Program to print an integer entered by the user. +// cin -> console input. + +#include + +using namespace std; + +int main() +{ + int number; + cout << "Enter an integer: "; + cin >> number; + cout << "You entered: " << number << endl; + system("pause"); + return 0; +} \ No newline at end of file diff --git a/Lab_01/03_integer_operations.cpp b/Lab_01/03_integer_operations.cpp new file mode 100644 index 0000000..532c3f5 --- /dev/null +++ b/Lab_01/03_integer_operations.cpp @@ -0,0 +1,19 @@ +// Program to Add/Subtract/Multiply/Divide Two Integers. + +#include + +using namespace std; + +int main() +{ + int num1, num2; + cout << "Enter two integers: "; + cin >> num1 >> num2; + cout << "Sum: " << num1 + num2 << endl; + cout << "Difference: " << num1 - num2 << endl; + cout << "Product: " << num1 * num2 << endl; + cout << "Quotient: " << num1 / num2 << endl; + cout << "Remainder: " << num1 % num2 << endl; + system("pause"); + return 0; +} \ No newline at end of file diff --git a/Lab_01/04_integer_operations_v2.cpp b/Lab_01/04_integer_operations_v2.cpp new file mode 100644 index 0000000..27ab1c9 --- /dev/null +++ b/Lab_01/04_integer_operations_v2.cpp @@ -0,0 +1,19 @@ +// C++ Program to Add/Subtract/Multiply/Divide Two Integers entered by the user. + +#include + +using namespace std; + +int main() +{ + int num1, num2; + cout << "Enter two integers: "; + cin >> num1 >> num2; + cout << "Sum: " << num1 + num2 << endl; + cout << "Difference: " << num1 - num2 << endl; + cout << "Product: " << num1 * num2 << endl; + cout << "Quotient: " << num1 / num2 << endl; + cout << "Remainder: " << num1 % num2 << endl; + system("pause"); + return 0; +} \ No newline at end of file diff --git a/Lab_01/06_division.cpp b/Lab_01/06_division.cpp new file mode 100644 index 0000000..7ddd330 --- /dev/null +++ b/Lab_01/06_division.cpp @@ -0,0 +1,20 @@ +// C++ Program to Compute Quotient and Remainder. + +#include + +using namespace std; + +int main() +{ + int dividend, divisor, quotient, remainder; + cout << "Enter dividend: "; + cin >> dividend; + cout << "Enter divisor: "; + cin >> divisor; + quotient = dividend / divisor; + remainder = dividend % divisor; + cout << "Quotient = " << quotient << endl; + cout << "Remainder = " << remainder << endl; + system("pause"); + return 0; +} \ No newline at end of file diff --git a/OOP1-Lab1/Source.cpp b/Lab_01/07_circle.cpp similarity index 61% rename from OOP1-Lab1/Source.cpp rename to Lab_01/07_circle.cpp index f6cdce8..5d68352 100644 --- a/OOP1-Lab1/Source.cpp +++ b/Lab_01/07_circle.cpp @@ -1,24 +1,26 @@ -//U1910049 Rustam Zokirov -//Section 004 -//Assignment-2(Operators) -//C++ program to Calculate Area and Circumference of Circle +// C++ program to Calculate Area and Circumference of Circle. #include + using namespace std; -int main(){ + +int main() +{ cout << "\t\tC++ program to Calculate Area and Circumference of Circle.\n"; float R, Area, Circumference; - cout << "Please enter the Radius of Circle: " ; + cout << "Please enter the Radius of Circle: "; cin >> R; + if (R > 0) { Area = 3.14 * R * R; Circumference = 2 * 3.14 * R; cout << "Area of Circle is " << Area << ";" << endl; cout << "Circumference of Circle is " << Circumference << ";" << endl; - } + } else { - cout << "Negetive numbers cannot be applied !!!"< #include + using namespace std; -int main1() { + +int main() +{ cout << "\t\tC++ program to Calculate Area of Scalene Triangle.\n"; float a, b, c, S, Area; cout << "Please enter the values for the first side of Triangle: "; - cin >> a ; + cin >> a; cout << "Please enter the values for the second side of Triangle: "; cin >> b; cout << "Please enter the values for the third side of Triangle: "; cin >> c; - if (a > 0 && b > 0 && c > 0) - { - if (c < a + b && a < b + c && b < a + c) - { + + if (a > 0 && b > 0 && c > 0) { + if (c < a + b && a < b + c && b < a + c) { S = (a + b + c) / 2; Area = sqrt(S * (S - a) * (S - b) * (S - c)); cout << "The Area of Triangle is " << Area << endl; return 0; } else { - cout << "This triangle is wrong try another values. " << endl; + cout << "This triangle is wrong try another values." << endl; return 0; } } else { - cout << "The sides of Triangle cannot be negative numbers !" << endl; + cout << "The sides of Triangle cannot be negative numbers!" << endl; } + system("pause"); return 0; } \ No newline at end of file diff --git a/OOP1-Lab1/Source2.cpp b/Lab_01/09_equilateral_triangle.cpp similarity index 77% rename from OOP1-Lab1/Source2.cpp rename to Lab_01/09_equilateral_triangle.cpp index a696438..a97069f 100644 --- a/OOP1-Lab1/Source2.cpp +++ b/Lab_01/09_equilateral_triangle.cpp @@ -1,16 +1,17 @@ -//U1910049 Rustam Zokirov -//Section 004 -//Assignment-2(Operators) -//C++ program to Calculate Area of Equilateral Triangle +// C++ program to Calculate Area of Equilateral Triangle. #include #include + using namespace std; -int main2(){ + +int main() +{ cout << "\t\tC++ program to Calculate Area of Equilateral Triangle.\n "; float a, Area; cout << "Please enter the value for the side of Triangle: "; cin >> a; + if (a > 0) { Area = sqrt(2) * a * a * 0.25; cout << "The Area of this triangle is " << Area << ";" << endl; @@ -18,6 +19,7 @@ int main2(){ else { cout << "The sides of Triangle cannot be negative numbers ! " << endl; } + system("pause"); return 0; } \ No newline at end of file diff --git a/OOP1-Lab1/Source3.cpp b/Lab_01/10_right_triangle.cpp similarity index 62% rename from OOP1-Lab1/Source3.cpp rename to Lab_01/10_right_triangle.cpp index 6116d8f..4bde450 100644 --- a/OOP1-Lab1/Source3.cpp +++ b/Lab_01/10_right_triangle.cpp @@ -1,24 +1,26 @@ -//U1910049 Rustam Zokirov -//Section 004 -//Assignment-2(Operators) -//C++ program to Calculate Area of Right angle Triangle +// C++ program to Calculate Area of Right angle Triangle. #include + using namespace std; -int main3() { + +int main() +{ cout << "\t\tC++ program to Calculate Area of Right angle Triangle.\n "; float a, b, Area; - cout << "Please enter the value for the first cathet of Triangle: " ; + cout << "Please enter the value for the first cathet of Triangle: "; cin >> a; - cout << "Please enter the value for the second cathet of Triangle: " ; + cout << "Please enter the value for the second cathet of Triangle: "; cin >> b; - if (a > 0 && b > 0){ + + if (a > 0 && b > 0) { Area = b * a * 0.5; cout << "The Area of this Triangle is " << Area << ";" << endl; } else { - cout << "The sides of Triangle cannot be negative numbers ! "< #include + using namespace std; -int main4() { + +int main() +{ cout << "\t\tC++ program to Calculate Area of Rectangle. " << endl; float a, b, Area; - cout << "Please enter the length of Rectangle: " ; + cout << "Please enter the length of Rectangle: "; cin >> a; cout << "Please enter the width of Rectangle: "; cin >> b; + if (a > 0 && b > 0) { Area = a * b; cout << "The area of Rectangle is " << Area << ";" << endl; } else { - cout << "The sides of Rectangle cannot be negetive numbers !" << endl; + cout << "The sides of Rectangle cannot be negative numbers !" << endl; } + system("pause"); return 0; } \ No newline at end of file diff --git a/OOP1-Lab1/Source5.cpp b/Lab_01/12_square.cpp similarity index 57% rename from OOP1-Lab1/Source5.cpp rename to Lab_01/12_square.cpp index 283f62f..462319f 100644 --- a/OOP1-Lab1/Source5.cpp +++ b/Lab_01/12_square.cpp @@ -1,23 +1,25 @@ -//U1910049 Rustam Zokirov -//Section 004 -//Assignment-2(Operators) -//C++ program to Calculate Area of Square +// C++ program to Calculate Area of Square. #include #include + using namespace std; -int main5() { + +int main() +{ cout << "\t\tC++ program to Calculate Area of Square." << endl; float a, Area; - cout << "Please enter the value for the side of Square: " ; - cin >> a ; - if (a > 0 ) { - Area = a * a ; + cout << "Please enter the value for the side of Square: "; + cin >> a; + + if (a > 0) { + Area = a * a; cout << "The area of Square is " << Area << ";" << endl; } else { cout << "Negetive numbers cannot be applied !!!" << endl; } + system("pause"); return 0; } \ No newline at end of file diff --git a/Lab_01/13_swapping.cpp b/Lab_01/13_swapping.cpp new file mode 100644 index 0000000..76cd3fb --- /dev/null +++ b/Lab_01/13_swapping.cpp @@ -0,0 +1,24 @@ +// Program to show swap of two no's without using third variable. + +#include +using namespace std; + +int main() { + float a, b; + + cout << "Enter first number: "; + cin >> a; + cout << "Enter second number: "; + cin >> b; + + a = a + b; + b = a - b; + a = a - b; + + cout << "We have swapped your numbers, result in below." << endl; + cout << "a = " << a << endl; + cout << "b = " << b << endl; + + system("pause"); + return 0; +} \ No newline at end of file diff --git a/Lab_01/README.md b/Lab_01/README.md new file mode 100644 index 0000000..db51e23 --- /dev/null +++ b/Lab_01/README.md @@ -0,0 +1,17 @@ +# Practical Lab Assignment - Variables/Operators + +1. C++ Program to print "Hello, World!". +2. C++ Program to print an integer entered by the user. +3. C++ Program to Add/Subtract/Multiply/Divide Two Integers. +4. C++ Program to Add/Subtract/Multiply/Divide Two Integers entered by the user. +5. C++ Program to Add/Subtract/Multiply/Divide two Floating Point Numbers. +6. C++ Program to Compute Quotient and Remainder. +7. C++ Program to Calculate the Area and Circumference of a Circle. +8. C++ Program to Calculate the Area of a Scalene Triangle. +9. C++ Program to Calculate the Area of an Equilateral Triangle. +10. C++ Program to Calculate the Area of Right Angle Triangle. +11. C++ Program to Calculate the Area and Perimeter of a Rectangle. +12. C++ Program to Calculate the Area and Perimeter of a Square. +13. C++ Program to Find ASCII Value of a Character. +14. C++ Program to Find the Size of int, float, double, and char. +15. C++ Program to Swap Two Numbers. diff --git a/Lab_02/01_temperature_converter.cpp b/Lab_02/01_temperature_converter.cpp new file mode 100644 index 0000000..76eeda8 --- /dev/null +++ b/Lab_02/01_temperature_converter.cpp @@ -0,0 +1,26 @@ +// C++ program that converts between Celsius and Fahrenheit temperatures based on user input. + +#include + +using namespace std; + +int main() { + float temp; + char unit; + + cout << "Enter the temperature: "; + cin >> temp; + + cout << "Enter the unit (C/F): "; + cin >> unit; + + if (unit == 'C') { + cout << "The temperature in Fahrenheit is " << (temp * 9 / 5) + 32 << "F." << endl; + } else if (unit == 'F') { + cout << "The temperature in Celsius is " << (temp - 32) * 5 / 9 << "C." << endl; + } else { + cout << "Invalid unit." << endl; + } + + return 0; +} \ No newline at end of file diff --git a/Lab_02/02_odd_even.cpp b/Lab_02/02_odd_even.cpp new file mode 100644 index 0000000..5a04183 --- /dev/null +++ b/Lab_02/02_odd_even.cpp @@ -0,0 +1,18 @@ +// Program to find whether given number is even or odd. + +#include +using namespace std; + +int main() { + int a; + cout << "Enter the number: "; + cin >> a; + + if (a % 2 == 0) + cout << "Your number is Even!" << endl; + else + cout << "Your number is Odd!" << endl; + + system("pause"); + return 0; +} \ No newline at end of file diff --git a/Lab_02/03_negative_positive.cpp b/Lab_02/03_negative_positive.cpp new file mode 100644 index 0000000..0bf9966 --- /dev/null +++ b/Lab_02/03_negative_positive.cpp @@ -0,0 +1,23 @@ +// C++ Program to Check Whether a Number is Positive or Negative. + +#include + +using namespace std; + +int main() { + float number; + + cout << "Enter a number: "; + cin >> number; + + if (number > 0) { + cout << "The number is positive." << endl; + } else if (number < 0) { + cout << "The number is negative." << endl; + } else { + cout << "The number is zero." << endl; + } + + system("pause"); + return 0; +} \ No newline at end of file diff --git a/Lab_02/04_vowel_consonant.cpp b/Lab_02/04_vowel_consonant.cpp new file mode 100644 index 0000000..7c2421e --- /dev/null +++ b/Lab_02/04_vowel_consonant.cpp @@ -0,0 +1,22 @@ +// C++ Program to Check Whether a Character is a Vowel or Consonant. + +#include + +using namespace std; + +int main() { + char c; + + cout << "Enter a character: "; + cin >> c; + + if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' || + c == 'A' || c == 'E' || c == 'I' || c == 'O' || c == 'U') { + cout << "The character is a vowel." << endl; + } else { + cout << "The character is a consonant." << endl; + } + + system("pause"); + return 0; +} \ No newline at end of file diff --git a/OOP1-Lab2/Greatestnumber.cpp b/Lab_02/05_largest_number.cpp similarity index 72% rename from OOP1-Lab2/Greatestnumber.cpp rename to Lab_02/05_largest_number.cpp index 9b50e7d..9d285a4 100644 --- a/OOP1-Lab2/Greatestnumber.cpp +++ b/Lab_02/05_largest_number.cpp @@ -1,21 +1,25 @@ -//U1910049 -//Lab assignment #3 -//Program to find greatest in 3 numbers +// Program to find greatest in 3 numbers #include using namespace std; -int main2() { + +int main() +{ float a, b, c; cout << "Enter the 3 numbres: "; cin >> a >> b >> c; + if (a >= b && a >= c) cout << "The greatest number is " << a << ";" << endl; + if (b >= a && b >= c) cout << "The greatest number is " << b << ";" << endl; + if (c >= a && c >= b) cout << "The greatest number is " << c << ";" << endl; - else if(a==b==c) - cout << "All numbers are equal."<< endl; + else if (a == b == c) + cout << "All numbers are equal." << endl; + system("pause"); return 0; } \ No newline at end of file diff --git a/OOP1-Lab2/Leap year.cpp b/Lab_02/06_leap_year.cpp similarity index 62% rename from OOP1-Lab2/Leap year.cpp rename to Lab_02/06_leap_year.cpp index 780d317..7c2b41e 100644 --- a/OOP1-Lab2/Leap year.cpp +++ b/Lab_02/06_leap_year.cpp @@ -1,26 +1,34 @@ -//Program to find that entered year is leap or not. +// Program to find that entered year is leap or not. + #include using namespace std; -int main4() { + +int main() +{ int year; - cout << "Enter a Year: " ; + cout << "Enter a Year: "; cin >> year; + if (year % 4 == 0) { if (year % 100 == 0) { - if (year % 400 == 0) { - cout << "Given " << year << " year is a leap."<< endl ; + if (year % 400 == 0) + { + cout << "Given " << year << " year is a leap." << endl; } - else { + else + { cout << "Given " << year << " year isn't a leap." << endl; } } - else { + else + { cout << "Given " << year << " year is a leap year." << endl; } } - else { + else + { cout << "Given " << year << " year isn't a leap." << endl; } system("pause"); diff --git a/Lab_02/README.md b/Lab_02/README.md new file mode 100644 index 0000000..bbcb38b --- /dev/null +++ b/Lab_02/README.md @@ -0,0 +1,36 @@ +# Practical Lab Assignment - Control Structures - if/else + +1. C++ program that converts between Celsius and Fahrenheit temperatures based on user input. You can also add conversions for Kelvin. +2. C++ Program to Check Whether a Number is Even or Odd. +3. C++ Program to Check Whether a Number is Positive or Negative. +4. C++ Program to Check Whether a Character is a Vowel or Consonant. +5. C++ Program to find the Largest Number Among Three Numbers. +6. C++ Program to find if the entered year is a leap year or not. +7. C++ program that allows the user to perform basic arithmetic operations (addition, subtraction, multiplication, division) on two numbers. You can also add error handling for division by zero. +8. BMI Calculator: Create a program that calculates a person's Body Mass Index (BMI) based on their weight and height input. Provide a classification of whether the person is underweight, normal weight, overweight, or obese. Use cin, cout. + Formula: bmi = weight / (height * height) + + | bmi < 18.5 | Underweight | + | --- | --- | + | bmi < 24.9 | Normal Weight | + | bmi < 29.9 | Overweight | + | Otherwise | Obese | +9. Nested condition + - Get the `age` and `membership_status` as user input. `membership_status` can be only `Y` or `y`. So, if the age is bigger or equal to 18 and if the user is a member of our shop, we provide a 10% discount, else we charge fully. + - Write a simple chatbot program using nested conditions. +10. Write a program to calculate taxes, with the following conditions: + - If the salary is less than $1500, then there are no taxes + - If the salary is from 1501 to 3000 $ (1501<= salary < 3000) then the tax should be 10% + - If the salary is from 3001 to 5000 $ (3001 <= salary < 5000) then the tax should be 20% + - If the salary is above $5000, then the tax should be 30% + + **Hint: Formula for finding tax (salary * percentage) / 100** + + You must output: + - Tax percentage + - Salary after taxes +11. Switch + - Program to use `switch` statement. Display Monday to Sunday. + - Program to display arithmetic operator using switch case. +12. C++ Program to Find all Roots of a Quadratic equation. +13. C++ Program to Check Whether a Character is an Alphabet or not. diff --git a/OOP1-Lab3/Digits.cpp b/Lab_03/Digits.cpp similarity index 100% rename from OOP1-Lab3/Digits.cpp rename to Lab_03/Digits.cpp diff --git a/OOP1-Lab3/Fibonacci.cpp b/Lab_03/Fibonacci.cpp similarity index 100% rename from OOP1-Lab3/Fibonacci.cpp rename to Lab_03/Fibonacci.cpp diff --git a/OOP1-Lab3/Operators.cpp b/Lab_03/Operators.cpp similarity index 100% rename from OOP1-Lab3/Operators.cpp rename to Lab_03/Operators.cpp diff --git a/OOP1-Lab3/Prime.cpp b/Lab_03/Prime.cpp similarity index 100% rename from OOP1-Lab3/Prime.cpp rename to Lab_03/Prime.cpp diff --git a/Lab_03/README.md b/Lab_03/README.md new file mode 100644 index 0000000..62940ce --- /dev/null +++ b/Lab_03/README.md @@ -0,0 +1,13 @@ +# Practical Lab Assignment - Control Structures - Loop/Switch + +1. Program to calculate sum of numbers from m to n. + - Hint: Input two numbers m and n. Find sum of all numbers from m to n. For example m=3 and n=8 then sum will be 3 + 4 + 5 + 6 + 7 + 8 = 33. +2. Program to print Fibonacci series up to 100. + - Hint: Fibonacci Series is 1, 1, 2, 3, 5, 8, 13, 21, .... +3. Program to input a number and then calculate sum of its digits. + - Hint: let number = 562. Then you should print 5 + 6 + 2 = 13. +4. Program to find whether given number is a prime number or not. +5. Program to display sum of series 1 + 1/2 + 1/3 + ... + 1/n. +6. Program to display series and find sum of 1 + 3 + 5 + ... + n. +7. Program to use switch statement. Display Monday to Sunday. +8. Program to display arithmetic operator using switch case \ No newline at end of file diff --git a/OOP1-Lab3/Sum1.cpp b/Lab_03/Sum1.cpp similarity index 100% rename from OOP1-Lab3/Sum1.cpp rename to Lab_03/Sum1.cpp diff --git a/OOP1-Lab3/Sum2.cpp b/Lab_03/Sum2.cpp similarity index 100% rename from OOP1-Lab3/Sum2.cpp rename to Lab_03/Sum2.cpp diff --git a/OOP1-Lab3/Weekdays.cpp b/Lab_03/Weekdays.cpp similarity index 100% rename from OOP1-Lab3/Weekdays.cpp rename to Lab_03/Weekdays.cpp diff --git a/OOP1-Lab3/mn.cpp b/Lab_03/mn.cpp similarity index 100% rename from OOP1-Lab3/mn.cpp rename to Lab_03/mn.cpp diff --git a/Lab_04/README.md b/Lab_04/README.md new file mode 100644 index 0000000..351329d --- /dev/null +++ b/Lab_04/README.md @@ -0,0 +1,38 @@ +# Practical Lab Assignment - Control Structure - Nested Loop + +1. Program to print stars Sequence1. + ``` + * + ** + *** + **** + ***** + ``` +2. Program to print stars Sequence2. + ``` + * + ** + *** + **** + ***** + ``` +3. Program to print star Sequences3. + ``` + * + *** + ***** + ``` +4. Program to print Sequence4. + ``` + * + ** + *** + **** + ***** + ***** + **** + *** + ** + * + ``` +5. Write a program to add first seven terms of the following series using for loop: `1/!1+ 2/!2 + 3/!3 + ...` \ No newline at end of file diff --git a/Lab_04/Source.cpp b/Lab_04/Source.cpp new file mode 100644 index 0000000..4b0092b --- /dev/null +++ b/Lab_04/Source.cpp @@ -0,0 +1,19 @@ +// Lab assignment #5 +// ID:U1910049; Name: Zokirov Rustam +// Control structure - Nested Loop + +#include +using namespace std; +int main() +{ + for (int i = 1; i <= 5; i++) + { + for (int j = 1; j <= i; j++) + { + cout << "*"; + } + cout << endl; + } + system("pause"); + return 0; +} \ No newline at end of file diff --git a/Lab_04/Source1.cpp b/Lab_04/Source1.cpp new file mode 100644 index 0000000..b027509 --- /dev/null +++ b/Lab_04/Source1.cpp @@ -0,0 +1,22 @@ +// Lab assignment #5 +// ID:U1910049; Name:Zokirov Rustam +// Control structure - Nested Loop + +#include +using namespace std; +int main2() +{ + for (int i = 1; i <= 5; i++) + { + for (int j = 5; j >= 1; j--) + { + if (i >= j) + cout << "*"; + else + cout << " "; + } + cout << endl; + } + system("pause"); + return 0; +} \ No newline at end of file diff --git a/Lab_04/Source2.cpp b/Lab_04/Source2.cpp new file mode 100644 index 0000000..eee2058 --- /dev/null +++ b/Lab_04/Source2.cpp @@ -0,0 +1,24 @@ +// Lab assignment #5 +// ID:U1910049; Name:Zokirov Rustam +// Control structure - Nested Loop + +#include +using namespace std; +int main3() +{ + for (int i = 1; i <= 5; i += 2) + { + for (int j = 3; j >= i; j -= 2) + { + cout << " "; + } + + for (int j = 1; j <= i; j++) + { + cout << "*"; + } + cout << endl; + } + system("pause"); + return 0; +} \ No newline at end of file diff --git a/Lab_04/Source3.cpp b/Lab_04/Source3.cpp new file mode 100644 index 0000000..4300bc7 --- /dev/null +++ b/Lab_04/Source3.cpp @@ -0,0 +1,27 @@ +// Lab assignment #5 +// ID:U1910049; Name:Zokirov Rustam +// Control structure - Nested Loop + +#include +using namespace std; +int main4() +{ + for (int i = 1; i <= 5; i++) + { + for (int j = 1; j <= i; j++) + { + cout << "*"; + } + cout << endl; + } + for (int i = 1; i <= 5; i++) + { + for (int j = 5; j >= i; j--) + { + cout << "*"; + } + cout << endl; + } + system("pause"); + return 0; +} \ No newline at end of file diff --git a/Lab_04/Source4.cpp b/Lab_04/Source4.cpp new file mode 100644 index 0000000..a93f326 --- /dev/null +++ b/Lab_04/Source4.cpp @@ -0,0 +1,18 @@ +// Lab assignment #5 +// ID:U1910049; Name: Zokirov Rustam +// A program to add first seven terms of the following series using for loop:1 / !1 + 2 / !2 + 3 / !3 + ... + +#include +using namespace std; +int main5() +{ + float sum = 0, fact = 1; + for (int i = 1; i <= 7; i++) + { + fact = fact * i; + sum += i / fact; + } + cout << "Sum is : " << sum << endl; + system("pause"); + return 0; +} \ No newline at end of file diff --git a/Lab_05/README.md b/Lab_05/README.md new file mode 100644 index 0000000..8a33ee6 --- /dev/null +++ b/Lab_05/README.md @@ -0,0 +1,6 @@ +# Practical Lab Assignment + +1. Write a program to calculate area of a circle using functions. +2. Write a program to swap two values using functions. +3. Write a program to convert time to minutes using functions. (input 3 variables namely hours, minutes and seconds. Convert everything into minutes.) +4. Write a program to sum the series up to n (Input n) \ No newline at end of file diff --git a/Lab_05/Source.cpp b/Lab_05/Source.cpp new file mode 100644 index 0000000..2f54011 --- /dev/null +++ b/Lab_05/Source.cpp @@ -0,0 +1,29 @@ +// Practical Lab Assignment-7(Week 9) +// ID:U1910049 Name: Rustam Zokirov +// Program to calculate area of a circle using functions + +#include +#include //C++ libriry which is including "pow" and PI=3.14 +using namespace std; + +float area(float radius) +{ // function for calculating the area + float area; + area = (atan(1) * 4) * (pow(radius, 2)); //"atan" is the function which is finding the PI=3.14 + return area; +} // end function "area" + +int main1() +{ + float radius; + cout << "Please enter the radius of circle: "; + cin >> radius; // inputing the radius + + if (radius > 0) + cout << area(radius) << endl; // calling the function "area" for calculating the Area of Circle + + else + cout << "INVALID Radius!" << endl; // if radius is a negative number or equal to zero the program will show "Invalid radius" + system("pause"); + return 0; +} \ No newline at end of file diff --git a/Lab_05/Source1.cpp b/Lab_05/Source1.cpp new file mode 100644 index 0000000..34c9a9e --- /dev/null +++ b/Lab_05/Source1.cpp @@ -0,0 +1,18 @@ +// Practical Lab Assignment-7(Week 9) +// ID:U1910049 Name: Rustam Zokirov +// Program to swap two values using functions + +#include +#include //C++ libriry which is calculating "pow" and PI=3.14 +using namespace std; + +int main2() +{ + int a, b; + cout << "Enter two numbers: "; + cin >> a >> b; + swap(a, b); // C++ function to swap two numbers + cout << a << " & " << b << endl; // swap is the function which is contained in c++ ==> + //==> there is no need to open new function to swap + return 0; +} // ending the function main \ No newline at end of file diff --git a/Lab_05/Source2.cpp b/Lab_05/Source2.cpp new file mode 100644 index 0000000..cbe76ff --- /dev/null +++ b/Lab_05/Source2.cpp @@ -0,0 +1,27 @@ +// Practical Lab Assignment-7(Week 9) +// ID:U1910049 Name: Rustam Zokirov +// Program to convert into minutes + +#include +using namespace std; + +double converting1(double hours, double minutes, double seconds) +{ // initializing the variables + return (hours * 60) + (minutes) + (seconds / 60); // returning the function "converting" +} + +int main3() +{ + double hours, minutes, seconds; + cout << "Hours: "; + cin >> hours; // Prompting user for data and + cout << "Minutes: "; // reading 3 numbers for user + cin >> minutes; //! + cout << "Seconds: "; + cin >> seconds; + if (hours >= 0 && minutes >= 0 && seconds >= 0) // the program will be executed when all numbers are positive + cout << "The time in minutes is " << converting1(hours, minutes, seconds) << endl; + else // calling function to calculate the main function + cout << "Invalid inputs!" << endl; + return 0; // indicates that the program will ended successfully +} \ No newline at end of file diff --git a/Lab_05/Source3.cpp b/Lab_05/Source3.cpp new file mode 100644 index 0000000..0f007cb --- /dev/null +++ b/Lab_05/Source3.cpp @@ -0,0 +1,32 @@ +// Practical Lab Assignment-7(Week 9) +// ID:U1910049 Name: Rustam Zokirov +// Program to sum the series up to n + +#include +#include +using namespace std; + +double qwerty(double n, double sum, double fact) +{ + for (int i = 1; i <= n; i++) + { + fact = fact * i; // calculating the factorial of the numbers + sum += (pow(i, i) / (fact)); // executing the sum of numbers + } //"pow" is raising 'i' to power 'i' + return sum; // +} // end function qwerty + +int main() +{ + double n; + double sum = 0; + double fact = 1; + cout << "Please ebter the number: "; // outputing and inputing the number + cin >> n; + if (n > 0) // the program will calculate the sum when numbers is positive + cout << "Sum is: " << qwerty(n, sum, fact) << endl; // calling the function qwerty + else // when the number is negative 'else' will work + cout << "INVALID INPUT!" << endl; + system("pause"); + return 0; +} // ending the program successfully \ No newline at end of file diff --git a/Lab_06/README.md b/Lab_06/README.md new file mode 100644 index 0000000..e9b4c37 --- /dev/null +++ b/Lab_06/README.md @@ -0,0 +1,22 @@ +# Practical Lab Assignment + +``` +1. Write a program to calculate area of following figures using function overloading: +Circle +Rectangle +Triangle +Square +(Hint: 1. create 4 functions with same name area. 2. Each function to calculate area of one figure.) + +2. Write a program to calculate circumference of the following figures using function overloading: +Circle +Rectangle +Triangle +Square + +3. Write a program using function overloading: +To find largest among three integers. +To find largest among three floating point numbers. + +4. Convert function template for problem 3. +``` \ No newline at end of file diff --git a/Lab_06/Source.cpp b/Lab_06/Source.cpp new file mode 100644 index 0000000..374947f --- /dev/null +++ b/Lab_06/Source.cpp @@ -0,0 +1,485 @@ +#include +#include +#include +#include +using namespace std; + +void first() +{ + // when the case 1 in the main menu + for (int l = 0; l < 120; l++) + { + cout << "="; + } + cout << endl; + cout << "\t\t\t\t***Area of Geometrical figures.***\n"; + for (int l = 0; l < 120; l++) + { + cout << "="; + } + cout << endl; + cout << " [1] Circle" << endl; + cout << " [2] Rectangle" << endl; + cout << " [3] Triangle" << endl; + cout << " [4] Square" << endl; + cout << " [5] EXIT to MAIN MENU" << endl; + cout << endl; +} + +void second() +{ + // when the case 2 in the main menu + for (int l = 0; l < 120; l++) + { + cout << "="; + } + cout << endl; + cout << "\t\t\t\t***Circumference of Geometrical figures.***\n"; + for (int l = 0; l < 120; l++) + { + cout << "="; + } + cout << endl; + cout << " [1] Circle" << endl; + cout << " [2] Rectangle" << endl; + cout << " [3] Triangle" << endl; + cout << " [4] Square" << endl; + cout << " [5] EXIT to MAIN MENU" << endl; + cout << endl; +} + +void third() +{ + // when the case 3 in the main menu + for (int l = 0; l < 120; l++) + { + cout << "="; + } + cout << endl; + cout << "\t\t\t\t***Find the Largest number among 3 numbers.***\n"; + for (int l = 0; l < 120; l++) + { + cout << "="; + } + cout << endl; +} + +/////Overloading functions for the Finding AREA///// +double area(double radius) +{ // overloading function for finding the area of circle + double area1; + double input_radius; + area1 = 3.141592653589793238463 * pow(radius, 2); + cout << "The area of Circle: " << area1 << endl; + cout << endl; + return area1; +} + +double area(double sideA, double sideB) +{ // overloading function for finding the area of rectengle + double area2; + area2 = sideA * sideB; + cout << "The area of Rectangle: " << area2 << endl; + cout << endl; + return area2; +} + +double area(double sidetriangleA, double sidetriangleB, double sidetriangleC) +{ // overloading function for finding the area of triangle + double area3, S; + S = (sidetriangleA + sidetriangleB + sidetriangleC) / 2; + area3 = sqrt(S * (S - sidetriangleA) * (S - sidetriangleB) * (S - sidetriangleC)); + cout << "The area of triangle: " << area3 << endl; + cout << endl; + return area3; +} + +float area(float sidesquare) ////overloading function for finding the area of square +{ + float area4; + area4 = pow(sidesquare, 2); + cout << "The area of square: " << area4 << endl; + cout << endl; + return area4; +} + +//////Overloading functions for finding CIRCUMFERENCE/////// +double circumference(double radius) +{ + double circumference1; + double input_radius; + circumference1 = 2 * 3.141592653589793238463 * radius; + cout << "The circumference of Circle: " << circumference1 << endl; + cout << endl; + return circumference1; +} + +double circumference(double sideA, double sideB) +{ + double circumference2; + circumference2 = 2 * (sideA + sideB); + cout << "The circumference of Rectangle: " << circumference2 << endl; + cout << endl; + return circumference2; +} + +double circumference(double sidetriangleA, double sidetriangleB, double sidetriangleC) +{ + double circumference3; + circumference3 = sidetriangleA + sidetriangleB + sidetriangleC; + cout << "The circumference of triangle: " << circumference3 << endl; + cout << endl; + return circumference3; +} + +float circumference(float sidesquare) +{ + float circumference4; + circumference4 = 4 * sidesquare; + cout << "The circumference of square: " << circumference4 << endl; + cout << endl; + return circumference4; +} + +// Overloading function for inputing 3 in the main menu +int findlargest(int n1, int n2, int n3) +{ + + if (n1 >= n2 && n1 >= n3) + { + cout << "Largest number: " << n1 << endl; + } + if (n2 >= n1 && n2 >= n3) + { + cout << "Largest number: " << n2 << endl; + } + if (n3 >= n1 && n3 >= n2) + { + cout << "Largest number: " << n3 << endl; + } + + return n1, n2, n3; +} + +double findlargest(double n1, double n2, double n3) +{ + + if (n1 >= n2 && n1 >= n3) + { + cout << "Largest number: " << n1 << endl; + } + if (n2 >= n1 && n2 >= n3) + { + cout << "Largest number: " << n2 << endl; + } + if (n3 >= n1 && n3 >= n2) + { + cout << "Largest number: " << n3 << endl; + } + else if (n1 == n2 == n3) + cout << "Largest number : " << n3 << endl; + return n1, n2, n3; +} + +// overloading function with templates +template +T Large(T n1, T n2, T n3) +{ + if (n1 >= n2 && n1 >= n3) + { + cout << "Largest number: " << n1 << endl; + } + if (n2 >= n1 && n2 >= n3) + { + cout << "Largest number: " << n2 << endl; + } + if (n3 >= n1 && n3 >= n2) + { + cout << "Largest number: " << n3 << endl; + } + else if (n1 == n2 == n3) + cout << "Largest number : " << n3 << endl; + + return n1, n2, n3; +} + +/////////////////////////////////////***STARTING POINT***//////////////////////////////////////////////////// +int main() +{ + system("color 3E"); + int numberforoperation = 0; + double radius1; + double sideA, sideB; + double sidetriangleA, sidetriangleB, sidetriangleC; + float sidesquare; + double n1, n2, n3; + + for (int l = 0; l < 120; l++) + { + cout << "="; + } + cout << endl; + cout << "\t\t\t\t\tHello! Welcome to the main menu.\n"; + cout << "\t\t WARNING!!! Enter only numbers!!! And the 'y/n' when you will be asked!\n"; + for (int l = 0; l < 120; l++) + { + cout << "="; + } + cout << endl; + cout << "\t[1] Area of Geometrical Figures.\n"; + cout << "\t[2] Circumference of geometrical figures.\n"; + cout << "\t[3] Find the largest number.\n"; + cout << "\t[4] finding the largest number with function template.\n"; + cout << "\t[5] EXIT\n"; + cout << endl; +b: + cout << " Please enter the number of operation you would like to execute: "; + cin >> numberforoperation; + if (numberforoperation > 0 && numberforoperation < 6) + { + system("cls"); + switch (numberforoperation) + { + case 1: // first11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 + first(); + int firstfirst; + f: + cout << " Choose one figure: "; + cin >> firstfirst; + if (firstfirst > 0 && firstfirst < 6) + { + system("cls"); // ends the main menu + switch (firstfirst) // firstfirst + { + system("cls"); // ends the main menu + case 1: + cout << "\t\t\t\t***CIRCLE***\n"; + a: + cout << "Enter the radius of the circle: "; + cin >> radius1; + if (radius1 > 0) + { + area(radius1); + first(); + goto f; + } + else + goto a; + break; + + case 2: + cout << "\t\t\t\t***RECTANGLE***\n"; + c: + cout << "Enter the height of rectangle: "; + cin >> sideA; + cout << "Enter the width of the rectangle: "; + cin >> sideB; + cout << endl; + if (sideA > 0 && sideB > 0) + { + area(sideA, sideB); + + first(); + goto f; + } + else + goto c; + break; + case 3: + cout << "\t\t\t\t***TRIANGLE***" << endl; + d: + cout << "Enter the first side of the triangle: "; + cin >> sidetriangleA; + cout << "Enter the second side of the triangle: "; + cin >> sidetriangleB; + cout << "Enter the third side of the triangle: "; + cin >> sidetriangleC; + cout << endl; + if (sidetriangleA > 0 && sidetriangleB > 0 && sidetriangleC > 0 && sidetriangleC < sidetriangleA + sidetriangleB && sidetriangleA < sidetriangleB + sidetriangleC && sidetriangleB < sidetriangleC + sidetriangleA) + { + area(sidetriangleA, sidetriangleB, sidetriangleC); + + first(); + goto f; + } + else + goto d; + break; + case 4: + cout << "\t\t\t\t***Square***" << endl; + e: + cout << "Enter the side of square: "; + cin >> sidesquare; + if (sidesquare > 0) + { + area(sidesquare); + + first(); + goto f; + } + else + goto e; + break; + case 5: + { + main(); + break; + } + default: + break; + } + break; + } + else + goto f; + break; + + case 2: // second2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 + second(); + int secondsecond; + g: + cout << " Choose one figure: "; + cin >> secondsecond; + if (secondsecond > 0 && secondsecond < 6) + { + system("cls"); // ends the main menu + switch (secondsecond) // firstfirst + { + system("cls"); // ends the main menu + case 1: + cout << "\t\t\t\t***CIRCLE***\n"; + h: + cout << "Enter the radius of the circle: "; + cin >> radius1; + if (radius1 > 0) + { + circumference(radius1); + second(); + goto g; + } + else + goto h; + break; + + case 2: + cout << "\t\t\t\t***RECTANGLE***\n"; + j: + cout << "Enter the height of rectangle: "; + cin >> sideA; + cout << "Enter the width of the rectangle: "; + cin >> sideB; + cout << endl; + if (sideA > 0 && sideB > 0) + { + circumference(sideA, sideB); + second(); + goto g; + } + else + goto j; + break; + case 3: + cout << "\t\t\t\t***TRIANGLE***" << endl; + d1: + cout << "Enter the first side of the triangle: "; + cin >> sidetriangleA; + cout << "Enter the second side of the triangle: "; + cin >> sidetriangleB; + cout << "Enter the third side of the triangle: "; + cin >> sidetriangleC; + cout << endl; + if (sidetriangleA > 0 && sidetriangleB > 0 && sidetriangleC > 0 && sidetriangleC < sidetriangleA + sidetriangleB && sidetriangleA < sidetriangleB + sidetriangleC && sidetriangleB < sidetriangleC + sidetriangleA) + { + circumference(sidetriangleA, sidetriangleB, sidetriangleC); + second(); + goto g; + } + else + goto d1; + break; + + case 4: + cout << "\t\t\t\t***Square***" << endl; + e1: + cout << "Enter the side of square: "; + cin >> sidesquare; + if (sidesquare > 0) + { + circumference(sidesquare); + second(); + goto g; + } + else + goto e1; + break; + case 5: + main(); + break; + default: + break; + } + break; + } + else + goto g; + break; + /////////////////////////////////////////////////////////////////////////////////////////////////////////// + case 3: // third333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333 + third(); + cout << "\t\t\tPlease enter 3 numbers to compare.\n\t\t\tYou can write even an integer or decimal number. For example: 123, 12.123, 0,123 \n"; + x: + cout << endl; + cout << "Enter the first number: "; + cin >> n1; + cout << "Enter the second number: "; + cin >> n2; + cout << "Enter the third number: "; + cin >> n3; + findlargest(n1, n2, n3); + char quit; + cout << "Do you want to try again(y/n)? "; + if (cin >> quit && quit == 'y') // when user will input 'y' the code will again ask you to input a 3 numbers + goto x; // when it will be 'n' the code will go to the main menu + else + { + system("cls"); + main(); + } + break; + + ///////////////////////////////////////////////////////////////////////////////////////////////////////////// + case 4: // four4444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444 + third(); + cout << "\t\t\tPlease enter 3 numbers to compare.\n\t\t\tYou can write even an integer or decimal number. For example: 123, 12.123, 0,123 \n"; + qw: + cout << endl; + cout << "Enter the first number: "; + cin >> n1; + cout << "Enter the second number: "; + cin >> n2; + cout << "Enter the third number: "; + cin >> n3; + findlargest(n1, n2, n3); + char quit2; + cout << "Do you want to try again(y/n)? "; // when user will input 'y' the code will again ask you to input a 3 numbers + if (cin >> quit2 && quit2 == 'y') // when it will be 'n' the code will go to the main menu + goto qw; + else + { + system("cls"); + main(); + } + break; // breaking the case 4 of the main menu + default: + break; // breaking the default + } + } + else + goto b; + system("pause"); + return 0; +} + +// bad practices with goto +// never use it next time +// Rustam_Z diff --git a/Lab_07/README.md b/Lab_07/README.md new file mode 100644 index 0000000..43f5d15 --- /dev/null +++ b/Lab_07/README.md @@ -0,0 +1,6 @@ +# Practical Lab Assignment + +1. Calculate the x^y (power) using recursion. +2. Find sum of natural numbers using recursion. +3. Display Fibonacci Series Using Recursion. +4. Find G.C.D for two integers using recursion. \ No newline at end of file diff --git a/Lab_07/fibonacci.cpp b/Lab_07/fibonacci.cpp new file mode 100644 index 0000000..78ebca3 --- /dev/null +++ b/Lab_07/fibonacci.cpp @@ -0,0 +1,28 @@ +#include + +using namespace std; + +int fibonacci(int num) +{ // new function 'fibonacci' for calculating fibonacci series + if (num <= 1) + { + return num; + } + else + { + return (fibonacci(num - 1) + fibonacci(num - 2)); + } +} +int main() +{ + cout << "\t\t\t***Program to calculate the sum of natural numbers using recursion***" << endl; + cout << "Enter how many numbers would you like to output : "; + int num; + cin >> num; + cout << "Fibonnaci Series: "; // inputing the quantity of numbers + for (int i = 0; i < num; i++) // for loop for displaying series + cout << " " << fibonacci(i); // calling function + cout << endl; + system("pause"); + return 0; +} \ No newline at end of file diff --git a/Lab_07/gcd.cpp b/Lab_07/gcd.cpp new file mode 100644 index 0000000..8535f78 --- /dev/null +++ b/Lab_07/gcd.cpp @@ -0,0 +1,25 @@ +#include + +using namespace std; + +int gcd(int x, int y) +{ + if (x == 0 || y == 0) + return y, x; // will input non-zero number when even one number input in zero + if (x == y) + return x; // will return first number when both of the numbers are equal + if (x > y) + return gcd(x - y, y); // when first number is greater than second + if (y > x) + return gcd(x, y - x); // when second number is greater than first +} + +int main4() +{ + cout << "\t\t\t***Program to calculate the G.C.D for two integers using recursion.***" << endl; + cout << "Please enter two integers: " << endl; + int x, y; + cin >> x >> y; + cout << "The G.C.D of " << x << "and " << y << " is " << gcd(x, y); // calling function in the main function + return 0; +} \ No newline at end of file diff --git a/Lab_07/power.cpp b/Lab_07/power.cpp new file mode 100644 index 0000000..d3a9bf1 --- /dev/null +++ b/Lab_07/power.cpp @@ -0,0 +1,24 @@ +#include +#include + +using namespace std; + +long long int power(long long int x, long long int y) +{ + if (y == 0) + return 1; + else + return x * power(x, y - 1); +} + +int main1() +{ + cout << "\t\t\t***Program to calculate the x^y using recursion***" << endl; + int x, y; + cout << "Please enter the numbers x^y: "; + cin >> x >> y; // inpuing the interval of the numbers + cout << "Result: " << power(x, y); // calling function 'power' + cout << endl; + system("pause"); + return 0; +} \ No newline at end of file diff --git a/Lab_07/sum.cpp b/Lab_07/sum.cpp new file mode 100644 index 0000000..619dd91 --- /dev/null +++ b/Lab_07/sum.cpp @@ -0,0 +1,21 @@ +#include + +using namespace std; + +long long int sum(long long int n) +{ // fuction called 'sum' foe calculating the sum of the natural numbers + if (n == 0) + return 0; // will return '0' when number will come to 0 + else + return n + sum(n - 1); // using recursion +} + +int main2() +{ + cout << "\t\t\t***Program to calculate the sum of natural numbers using recursion***" << endl; + int num; + cout << "Please enter the interval: "; + cin >> num; // inpuing the interval of the numbers + cout << "The sum is : " << sum(num); // calling function 'sum' + return 0; +} \ No newline at end of file diff --git a/Lab_08/README.md b/Lab_08/README.md new file mode 100644 index 0000000..e4eb6fa --- /dev/null +++ b/Lab_08/README.md @@ -0,0 +1,12 @@ +# Practical Lab Assignment - Arrays + +1. Write a program to display an array. +2. Write a program to find average of array elements. +3. Write a program to merge to sorted arrays. + ``` + a1[10] = [25, 27, 32, 98] + a2[10] = [12, 23, 28, 51, 72, 85, 97] + then a3[20] should be equal to = [12, 23, 25, 27, 28, 32, 51, 72, 85, 97, 98] + ``` +4. Write a program to insert an element to an array. +5. Write a program to delete an element from an array. \ No newline at end of file diff --git a/OOP1-Lab8/Sort.cpp b/Lab_08/Sort.cpp similarity index 60% rename from OOP1-Lab8/Sort.cpp rename to Lab_08/Sort.cpp index 54f1f58..7d7d2f7 100644 --- a/OOP1-Lab8/Sort.cpp +++ b/Lab_08/Sort.cpp @@ -1,11 +1,12 @@ #include using namespace std; -//function for merging two arrays into third array +// function for merging two arrays into third array + void merging(int arr1[], int arr2[], int arr3[]) { - int i=0, j=0, k=0; - for (i = 0;i < 5 && j < 5;) - {//compearing first array elements with second + int i = 0, j = 0, k = 0; + for (i = 0; i < 5 && j < 5;) + { // comparing first array elements with second if (arr1[i] < arr2[j]) { arr3[k] = arr1[i]; @@ -20,37 +21,38 @@ void merging(int arr1[], int arr2[], int arr3[]) } } while (i < 5) - {//compearing for other elements of first and third arrays + { // comparing for other elements of first and third arrays arr3[k] = arr1[i]; k++; i++; } while (j < 5) - {//compearing for other elements of second and third arrays + { // comparing for other elements of second and third arrays arr3[k] = arr2[j]; k++; j++; } } + int main() { - + int arr1[5], arr2[5]; int arr3[10]; int i; cout << "Input the elements for the first Array: "; - for (i = 0; i < 5;i++) + for (i = 0; i < 5; i++) { cin >> arr1[i]; } cout << "Input the elements for the second Array: "; - for (i = 0;i < 5;i++) + for (i = 0; i < 5; i++) { cin >> arr2[i]; } - merging(arr1, arr2, arr3);//calling function merging + merging(arr1, arr2, arr3); // calling function merging cout << "Sorted Elements: "; - for (i = 0;i < 10;i++) + for (i = 0; i < 10; i++) { cout << arr3[i] << " "; } diff --git a/OOP1-Lab8/average.cpp b/Lab_08/average.cpp similarity index 62% rename from OOP1-Lab8/average.cpp rename to Lab_08/average.cpp index 78c850d..baf4f37 100644 --- a/OOP1-Lab8/average.cpp +++ b/Lab_08/average.cpp @@ -1,21 +1,25 @@ #include using namespace std; -int main2() { + +int main() +{ int a[10]; - //inputing the arrays + // input the arrays cout << "Input an Array Elements. " << endl; - for (int i = 0; i < 10; i++) { + for (int i = 0; i < 10; i++) + { cout << "array element [ " << i << " ] "; cin >> a[i]; - } + } cout << endl; - double sum=0; - //sum the elements of the array - for (int i=0;i<10;i++) { + double sum = 0; + // sum the elements of the array + for (int i = 0; i < 10; i++) + { sum += a[i]; } double average; - //finding the elements of the array + // finding the elements of the array average = sum / 10; cout << "Average of array elements: " << average << endl; system("pause"); diff --git a/Lab_08/deleting.cpp b/Lab_08/deleting.cpp new file mode 100644 index 0000000..89ad759 --- /dev/null +++ b/Lab_08/deleting.cpp @@ -0,0 +1,34 @@ +#include +using namespace std; + +int main() +{ + int a[10]; + int n = 10; + cout << "Input numbers for into arrays." << endl; + for (int i = 0; i < n; i++) + { + cout << "a[" << i << "] = "; // input array + cin >> a[i]; + } + int value; + int position; + cout << "Enter value which you want to delete: "; + cin >> value; + for (int i = 0; i < n; i++) + { // finding the position + if (value == a[i]) + position = i; + } + for (int i = position; i < n; i++) + { // incrementing the array elements into 1 + a[i] = a[i + 1]; + } + n = n - 1; + for (int i = 0; i < n; i++) + { + cout << "a[" << i << "] =" << a[i] << endl; // output arrays with correct order + } + a[9] = 0; + return 0; +} \ No newline at end of file diff --git a/OOP1-Lab8/display.cpp b/Lab_08/display.cpp similarity index 66% rename from OOP1-Lab8/display.cpp rename to Lab_08/display.cpp index 459f65f..67dd942 100644 --- a/OOP1-Lab8/display.cpp +++ b/Lab_08/display.cpp @@ -1,17 +1,21 @@ #include using namespace std; -int main1() { + +int main() +{ int a[10]; - //code for the inputing the elements of the array + // code for the input the elements of the array cout << "Input an Array Elements. " << endl; - for (int i = 0; i < 10;i++) { + for (int i = 0; i < 10; i++) + { cout << "array element [ " << i << " ] "; cin >> a[i]; } cout << endl; - //outputing arrays + // output tje arrays cout << "Displaying arrays: " << endl; - for (int i = 0; i < 5;i++) { + for (int i = 0; i < 5; i++) + { cout << "a[ " << i << " ] = " << a[i] << endl; } diff --git a/OOP1-Lab8/inserting.cpp b/Lab_08/inserting.cpp similarity index 65% rename from OOP1-Lab8/inserting.cpp rename to Lab_08/inserting.cpp index 99b6a45..8f87695 100644 --- a/OOP1-Lab8/inserting.cpp +++ b/Lab_08/inserting.cpp @@ -1,27 +1,28 @@ -#include +#include using namespace std; -int main8() + +int main() { int a[15], value, i, pos; int size = 10; cout << "Enter array elements: "; - for (i = 0; i < 10; i++)//inputing the array elements + for (i = 0; i < 10; i++) // input the array elements { cout << "a[ " << i << " ] = "; cin >> a[i]; } - //code for asking the value and the position to be inserted + // code for asking the value and the position to be inserted cout << "Enter element to be insert : "; cin >> value; cout << "At which position: "; cin >> pos; - //changing the place of arrays + // changing the place of arrays for (i = 10; i > pos; i--) { a[i] = a[i - 1]; } a[pos] = value; - //outputing correct araays order + // outputing correct araays order for (i = 0; i < size + 1; i++) { cout << a[i] << " "; diff --git a/OOP1-Lab9/Pascal.cpp b/Lab_09/Pascal.cpp similarity index 74% rename from OOP1-Lab9/Pascal.cpp rename to Lab_09/Pascal.cpp index 04e231f..d39f45f 100644 --- a/OOP1-Lab9/Pascal.cpp +++ b/Lab_09/Pascal.cpp @@ -1,25 +1,23 @@ #include using namespace std; + int main() { cout << "\t\t\tPalcal's Triangle\n"; int a[7][7] = {}; - int row=0, col=0; - for(int row=0; row<7;row++) + int row = 0, col = 0; + for (int row = 0; row < 7; row++) { for (int col = 0; col < row; col++) { a[0][0] = 1; a[row + 1][1] = 1; - - - cout << a[row][col]; - + + cout << a[row][col]; } cout << endl; } - system("pause"); return 0; } \ No newline at end of file diff --git a/Lab_09/Pascal2.cpp b/Lab_09/Pascal2.cpp new file mode 100644 index 0000000..5c792e3 --- /dev/null +++ b/Lab_09/Pascal2.cpp @@ -0,0 +1,31 @@ +#include +using namespace std; +int main1() +{ + cout << "\t\t\tPascal's triangle\n"; + int row = 0, col = 0; + int a[7][7] = {}; + a[0][0] = 1; // giving the value for the array with address a[0][0] + for (row = 0; row < 7; row++) // rows + { + for (col = 0; col <= row; col++) // columns + { + // code for the borders of the triangle + // giving to then the value 1 + if (col == 0 || row == col) + { + a[row][col] = 1; + cout << " " << a[row][col]; + } + // code for the finding the values for the inside numbers of the triangle + else + { + a[row][col] = a[row - 1][col - 1] + a[row - 1][col]; + cout << " " << a[row][col]; + } + } + cout << endl; + } + system("pause"); + return 0; +} \ No newline at end of file diff --git a/Lab_09/README.md b/Lab_09/README.md new file mode 100644 index 0000000..7d6276f --- /dev/null +++ b/Lab_09/README.md @@ -0,0 +1,14 @@ +# Practical Lab Assignment - Arrays + +1. Write a program to generate Pascal’s triangle. + ``` + 1 + 1 1 + 1 2 1 + 1 3 3 1 + 1 4 6 4 1 + 1 5 10 10 5 1 + 1 6 15 20 15 6 1 + ``` +2. Write a menu driven program to read and display an m × n matrix. Also find the sum, transpose and product of two m × n matrices. +3. In a small company there are five salesman. Each salesman is supposed to sell three products. Write a program using 2D array to print the total sales by each salesman and total sales of each item. \ No newline at end of file diff --git a/OOP1-Lab9/Source1.cpp b/Lab_09/Source1.cpp similarity index 76% rename from OOP1-Lab9/Source1.cpp rename to Lab_09/Source1.cpp index 85e949d..138525a 100644 --- a/OOP1-Lab9/Source1.cpp +++ b/Lab_09/Source1.cpp @@ -1,7 +1,9 @@ #include #include using namespace std; + int main(); + void read_display() { system("cls"); @@ -18,31 +20,33 @@ void read_display() { for (int row = 0; row < row_input; row++) { - for (int col = 0;col < col_input;col++) + for (int col = 0; col < col_input; col++) { cin >> a[row][col]; } } cout << "Result: \n"; - for (int row = 0;row < row_input;row++) + for (int row = 0; row < row_input; row++) { - for (int col = 0; col < col_input;col++) + for (int col = 0; col < col_input; col++) { - + cout << a[row][col] << " "; } cout << endl; } cout << endl; - cout<<"Do you want to try again? (Yes = 1, No = Any Key)\n"; + cout << "Do you want to try again? (Yes = 1, No = Any Key)\n"; string respond; cout << "Your choice: "; cin >> respond; - if (respond == "1") { + if (respond == "1") + { system("cls"); read_display(); } - else { + else + { system("cls"); main(); } @@ -65,7 +69,7 @@ void transpose() cin >> r; cout << "Columns (max 5): "; cin >> c; - // Storing element of matrix entered by user in array + // Storing element of matrix entered by user in array if (r > 0 && r <= 5 && c > 0 && c <= 5) { cout << "Enter elements of matrix: " << endl; @@ -74,14 +78,15 @@ void transpose() { cin >> a[i][j]; } - // Displaying the matrix + // Displaying the matrix cout << "Entered Matrix: " << endl; for (i = 0; i < r; ++i) for (j = 0; j < c; ++j) { cout << " " << a[i][j]; if (j == c - 1) - cout << endl << endl; + cout << endl + << endl; } // Finding transpose of matrix for (i = 0; i < r; ++i) @@ -96,7 +101,8 @@ void transpose() { cout << " " << trans[i][j]; if (j == r - 1) - cout << endl << endl; + cout << endl + << endl; } cout << endl; cout << "Do you want to try again? (Yes = 1, No = Any Key)\n"; @@ -104,11 +110,13 @@ void transpose() cout << "Your choice: "; cin >> respond; - if (respond == "1") { + if (respond == "1") + { system("cls"); transpose(); } - else { + else + { system("cls"); main(); } @@ -120,6 +128,7 @@ void transpose() transpose(); } } + void sum_matrices() { system("cls"); @@ -137,15 +146,15 @@ void sum_matrices() { for (int row = 0; row < row_input; row++) { - for (int col = 0;col < col_input;col++) + for (int col = 0; col < col_input; col++) { cin >> a[row][col]; } } cout << "First Matrix: \n"; - for (int row = 0;row < row_input;row++) + for (int row = 0; row < row_input; row++) { - for (int col = 0; col < col_input;col++) + for (int col = 0; col < col_input; col++) { cout << a[row][col] << " "; } @@ -158,7 +167,7 @@ void sum_matrices() cout << "Please input valid numbers from 1 to 5 ! " << endl; read_display(); } - //for the second matrix + // for the second matrix cout << endl; cout << "Please input details for the Second Matrix: \n"; int row_input2, col_input2; @@ -172,15 +181,15 @@ void sum_matrices() { for (int row = 0; row < row_input2; row++) { - for (int col = 0;col < col_input2;col++) + for (int col = 0; col < col_input2; col++) { cin >> b[row][col]; } } cout << "Second Matrix: \n"; - for (int row = 0;row < row_input2;row++) + for (int row = 0; row < row_input2; row++) { - for (int col = 0; col < col_input2;col++) + for (int col = 0; col < col_input2; col++) { cout << b[row][col] << " "; @@ -194,9 +203,9 @@ void sum_matrices() cout << "Please input valid numbers from 1 to 5 ! " << endl; read_display(); } - //validation for adding matrices + // validation for adding matrices int sum[5][5]; - if (row_input==row_input2&&col_input==col_input2) + if (row_input == row_input2 && col_input == col_input2) { // Adding Two matrices for (int row = 0; row < row_input; row++) @@ -207,7 +216,8 @@ void sum_matrices() } } // Displaying the resultant sum matrix. - cout << endl << "Sum of two matrix is: " << endl; + cout << endl + << "Sum of two matrix is: " << endl; for (int row = 0; row < row_input; row++) { for (int col = 0; col < col_input; col++) @@ -222,21 +232,24 @@ void sum_matrices() cout << endl; cout << "This Matrices cannot be added."; } - //asking play again + // asking play again cout << endl; cout << "Do you want to try again? (Yes = 1, No = Any Key)\n"; string respond; cout << "Your choice: "; cin >> respond; - if (respond == "1") { + if (respond == "1") + { system("cls"); sum_matrices(); } - else { + else + { system("cls"); main(); } } + void product() { system("cls"); @@ -254,15 +267,15 @@ void product() { for (int row = 0; row < row_input; row++) { - for (int col = 0;col < col_input;col++) + for (int col = 0; col < col_input; col++) { cin >> a[row][col]; } } cout << "First Matrix: \n"; - for (int row = 0;row < row_input;row++) + for (int row = 0; row < row_input; row++) { - for (int col = 0; col < col_input;col++) + for (int col = 0; col < col_input; col++) { cout << a[row][col] << " "; } @@ -275,7 +288,7 @@ void product() cout << "Please input valid numbers from 1 to 5 ! " << endl; read_display(); } - //for the second matrix + // for the second matrix cout << endl; cout << "Please input details for the Second Matrix: \n"; int row_input2, col_input2; @@ -289,15 +302,15 @@ void product() { for (int row = 0; row < row_input2; row++) { - for (int col = 0;col < col_input2;col++) + for (int col = 0; col < col_input2; col++) { cin >> b[row][col]; } } cout << "Second Matrix: \n"; - for (int row = 0;row < row_input2;row++) + for (int row = 0; row < row_input2; row++) { - for (int col = 0; col < col_input2;col++) + for (int col = 0; col < col_input2; col++) { cout << b[row][col] << " "; @@ -311,63 +324,63 @@ void product() cout << "Please input valid numbers from 1 to 5 ! " << endl; read_display(); } - //validation for multiplication matrices + // validation for multiplication matrices int multi[5][5]; - if (row_input == col_input2 ) + if (row_input == col_input2) { - //initializing the matrix of multiplication - for (int row = 0;row < row_input;row++) + // initializing the matrix of multiplication + for (int row = 0; row < row_input; row++) { - for (int col = 0;col < col_input2;col++) + for (int col = 0; col < col_input2; col++) { multi[row][col] = 0; } } - for (int row = 0;row < row_input;row++) + for (int row = 0; row < row_input; row++) { - for (int col = 0;col < col_input2;col++) + for (int col = 0; col < col_input2; col++) { - for (int i = 0;i < col_input;i++) + for (int i = 0; i < col_input; i++) { multi[row][col] += a[row][col] * b[row][col]; } } - } - //displaying multiplication of two matrices + } + // displaying multiplication of two matrices cout << endl; cout << "Result of Multiplication: \n"; - for (int row = 0;row < row_input;row++) + for (int row = 0; row < row_input; row++) { - for (int col = 0;col < col_input2;col++) + for (int col = 0; col < col_input2; col++) { cout << multi[row][col] << " "; } cout << endl; } - - } else { cout << endl; cout << "This Matrices cannot be multiplied."; } - //asking play again + // asking play again cout << endl; cout << "Do you want to try again? (Yes = 1, No = Any Key)\n"; string respond; cout << "Your choice: "; cin >> respond; - if (respond == "1") { + if (respond == "1") + { system("cls"); sum_matrices(); } - else { + else + { system("cls"); main(); } - } + void main_menu_view() { system("color 3F"); @@ -385,20 +398,24 @@ int main22() cout << "\t\t\tYOUR CHOICE: "; string user_choice; cin >> user_choice; - //validating the user input + // validating the user input if (user_choice == "1" || user_choice == "2" || user_choice == "3" || user_choice == "4") { - if (user_choice == "1")read_display(); - else if (user_choice == "2")transpose(); - else if (user_choice == "3")sum_matrices(); - else if (user_choice == "4")product(); + if (user_choice == "1") + read_display(); + else if (user_choice == "2") + transpose(); + else if (user_choice == "3") + sum_matrices(); + else if (user_choice == "4") + product(); } else { - system("cls");//function for the clearing the screen of console - cout << "\t\tYou have inputed wrong number, please try again!\n"; + system("cls"); // function for the clearing the screen of console + cout << "\t\tYou have inputted wrong number, please try again!\n"; main(); } - + return 0; } \ No newline at end of file diff --git a/OOP1-Lab9/Source2.cpp b/Lab_09/Source2.cpp similarity index 71% rename from OOP1-Lab9/Source2.cpp rename to Lab_09/Source2.cpp index ccd0e62..78aaa6a 100644 --- a/OOP1-Lab9/Source2.cpp +++ b/Lab_09/Source2.cpp @@ -13,52 +13,57 @@ void main_menu_view1() cout << "= Product 3 || || || || || =\n"; cout << "===================================================================================\n"; } + void salesman_sum(int a[3][5]) { int row, col, sum = 0; - // finding the column sum - for (row = 0; row < 5; ++row) { - for (col = 0; col < 3; ++col) { + // finding the column sum + for (row = 0; row < 5; ++row) + { + for (col = 0; col < 3; ++col) + { - // Add the element + // Add the element sum = sum + a[col][row]; } - // Print the column sum - cout << "The Total sales of Salesman " << row+1 << " is " << sum << endl; - // Reset the sum + // Print the column sum + cout << "The Total sales of Salesman " << row + 1 << " is " << sum << endl; + // Reset the sum sum = 0; } } + void sales_sum(int a[3][5]) { - int sum=0; - for (int row = 0;row < 3;row++) + int sum = 0; + for (int row = 0; row < 3; row++) { - for (int col = 0;col < 5;col++) + for (int col = 0; col < 5; col++) { - sum += a[row][col];//adding all arrays + sum += a[row][col]; // adding all arrays } cout << "The Total sales of Product " << row + 1 << " is " << sum << endl; - sum = 0;//reset the sum + sum = 0; // reset the sum } } -int main11() + +int main() { main_menu_view1(); int a[3][5]; - //inputing numbers for the 2D array + // inputting numbers for the 2D array cout << "Please input 5 Sales for Salesman 1, Salesman 2 and Salesman 3: \n "; for (int row = 0; row < 3; row++) { - for (int col = 0;col < 5;col++) + for (int col = 0; col < 5; col++) { cin >> a[row][col]; } } cout << "Main table of Salesman and Sales: \n"; - for (int row = 0;row < 3;row++) + for (int row = 0; row < 3; row++) { - for (int col = 0; col < 5;col++) + for (int col = 0; col < 5; col++) { cout << a[row][col] << " "; } diff --git a/Lab_10/README.md b/Lab_10/README.md new file mode 100644 index 0000000..dfde558 --- /dev/null +++ b/Lab_10/README.md @@ -0,0 +1,41 @@ +# Practical Lab Assignment - Introduction to class and object with `set()` and `get()` methods + +**Note: In class diagram + for public, - for private.** + +1. Define a class student with the following specification. + ``` + 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. + ``` + +2. Write C++ header file Employee.h with class Employee with following details. + + ``` + 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 + ``` + Write C++ menu driven program to get employee details, display employee details, and display monthly salary details of employee. diff --git a/OOP2_Lab1/studentCourseEvaluation.cpp b/Lab_10/studentCourseEvaluation.cpp similarity index 66% rename from OOP2_Lab1/studentCourseEvaluation.cpp rename to Lab_10/studentCourseEvaluation.cpp index 3c5f82b..95843c5 100644 --- a/OOP2_Lab1/studentCourseEvaluation.cpp +++ b/Lab_10/studentCourseEvaluation.cpp @@ -4,10 +4,11 @@ using namespace std; // creating a class named "Student" -class Student { +class Student +{ private: string student_id; - string student_name; + string student_name; double OOP2_Score; double math_Score; double english_Score; @@ -19,7 +20,8 @@ class Student { } public: - void TakeData() { + void TakeData() + { cout << "ID : "; cin >> student_id; cout << "Name: "; @@ -32,15 +34,16 @@ class Student { cin >> english_Score; ctotal(); } - void showData() { - - cout << "ID: "<< student_id << endl; - cout << "Name: " << student_name << endl; - cout << "OOP2: " << OOP2_Score << endl; - cout << "Math: " << math_Score << endl; - cout << "English: " << english_Score << endl; - cout << "Total score: " << total_Score << endl; - } + void showData() + { + + cout << "ID: " << student_id << endl; + cout << "Name: " << student_name << endl; + cout << "OOP2: " << OOP2_Score << endl; + cout << "Math: " << math_Score << endl; + cout << "English: " << english_Score << endl; + cout << "Total score: " << total_Score << endl; + } }; // creating a class named "Employee" @@ -53,31 +56,40 @@ class Employee int Rate; public: - void setEmployee_ID(string x) { + void setEmployee_ID(string x) + { Employee_ID = x; } - string getEmployee_ID() { + string getEmployee_ID() + { return Employee_ID; } - void setEmployee_Name(string y) { + void setEmployee_Name(string y) + { Employee_Name = y; } - string getEmployee_Name() { + string getEmployee_Name() + { return Employee_Name; } - void setHours(int z) { + void setHours(int z) + { Hours = z; } - int getHours() { + int getHours() + { return Hours; } - void setRate(int i) { + void setRate(int i) + { Rate = i; } - int getRate() { + int getRate() + { return Rate; } - double total_salary() { + double total_salary() + { int total; total = Hours * Rate; return total; @@ -93,18 +105,21 @@ int main() cin >> choice; cout << endl; - Student student; // creating an object of a class "Student" + Student student; // creating an object of a class "Student" Employee employee; // creating an object of a class "Employee" switch (choice) { - case 1: { + case 1: + { student.TakeData(); cout << endl; student.showData(); } - break; - case 2: { - while (true) { + break; + case 2: + { + while (true) + { system("cls"); int choice_employee; @@ -114,7 +129,8 @@ int main() cin >> choice_employee; switch (choice_employee) { - case 1: { + case 1: + { string x, y; int z, i; system("cls"); @@ -133,31 +149,32 @@ int main() employee.setHours(z); employee.setRate(i); system("pause"); - } - break; - case 2: { + break; + case 2: + { system("cls"); - cout <<"ID: "<< employee.getEmployee_ID() << endl; - cout <<"Name: "<< employee.getEmployee_Name() << endl; - cout <<"Hours: "<< employee.getHours() << endl; - cout <<"Rate: "<< employee.getRate() << endl; + cout << "ID: " << employee.getEmployee_ID() << endl; + cout << "Name: " << employee.getEmployee_Name() << endl; + cout << "Hours: " << employee.getHours() << endl; + cout << "Rate: " << employee.getRate() << endl; system("pause"); } - break; - case 3: { + break; + case 3: + { system("cls"); - cout << "Total salary: " << employee.total_salary() < + Person() + + Person(a: int) +``` + +### Program 2 +Construct a class to hold personnel records class name is Records. Use the following data members, and keep them private: +``` +string name; +float salary; +string date_of_birth; +``` +Create two constructors, one to initialize the record with its necessary values and one default. + +Create member functions to alter the individual’s name, salary, and date of birth. + +Create two objects use one object to refer member function through pointer and other object will be accessing through dot operator. + + +### Program 3 +Write a class Account that represents your bank account. +- It contains information like name(string), account number(string) and balance(float). (All are private) +- Add constructors and destructors. +- Create some objects, +- Write a code to display message when it is created and similarly display message when it will be destroyed. + + +### Program 4 +Write C++ header file Triangle.h with class Triangle with data members and member functions as per following class diagram. In Triangle.h file only implement get and set methods. (Consider right angle Triangle) +``` +Triangle +--- +- Height: double +- Base: double +--- +<> + Triangle(double, double) +<> +~ Triangle() # +~ stands for destructor ++ getHeight(): double ++ setHeight(double) ++ getBase(): double ++ setBase(double) ++ getArea(): double ++ getPerimeter(): double +``` +Write C++ program to include header file Triangle.h in your program. Implement constructor (with default value for height and width will be 0), getArea() and getPerimeter() member functions of Class Triangle and write menu driven program to get Height and Width details, display measurement (Area and Perimeter) of Triangle object. \ No newline at end of file diff --git a/Lab_11/Source.cpp b/Lab_11/Source.cpp new file mode 100644 index 0000000..d6c26b4 --- /dev/null +++ b/Lab_11/Source.cpp @@ -0,0 +1,274 @@ +#include +#include + +using namespace std; + +// Program #1 +class Person +{ +private: + string name; + int age; + +public: + Person() + { // default constructor + age = 17; + name = "Rustam"; + } + Person(int x) + { + age = x; + name = "Rustam"; + } + void Display() + { + cout << "Name: " << name << endl; + cout << "Age: " << age << endl; + } +}; + +// Program #2 +class Records +{ +private: + string name; + float salary; + string date_of_birth; + +public: + Records() + { + name = "Rustam"; + salary = 1234; + date_of_birth = "12.34.5678"; + } + Records(string name1, float salary1, string date_of_birth1) + { + name = name1; + salary = salary1; + date_of_birth = date_of_birth1; + } + void Display() + { + cout << endl; + cout << "Name: " << name << endl; + cout << "Salary: " << salary << endl; + cout << "Date of Birth: " << date_of_birth << endl; + } + void alert_name() + { + cout << "New name: "; + cin >> name; + } + void alert_salary() + { + cout << "New salary: "; + cin >> salary; + } + void alert_date() + { + cout << "New Date of Birth: "; + cin >> date_of_birth; + } +}; + +// Program #3 +class Account +{ +public: + Account() + { + cout << "Object is being Created" << endl; + name = "Rustam"; + number = "123456789"; + balance = 12345; + } + ~Account() + { + cout << "Object is being Deleted" << endl; + } + void Display() + { + cout << "Name: " << name << endl + << "Number: " << number << endl + << "Balance: " << balance << endl; + } + +private: + string name; + string number; + float balance; +}; + +// Program #4 +class Rectangle +{ +private: + double height; + double width; + +public: + Rectangle() + { + height = 5; + width = 5; + } + + Rectangle(double height2, double width2) + { + height = height2; + width = width2; + } + void setHeight(double a) + { + height = a; + } + double getHeight() + { + return height; + } + void setWidth(double b) + { + width = b; + } + double getWidht() + { + return width; + } + double getArea() + { + return width * height; + } + double getPerimeter() + { + return 2 * (width + height); + } +}; + +void main_menu_view() +{ + cout << "Main menu: \n"; + cout << "[1] Person's info\n"; + cout << "[2] Records\n"; + cout << "[3] Account\n"; + cout << "[4] Triangle\n"; + cout << "[0] Exit\n"; + cout << "Your Choice: "; +} + +int main() +{ + + string user_choise; + main_menu_view(); + cin >> user_choise; + + // main_menu_validation_check + if (user_choise == "1") + { + system("cls"); + int x; + cout << "Input Age: "; + cin >> x; + Person person1, person2(x); + person1.Display(); + cout << endl; + person2.Display(); + } + else if (user_choise == "2") + { + system("cls"); + cout << "Records: " << endl; + string name; + float salary; + string date_of_birth; + cout << "Name: "; + cin >> name; + cout << "Salary: "; + cin >> salary; + cout << "Date of birth: "; + cin >> date_of_birth; + + Records record1, record2(name, salary, date_of_birth); + record1.Display(); + record2.Display(); + cout << endl; + + Records *ptr = &record1; + ptr->alert_name(); + ptr->alert_salary(); + ptr->alert_date(); + + record1.Display(); + record2.Display(); + } + else if (user_choise == "3") + { + system("cls"); + Account a; + a.Display(); + a.~Account(); + } + else if (user_choise == "4") + { + system("cls"); + Rectangle r; + double width1, height1; + + cout << "Enter the width fo the rectangle: "; + cin >> width1; + cout << "Enter the height fo the rectangle: "; + cin >> height1; + + Rectangle r2(height1, width1); + + r2.setHeight(height1); + r2.setWidth(width1); + + system("cls"); + + int user_choice_1; + /*int qwerty; + cin >> qwerty;*/ + while (user_choice_1 >= 1) + { + cout << "Rectangle: \n"; + cout << "[1] Area\n"; + cout << "[2] Perimeter\n"; + cout << "[0] Exit\n"; + cin >> user_choice_1; + switch (user_choice_1) + { + case 1: + system("cls"); + cout << "The Area is: (Default Constructor (5,5)) : " << r.getArea() << endl + << endl; + cout << "The Area is: (Parametric Constructor) : " << r2.getArea() << endl; + cout << endl; + + break; + case 2: + system("cls"); + cout << "The Perimeter is: (Default Constructor(5,5) : " << r.getPerimeter() << endl + << endl; + cout << "The Perimeter is: (Parametric Constructor) : " << r2.getPerimeter() << endl; + break; + case 0: + break; + } + } + } + else if (user_choise == "0") + { + return 0; + } + else + { + system("cls"); + cout << "Please try again !!!\n"; + main(); + } + + return 0; +} diff --git a/Lab_12/README.md b/Lab_12/README.md new file mode 100644 index 0000000..bf175bc --- /dev/null +++ b/Lab_12/README.md @@ -0,0 +1,48 @@ +# Practical Lab Assignment - Const member function, friend function, composition, friend functions and `this` pointer + +**Note: In class diagram + for public, - for private.** + + +### Program 1 +Define a class FullName and Player with the following specifications: + +``` +FullName +--- +- FirstName: string +- MiddleName: string +- LastName: string +--- +<> + FullName() +<> +~ FullName() ++ setFirstName(string) ++ getFirstName(): string ++ setMiddleName(string) ++ getMiddleName(): string ++ setLastName(string) ++ getLastName(): string +``` +``` +Player +--- +-Player_ID: string +-Player_Name: FullName +-Matches_Played: int +-Goals_Scored: int +--- +<> + Player() +<> +~ Player() ++ setPlayer_ID(string) ++ getPlayer_ID(): string ++ setMatches_Played(int) ++ getMatches_Played(): int ++ setGoals_Scored(int) ++ getGoals_Scored(): int ++ setPlayer_Name(FullName) ++ getPlayer_Name() +<> + Increase_GoalsScored(Player, int) +``` + +`Increase_GoalsScored(int)` is friend function for Player: This function will increase Goal_scored by some int every time when called. + +Write C++ create object pointer(through new) to Class Player and menu driven program to add player details (allocate memory for object and get player details), display player details, increase player goal scored delete player from memory. \ No newline at end of file diff --git a/OOP2_Lab3/main.cpp b/Lab_12/main.cpp similarity index 66% rename from OOP2_Lab3/main.cpp rename to Lab_12/main.cpp index 7879a00..53bbe11 100644 --- a/OOP2_Lab3/main.cpp +++ b/Lab_12/main.cpp @@ -3,41 +3,48 @@ #include using namespace std; -class FullName +class FullName { public: - - FullName() { + FullName() + { FirstName = "Rustam"; MiddleName = "Zokirov"; LastName = "Ibrohimovich"; } - FullName(string fName, string mName, string lName ){ + FullName(string fName, string mName, string lName) + { fName = FirstName; mName = MiddleName; lName = LastName; } - void setFirstName(string f_Name) { + void setFirstName(string f_Name) + { FirstName = f_Name; } - string getFirstName() { + string getFirstName() + { return FirstName; } - void setMiddleName(string m_Name) { + void setMiddleName(string m_Name) + { MiddleName = m_Name; } - string getMiddleName() { + string getMiddleName() + { return MiddleName; } - void setLastName(string l_Name) { + void setLastName(string l_Name) + { LastName = l_Name; } - string getLastName() { + string getLastName() + { return LastName; } - - private: + +private: string FirstName; string MiddleName; string LastName; @@ -50,62 +57,69 @@ class Player int Matches_Played; FullName Player_Name; - public: - static int Goals_Scored; - Player() { + Player() + { Player_ID = "U1910049"; Matches_Played = 100; } - Player(string id, int matches, int goals) { + Player(string id, int matches, int goals) + { Player_ID = id; Matches_Played = matches; -} - void setPlayer_ID(string ID) { + } + void setPlayer_ID(string ID) + { Player_ID = ID; } - string getPlayer_ID() { + string getPlayer_ID() + { return Player_ID; } - void setMatches_Played(int Matches) { + void setMatches_Played(int Matches) + { Matches_Played = Matches; } - int getMatches_Played() { + int getMatches_Played() + { return Matches_Played; } - /* void setGoals_Scored(int Goals) { - Matches_Played = Goals; - } - int getGoals_Scored() { - return Goals_Scored; - }*/ + /* void setGoals_Scored(int Goals) { + Matches_Played = Goals; + } + int getGoals_Scored() { + return Goals_Scored; + }*/ friend void Increse_GoalScored(Player); }; int Player::Goals_Scored; -void Increse_GoalScored(Player player1) { +void Increse_GoalScored(Player player1) +{ player1.Goals_Scored++; } - int main() { int choice; while (1) { - string firstName,middleName,lastName; + string firstName, middleName, lastName; FullName fullName1; // 2 string Id; int goals, matches; Player player1; cout << "Add: First Name, Middle Name, Last Name: \n\n"; - cout << "First Name: \n"; cin >> firstName; - cout << "Middle Name: \n"; cin >> middleName; - cout << "Last Name:\n "; cin >> lastName; + cout << "First Name: \n"; + cin >> firstName; + cout << "Middle Name: \n"; + cin >> middleName; + cout << "Last Name:\n "; + cin >> lastName; FullName fullName(firstName, middleName, lastName); fullName.setFirstName(firstName); @@ -121,20 +135,20 @@ int main() cout << "Your Choice: "; cin >> choice; - switch (choice) + switch (choice) { case 1: system("cls"); cout << "We have entered in the beginning!" << endl; - //fullName.setFirstName(firstName); - //fullName.setMiddleName(middleName); - //fullName.setLastName(lastName); - /* FullName fullName(firstName, middleName, lastName); - fullName.setFirstName(firstName); - fullName.setMiddleName(middleName); - fullName.setLastName(lastName);*/ + // fullName.setFirstName(firstName); + // fullName.setMiddleName(middleName); + // fullName.setLastName(lastName); + /* FullName fullName(firstName, middleName, lastName); + fullName.setFirstName(firstName); + fullName.setMiddleName(middleName); + fullName.setLastName(lastName);*/ - break; + break; case 2: system("cls"); cout << "Details of the Player: \n"; @@ -146,22 +160,18 @@ int main() player1.setMatches_Played(matches); cout << endl; cout << player1.getPlayer_ID(); - cout << fullName.getFirstName() << " " << fullName.getLastName() << " " << fullName.getMiddleName() << endl; - cout << player1.getMatches_Played(); - break; case 3: system("cls"); cout << "Number of goals: \n"; Increse_GoalScored(player1); - break; + break; case 4: system("cls"); cout << "Deletion for finished successfully! \n"; break; - case 5: system("exit"); } diff --git a/Lab_13/README.md b/Lab_13/README.md new file mode 100644 index 0000000..8c02ab7 --- /dev/null +++ b/Lab_13/README.md @@ -0,0 +1,36 @@ +# Practical Lab Assignment - Operator Overloading + +### Program 1 +Define a class DayTime: +``` +private: +int hour, minute, second; +public: + • parameterized constructor to initialize value + • int getHour() const{ return hour; } + • int getMinute() const { return minute; } + • int getSecond() const { return second; } + • int asSeconds() const // Daytime in seconds + • overload increment operator to increment the value of seconds. + • Overload decrement operator to decrement the value of minutes. +``` +Write a menu driven program and create following menu options: +1. To Display Time. +2. To Display Time in Seconds. +3. To Increment seconds. +4. To decrements minutes. +0. To exit. + +### PRogram 2 +Define a class Dollar: +``` +private: + float currency, mktrate, offrate +public: + • float getDollar() { return currency in dollar } + • float getMarketSoums() { return currency in soums } + • float getofficialSoums() { return currency in soums } + • void setRates() { // input current date market and official rates } + • overload operator "<<" to print the details of a Dollar. +``` +Inside main declare one object and show the results similar to Program 1. diff --git a/OOP2_Lab4/main1.cpp b/Lab_13/main1.cpp similarity index 57% rename from OOP2_Lab4/main1.cpp rename to Lab_13/main1.cpp index 156445b..6c9dacd 100644 --- a/OOP2_Lab4/main1.cpp +++ b/Lab_13/main1.cpp @@ -1,11 +1,16 @@ #include #include + using namespace std; -class DayTime { + +class DayTime +{ private: int hour, minute, second; + public: - DayTime() { + DayTime() + { hour = 0; minute = 0; second = 0; @@ -17,64 +22,81 @@ class DayTime { minute = m; second = s; } - int getHour() const { + int getHour() const + { return hour; } - int getMinute() const { + int getMinute() const + { return minute; } - int getSecond() const { + int getSecond() const + { return second; } - - void DisplayTime() { - cout << "HH: " << hour << endl << "MM: " << minute << endl << "SS: " << second << endl; + + void DisplayTime() + { + cout << "HH: " << hour << endl + << "MM: " << minute << endl + << "SS: " << second << endl; } - int asSeconds() const { + int asSeconds() const + { return (3600 * hour + 60 * minute + second); } - - friend void operator <<(ostream& out, DayTime& h); - friend void operator >>(istream& in, DayTime& h); - friend void operator ++(DayTime &MainDayTime); - friend void operator --(DayTime& MainDayTime2); + + friend void operator<<(ostream &out, DayTime &h); + friend void operator>>(istream &in, DayTime &h); + friend void operator++(DayTime &MainDayTime); + friend void operator--(DayTime &MainDayTime2); }; -void operator >> (istream& in, DayTime& h) { - cout << "Input hours ( 0 , 24 ): "; +void operator>>(istream &in, DayTime &h) +{ + cout << "Input hours ( 0 , 24 ): "; in >> h.hour; - cout << "Input minutes (0 , 60 ): "; + cout << "Input minutes (0 , 60 ): "; in >> h.minute; cout << "Input seconds ( 0 ,60 ): "; in >> h.second; } -void operator << (ostream& out, DayTime& h) { - out << "HH: " << h.hour << endl << "MM: " << h.minute << endl << "SS: " << h.second << endl; +void operator<<(ostream &out, DayTime &h) +{ + out << "HH: " << h.hour << endl + << "MM: " << h.minute << endl + << "SS: " << h.second << endl; } -void operator ++ (DayTime& MainDayTime) { +void operator++(DayTime &MainDayTime) +{ MainDayTime.second++; - if (MainDayTime.second >= 60) { + if (MainDayTime.second >= 60) + { MainDayTime.second = 0; MainDayTime.minute++; } - if (MainDayTime.minute >= 60) { + if (MainDayTime.minute >= 60) + { MainDayTime.minute = 0; MainDayTime.hour++; } } -void operator -- (DayTime& MainDayTime2) { +void operator--(DayTime &MainDayTime2) +{ MainDayTime2.minute--; - if (MainDayTime2.minute < 0) { + if (MainDayTime2.minute < 0) + { MainDayTime2.minute = 59; MainDayTime2.hour--; } } // Class 'Dollar' for the program 2 -class Dollar { +class Dollar +{ private: float currency, mktrate, offrate; @@ -85,34 +107,37 @@ class Dollar { mktrate = 9000; offrate = 7000; } - float getDollar() + float getDollar() { - cout << endl<< "Currency: " << endl; + cout << endl + << "Currency: " << endl; return currency; } - float getMarketSoums() + float getMarketSoums() { cout << "Markent currency: " << endl; - return currency*mktrate; + return currency * mktrate; } - float getofficialSoums() { + float getofficialSoums() + { cout << "Official currency:" << endl; - return currency*offrate; + return currency * offrate; } - void setRates() + void setRates() { cout << "Enter current market rate: " << endl; cin >> mktrate; cout << "Enter current official rate: " << endl; cin >> offrate; } - friend void operator<< (ostream &output, Dollar &p); + friend void operator<<(ostream &output, Dollar &p); }; -void operator << (ostream &output, Dollar &p) +void operator<<(ostream &output, Dollar &p) { output << "Details of a dollar " << endl; - output << "Currency is " << p.currency <> h2; - + showChoicesforMainMenu2(); - do { + do + { cin >> choice2; switch (choice2) { case 1: cout << h2; - cout << endl << endl; + cout << endl + << endl; cout << "Enter your choice: "; break; case 2: - cout << h2.asSeconds() < using namespace std; -// class 'Rectangle' -class Rectangle { +// class 'Rectangle' +class Rectangle +{ private: - double length, breadth; + double length, breadth; + public: - double getArea() { + double getArea() + { return length * breadth; } - void setLength(double length) { + void setLength(double length) + { this->length = length; - } - void setBreadth(double breadth) { + } + void setBreadth(double breadth) + { this->breadth = breadth; - } - Rectangle operator+(Rectangle& r2) { + Rectangle operator+(Rectangle &r2) + { Rectangle temp; temp.setLength(length + r2.length); temp.setBreadth(breadth + r2.breadth); return temp; } - }; // void function for the inputing data for class 'Rectangle' & uisng the overloading -void RectangleFirst() { +void RectangleFirst() +{ Rectangle r3, r1, r2; int temp; cout << "Rectangle 1" << endl; @@ -36,7 +41,8 @@ void RectangleFirst() { cout << "Breadth: "; cin >> temp; r1.setBreadth(temp); - cout << "Area: " << r1.getArea() << endl << endl; + cout << "Area: " << r1.getArea() << endl + << endl; cout << "Rectangle 2" << endl; cout << "Length: "; @@ -45,63 +51,79 @@ void RectangleFirst() { cout << "Breadth: "; cin >> temp; r2.setBreadth(temp); - cout << "Area: " << r2.getArea() << endl << endl; + cout << "Area: " << r2.getArea() << endl + << endl; r3 = r1 + r2; // overloading by the binary operator cout << "Rectangle 3 Area: " << r3.getArea() << endl; - } -class Distance { +class Distance +{ private: float Km, M; + public: - void setKm(int Km) { + void setKm(int Km) + { this->Km = Km; } - void setM(int M) { + void setM(int M) + { this->M = M; } - Distance operator==(Distance& d) { - if ((Km == d.Km) && (M == d.M)) { + Distance operator==(Distance &d) + { + if ((Km == d.Km) && (M == d.M)) + { cout << "They are EQUAL.\n"; return *this; } - else { + else + { cout << "NOT EQUAL.\n"; return *this; } } }; -void DistanceSecond() { +void DistanceSecond() +{ Distance d1, d2; - float k1,m1,k2,m2; + float k1, m1, k2, m2; cout << "First distance: \n"; cout << "Kilometers: "; cin >> k1; cout << "Meters: "; cin >> m1; - if (m1 > 1000) { + if (m1 > 1000) + { k1 = m1 / 1000; } - cout << endl << endl; + cout << endl + << endl; cout << "Second distance: \n"; cout << "Kilometers: "; cin >> k2; cout << "Meters: "; cin >> m2; - if (m2 > 1000) { + if (m2 > 1000) + { k2 = m2 / 1000; } d1 == d2; } -int main() { +int main() +{ int choice; - do { + do + { - cout << "1. Rectangle" << endl << "2. Distance" << endl << "3. Exit" << endl << "Your choice: "; + cout << "1. Rectangle" << endl + << "2. Distance" << endl + << "3. Exit" << endl + << "Your choice: "; cin >> choice; switch (choice) { diff --git a/Lab_15/README.md b/Lab_15/README.md new file mode 100644 index 0000000..6a26dac --- /dev/null +++ b/Lab_15/README.md @@ -0,0 +1,55 @@ +# Practical Lab Assignment - Inheritance + +### Program 1 +Imagine a publishing company that markets both book and audio cassette version of its works. Create a class Publication that stores the `title` (a string) and `price` (type float) of a publication. + +From this class derive two classes: +- `Book`, which adds a page count (type int). +- `Tape`, which add playing time in minutes (type float). + +Each of these three classes should have: +- `getdata()` function to display its data +- `setdata()` function to get its data from the user at the keyboard. + +Write a main() program to test the Book and Tape classes by creating instances of them, asking the user to fill with data with `setdata()`, and then displaying the data with `getdata()`. + +### Program 2 +Assume that a bank maintains two kinds of accounts for customers, one called as saving and the other called as current account. + +The saving account provides interest and withdrawal facilities but no cheque book facility. + +The current account provides cheque book facility but no interest. Current account holders should also maintain a minimum balance and if the balance falls below this level a service charge is imposed. + +Create a class `ACCOUNT` that stores customer name, account number and type of account. + +From this derive the classes `CURR_ACCT` and `SAV_ACCT` to make them more specific to their requirements. + +Do not use any constructors. Use member functions to initialize the class members. Include necessary member functions in order to achieve all the tasks: + +Design a menu based program where user selects the type of account and perform the following tasks: +- Accept deposit from a customer and update the balance. +- Display the balance. +- Compute and deposit interest. +- Permit withdrawal and update the balance. +- Check for the minimum balance, impose penalty, necessary and upload the balance. + +``` +CURR_ACCT: +--- +amount, penalty +--- +Deposit() – will deposit the money and update amount +Balance() - will display the balance of account +Withdraw() – will allow to withdraw from account (check if withdrawal amount is less than balance and update balance) +Penalty() – apply penalty of USD 2 for maintaining balance less than 100 USD +``` +``` +SAV_ACCT: +--- +amount +--- +Deposit() – will deposit the money and update amount +Balance() - will display the balance of account +Compute_Interest() – calculate interest based on given condition [ROI is 4% per annum] +Withdraw() – will allow to withdraw from account (check if withdrawal amount is less than balance and update balance) +``` diff --git a/OOP2_Lab6/Source.cpp b/Lab_15/Source.cpp similarity index 74% rename from OOP2_Lab6/Source.cpp rename to Lab_15/Source.cpp index eb9cd93..e19e8f9 100644 --- a/OOP2_Lab6/Source.cpp +++ b/Lab_15/Source.cpp @@ -2,70 +2,84 @@ #include #include // for _getch() function using namespace std; -//balance = balance * pow((1 + (ROI / 100)), year); +// balance = balance * pow((1 + (ROI / 100)), year); // Functions -void F_First_Program(); // showing first program in main +void F_First_Program(); // showing first program in main void F_Second_Program(); // showing second program in main // For the first program -class Publication { // base class for classes 'Book' and 'Tape' +class Publication +{ // base class for classes 'Book' and 'Tape' private: string title; float price; public: - void getdata() { + void getdata() + { cout << " Book title: "; cin >> title; cout << " Price 'USA $': "; cin >> price; } - void showdata() { + void showdata() + { cout << " Book title: '" << title << "'" << endl; - cout << " Price: " << price << "$"<< endl; + cout << " Price: " << price << "$" << endl; } }; -class Book : public Publication { // derived class from Publication +class Book : public Publication +{ // derived class from Publication private: int page_count; + public: - void getdata() { + void getdata() + { Publication::getdata(); // getdata() of class Publicaton cout << " Number of pages: "; cin >> page_count; } - void showdata() { + void showdata() + { Publication::showdata(); // showdata() of class Publication cout << " Number of pages: " << page_count << endl; } }; -class Tape : public Publication { // derived class from Publication +class Tape : public Publication +{ // derived class from Publication private: float playing_time; + public: - void getdata() { + void getdata() + { Publication::getdata(); cout << " Playing time of audiobook: "; cin >> playing_time; } - void showdata() { + void showdata() + { Publication::showdata(); cout << " Playing time of audionbook: " << playing_time << endl; } }; // For the second program -class ACCOUNT { +class ACCOUNT +{ private: - // customer name, account number and type of account. + // customer name, account number and type of account. string name; string account_number; string type_account; + public: - void getdata() { + void getdata() + { cout << " Name: "; cin >> name; cout << " Account Number: "; @@ -74,55 +88,68 @@ class ACCOUNT { cin >> type_account; } - void showdata() { + void showdata() + { cout << " Name: " << name << endl; cout << " Account Number: " << account_number << endl; cout << " Type of Account: " << type_account << endl; } }; -class CURR_ACCT:public ACCOUNT { +class CURR_ACCT : public ACCOUNT +{ private: int amount; int penalty = 2; int balance = 0; int withdraw; + public: - void Deposit() { + void Deposit() + { cout << " Enter your deposit balance: "; cin >> amount; - if (amount >= 100) { + if (amount >= 100) + { balance = balance + amount; cout << " Successfully added!\n\n"; } - else { + else + { cout << " Deposit cannot be less than 100$\n\n"; - system("pause"); system("cls"); + system("pause"); + system("cls"); Deposit(); } } - void Balance() { + void Balance() + { ACCOUNT::showdata(); - cout << " Balance: " << balance << endl << endl; + cout << " Balance: " << balance << endl + << endl; } - void Withdraw() { + void Withdraw() + { cout << " Enter the balance you want to withdraw: "; cin >> withdraw; } - void Penalty() { - if (balance - withdraw > 100) { + void Penalty() + { + if (balance - withdraw > 100) + { balance = balance - withdraw; cout << " Successfully done!\n\n"; - } - else if (balance - withdraw < 0) { + else if (balance - withdraw < 0) + { cout << " You do not have such balance of money in your account!\n"; cout << " Your balance is " << balance << endl; - system("pause"); system("cls"); + system("pause"); + system("cls"); Withdraw(); } else @@ -133,51 +160,63 @@ class CURR_ACCT:public ACCOUNT { } }; -class SAV_ACCT :public ACCOUNT { +class SAV_ACCT : public ACCOUNT +{ private: int amount; int balance = 0; int withdraw; float year; + public: - void Deposit() { + void Deposit() + { cout << " Enter your deposit balance: "; cin >> amount; balance = balance + amount; } - void Balance() { + void Balance() + { ACCOUNT::showdata(); - cout << " Balance: " << balance << endl << endl; + cout << " Balance: " << balance << endl + << endl; } - void Withdraw() { + void Withdraw() + { cout << " Enter the balance you want to withdraw: "; cin >> withdraw; - if (balance - withdraw > 100) { + if (balance - withdraw > 100) + { balance = balance - withdraw; cout << " Successfully done!\n\n"; } - else if (balance - withdraw < 0) { + else if (balance - withdraw < 0) + { cout << " You do not have such balance of money in your account!\n"; cout << " Your balance is " << balance << endl; - system("pause"); system("cls"); + system("pause"); + system("cls"); Withdraw(); } } - void Compute_Interest() { + void Compute_Interest() + { Balance(); cout << " ROI (Return on Investment) = 4%\n"; cout << " Enter the year of investment: "; cin >> year; - cout << " Your balance after " << year << " year(s) will be " << balance * pow( 1.04 , year) << "\n\n"; + cout << " Your balance after " << year << " year(s) will be " << balance * pow(1.04, year) << "\n\n"; } }; -int main() { - - for (int k = 0; k < 1000; k++) { +int main() +{ + + for (int k = 0; k < 1000; k++) + { system("cls"); cout << "\n\t\t 1. First program (Books)\n\t\t 2. Second program (Bank account) \n\t\t 0. Exit \n\n\t Your choice: "; switch (_getch()) @@ -205,19 +244,22 @@ int main() { } // For outputing programs -void F_First_Program() { +void F_First_Program() +{ system("cls"); Book book; Tape tape; - - for (int j = 0; j < 1000; j++) { + + for (int j = 0; j < 1000; j++) + { system("cls"); cout << " Welcome to Bookshop 'AliBooks' \n 1. Paper version \n 2. Audiobook \n 0. Go back\n Your choice: "; switch (_getch()) { // case 1 for the first program - case '1': system("cls"); + case '1': + system("cls"); book.getdata(); cout << "\n\n Your given info:\n"; book.showdata(); @@ -225,7 +267,8 @@ void F_First_Program() { break; // case 2 for the second program - case '2': system("cls"); + case '2': + system("cls"); tape.getdata(); cout << "\n\nYour given info:\n"; tape.showdata(); @@ -241,39 +284,46 @@ void F_First_Program() { cout << "\t Your choice is not available in Menu. \n\t Please try one more time.\n"; break; } // switch - } // for loop + } // for loop } -void F_Second_Program() { +void F_Second_Program() +{ system("cls"); CURR_ACCT account1; SAV_ACCT account2; - for (int i = 0; i < 1000; i++) { + for (int i = 0; i < 1000; i++) + { system("cls"); cout << "\t WELCOME TO 'AliBank' \n Chooce your account rate: \n 1. Current account\n 2. Saving account\n 0. Go back \n Your choice: "; switch (_getch()) { // current account - case '1': system("cls"); + case '1': + system("cls"); account1.getdata(); // calling the function from base class - for (int l = 0; l < 1000; l++) { + for (int l = 0; l < 1000; l++) + { system("cls"); cout << " 1. Deposit \n 2. Display the balance \n 3. Withdraw money \n 0. Go back \n Your choice: "; switch (_getch()) { // case 1 for the first program - case '1': system("cls"); + case '1': + system("cls"); account1.Deposit(); system("pause"); break; // case 2 for the second program - case '2': system("cls"); + case '2': + system("cls"); account1.Balance(); system("pause"); break; - case '3': system("cls"); + case '3': + system("cls"); account1.Withdraw(); account1.Penalty(); system("pause"); @@ -285,31 +335,37 @@ void F_Second_Program() { default: cout << "\tYour choice is not available in Menu. \n\t Please try one more time.\n"; break; - - } // switch - }// for loop + + } // switch + } // for loop // saving account - case '2': system("cls"); + case '2': + system("cls"); account2.getdata(); // calling the function from base class - for (int j = 0; j < 1000; j++) { + for (int j = 0; j < 1000; j++) + { system("cls"); cout << " 1. Deposit \n 2. Display the balance \n 3. Withdraw money \n 4. Compute Interest \n 0. Go back \n Your choice: "; switch (_getch()) { - case '1': system("cls"); + case '1': + system("cls"); account2.Deposit(); system("pause"); break; - case '2': system("cls"); + case '2': + system("cls"); account2.Balance(); system("pause"); break; - case '3': system("cls"); + case '3': + system("cls"); account2.Withdraw(); system("pause"); break; - case '4': system("cls"); + case '4': + system("cls"); account2.Compute_Interest(); system("pause"); break; @@ -330,6 +386,6 @@ void F_Second_Program() { default: cout << "\tYour choice is not available in Menu. \n\t Please try one more time.\n"; break; - } // big switch - } // big for + } // big switch + } // big for } diff --git a/OOP2_Lab7/Lab_8_Assignment.docx b/Lab_16/README.docx similarity index 100% rename from OOP2_Lab7/Lab_8_Assignment.docx rename to Lab_16/README.docx diff --git a/OOP2_Lab7/Source.cpp b/Lab_16/Source.cpp similarity index 65% rename from OOP2_Lab7/Source.cpp rename to Lab_16/Source.cpp index 6953ecb..8f98917 100644 --- a/OOP2_Lab7/Source.cpp +++ b/Lab_16/Source.cpp @@ -11,12 +11,15 @@ void F_First_Program_Menu(); void F_Second_Program_Menu(); // Main BASE class for ALL classes -class Staff { +class Staff +{ protected: string code; string name; + public: - Staff() { + Staff() + { code = "0000"; name = "Unknown"; } @@ -34,111 +37,147 @@ class Staff { return name; } */ - void getdata_name() { - cout << " Enter employee name: "; cin >> name; + void getdata_name() + { + cout << " Enter employee name: "; + cin >> name; } - void getdata_code() { - cout << " Enter employee code: " ; cin >> code; + void getdata_code() + { + cout << " Enter employee code: "; + cin >> code; } - void showdata_name() { + void showdata_name() + { cout << " Name: " << name << endl; } - void showdata_code() { + void showdata_code() + { cout << " Code: " << code << endl; } }; -class Teacher : public Staff { +class Teacher : public Staff +{ protected: string subject; int publications; -public: - Teacher() { +public: + Teacher() + { subject = "Unknown"; publications = 0; } - void getdata() { + void getdata() + { Staff::getdata_code(); Staff::getdata_name(); - cout << " Enter subject: "; cin >> subject; - cout << " Enter number of publications: "; cin >> publications; - } - void showdata() { + cout << " Enter subject: "; + cin >> subject; + cout << " Enter number of publications: "; + cin >> publications; + } + void showdata() + { Staff::showdata_code(); Staff::showdata_name(); - cout << " Subject: " << subject << endl << " Publications: " << publications << endl; + cout << " Subject: " << subject << endl + << " Publications: " << publications << endl; } }; -class Officer : public Staff { +class Officer : public Staff +{ protected: float grade; + public: - Officer() { - grade = 0.0; + Officer() + { + grade = 0.0; } - void getdata() { + void getdata() + { Staff::getdata_code(); Staff::getdata_name(); - cout << " Enter the grade: "; cin >> grade; - - } - void showdata() { + cout << " Enter the grade: "; + cin >> grade; + } + void showdata() + { Staff::showdata_code(); Staff::showdata_name(); cout << " Grade: " << grade << endl; - } + } }; -class Typist : public Staff{ +class Typist : public Staff +{ protected: int speed; + public: - Typist() { + Typist() + { speed = 0; } - void getdata() { + void getdata() + { Staff::getdata_code(); Staff::getdata_name(); - cout << " Enter the speed (wprds/min): "; cin >> speed; + cout << " Enter the speed (wprds/min): "; + cin >> speed; } - void showdata() { + void showdata() + { Staff::showdata_code(); Staff::showdata_name(); cout << " Speed (words/min): " << speed << endl; } }; -class Regular_Typist : public Typist { +class Regular_Typist : public Typist +{ protected: float monthly_salary; + public: - Regular_Typist() { + Regular_Typist() + { monthly_salary = 0.0; } - void getdata() { + void getdata() + { Typist::getdata(); - cout << " Enter the monthly salary: "; cin >> monthly_salary; + cout << " Enter the monthly salary: "; + cin >> monthly_salary; } - void showdata() { + void showdata() + { Typist::showdata(); cout << " Monthly salary: " << monthly_salary << endl; } }; -class Casual_Typist : public Typist { +class Casual_Typist : public Typist +{ protected: float daily_wage; + public: - Casual_Typist() { + Casual_Typist() + { daily_wage = 0.0; } - void getdata() { + void getdata() + { Typist::getdata(); - cout << " Enter the daily wage: "; cin >> daily_wage; + cout << " Enter the daily wage: "; + cin >> daily_wage; } - void showdata() { + void showdata() + { Typist::showdata(); cout << " Daily wage: " << daily_wage << endl; } @@ -146,19 +185,24 @@ class Casual_Typist : public Typist { // Second program classes -class Person { +class Person +{ protected: string name; string code; + public: - Person() { + Person() + { name = "Unknown"; code = "Unknown"; } void getdetails() { - cout << " Enter name: "; cin >> name; - cout << " Enter code: "; cin >> code; + cout << " Enter name: "; + cin >> name; + cout << " Enter code: "; + cin >> code; } void showdetails() { @@ -167,16 +211,20 @@ class Person { } }; -class Account : virtual public Person { +class Account : virtual public Person +{ protected: float pay; + public: - Account() { + Account() + { pay = 0.0; } void getpay() { - cout << " Enter pay amount: "; cin >> pay; + cout << " Enter pay amount: "; + cin >> pay; } void showpay() { @@ -184,16 +232,20 @@ class Account : virtual public Person { } }; -class Admin : virtual public Person { +class Admin : virtual public Person +{ protected: int experience; + public: - Admin() { + Admin() + { experience = 0; } void getexpr() { - cout << " Enter experience in years: "; cin >> experience; + cout << " Enter experience in years: "; + cin >> experience; } void showexpr() { @@ -201,7 +253,8 @@ class Admin : virtual public Person { } }; -class Master : public Account, public Admin { +class Master : public Account, public Admin +{ public: void create() { @@ -219,7 +272,8 @@ class Master : public Account, public Admin { void update() { - for (int i = 0; i < 1000; i++) { + for (int i = 0; i < 1000; i++) + { system("cls"); cout << "\t U P D A T E D E T A I L S\n"; cout << "=========================================\n"; @@ -230,87 +284,110 @@ class Master : public Account, public Admin { cout << " 4. PAY\n"; cout << " 0. Back\n"; cout << " Your choice: "; - + switch (_getch()) { - case 49: cout << "\n\n Enter name: "; + case 49: + cout << "\n\n Enter name: "; cin >> name; cout << " Successfully Updated!\n"; - Sleep(0700); Sleep(0700); + Sleep(0700); + Sleep(0700); break; - case 50: cout << "\n\n Enter code: "; + case 50: + cout << "\n\n Enter code: "; cin >> code; cout << " Successfully Updated!\n"; - Sleep(0700); Sleep(0700); + Sleep(0700); + Sleep(0700); break; - case 51: cout << "\n\n Enter Expereince: "; + case 51: + cout << "\n\n Enter Expereince: "; cin >> experience; cout << " Successfully Updated!\n"; - Sleep(0700); Sleep(0700); + Sleep(0700); + Sleep(0700); break; - case 52: + case 52: cout << "\n\n Enter pay: "; cin >> pay; cout << " Successfully Updated!\n"; - Sleep(0700); Sleep(0700); + Sleep(0700); + Sleep(0700); break; case 48: i = 1000; break; default: - cout << endl << endl; + cout << endl + << endl; cout << "\t\t Your choice is not abailable in Menu. \n\t\t Please try one more time.\n"; - Sleep(0700); Sleep(0700); + Sleep(0700); + Sleep(0700); } // switch } - }// for loop + } // for loop }; -int main() { +int main() +{ - for (int k = 0; k < 1000; k++) { + for (int k = 0; k < 1000; k++) + { system("cls"); - cout << "\tM A I N M E N U\n"; + cout << "\tM A I N M E N U\n"; cout << " =====================\n"; - cout << " 1. First program\n"; + cout << " 1. First program\n"; cout << " 2. Second program\n"; cout << " 0. Exit\n"; cout << " Your choice: \n"; switch (_getch()) { - case '1': { + case '1': + { cout << "\t Educational institution database\n"; // calling the menu of first program F_First_Program_Menu(); - }break; - case '2': { - cout << "\t Second program\n"; + } + break; + case '2': + { + cout << "\t Second program\n"; // calling the menu of second program F_Second_Program_Menu(); - }break; - case '0': { + } + break; + case '0': + { return 0; break; } - default: { cout << endl << endl; + default: + { + cout << endl + << endl; cout << "\t\t Your choice is not abailable in Menu. \n\t\t Please try one more time.\n"; - Sleep(0700); Sleep(0700); - }break; + Sleep(0700); + Sleep(0700); + } + break; - } // switch - } // for loop + } // switch + } // for loop system("pause"); return 0; } -void F_First_Program_Menu() { +void F_First_Program_Menu() +{ // objects Teacher teacher; Officer officer; Regular_Typist regular; Casual_Typist casual; - for (int k = 0; k < 1000; k++) { + for (int k = 0; k < 1000; k++) + { system("cls"); cout << "\tM A I N M E N U\n"; cout << " =====================\n"; @@ -321,7 +398,8 @@ void F_First_Program_Menu() { cout << " Your choice: \n"; switch (_getch()) { - case '1': { + case '1': + { system("cls"); cout << "\t T E A C H E R\n"; cout << "===================================\n"; @@ -329,11 +407,14 @@ void F_First_Program_Menu() { cout << "\n\n\tThe given information:\n"; cout << "===================================\n"; teacher.showdata(); - cout << endl << endl; + cout << endl + << endl; system("pause"); - }break; + } + break; - case '2': { + case '2': + { system("cls"); cout << "\t O F F I C E R\n"; cout << "===================================\n"; @@ -341,19 +422,27 @@ void F_First_Program_Menu() { cout << "\n\n\tThe given information:\n"; cout << "===================================\n"; officer.showdata(); - cout << endl << endl; + cout << endl + << endl; system("pause"); - }break; + } + break; - case '3': { - for (int l = 0; l < 1000; l++) { + case '3': + { + for (int l = 0; l < 1000; l++) + { system("cls"); cout << "\t T Y P I S T\n"; cout << "===================================\n"; - cout << " 1. Regular typist\n"; cout << " 2. Casual typist\n"; cout << " 0. Back\n"; cout << " Your choice: \n"; + cout << " 1. Regular typist\n"; + cout << " 2. Casual typist\n"; + cout << " 0. Back\n"; + cout << " Your choice: \n"; switch (_getch()) { - case '1': { + case '1': + { system("cls"); cout << "\t R E G U L A R T Y P I S T\n"; cout << "===================================\n"; @@ -361,12 +450,14 @@ void F_First_Program_Menu() { cout << "\n\n\tThe given information:\n"; cout << "===================================\n"; regular.showdata(); - cout << endl << endl; + cout << endl + << endl; system("pause"); } - break; + break; - case '2': { + case '2': + { system("cls"); cout << "\t C A S U A L T Y P I S T\n"; cout << "===================================\n"; @@ -374,37 +465,55 @@ void F_First_Program_Menu() { cout << "\n\n\tThe given information:\n"; cout << "===================================\n"; casual.showdata(); - cout << endl << endl; + cout << endl + << endl; system("pause"); } - break; - case '0': { + break; + case '0': + { system("cls"); l = 1000; - }break; - default: {cout << endl << endl; + } + break; + default: + { + cout << endl + << endl; cout << "\t\t Your choice is not abailable in Menu. \n\t\t Please try one more time.\n"; - Sleep(0700); Sleep(0700); - }break; + Sleep(0700); + Sleep(0700); + } + break; } // switch - } // for - }break; - case '0': { + } // for + } + break; + case '0': + { system("cls"); k = 1000; - } break; - default: { cout << endl << endl; + } + break; + default: + { + cout << endl + << endl; cout << "\t\t Your choice is not abailable in Menu. \n\t\t Please try one more time.\n"; - Sleep(0700); Sleep(0700); - }break; - } // switch - } // for loop + Sleep(0700); + Sleep(0700); + } + break; + } // switch + } // for loop } -void F_Second_Program_Menu() { +void F_Second_Program_Menu() +{ Master master1; // object - for (int k = 0; k < 1000; k++) { + for (int k = 0; k < 1000; k++) + { system("cls"); cout << "\t M A S T E R'S D A T A B A S E\n"; cout << " ====================================\n"; @@ -420,7 +529,8 @@ void F_Second_Program_Menu() { cout << "\t C R E A T E A R E C O R D\n"; cout << "===========================================\n"; master1.create(); - cout << endl << endl; + cout << endl + << endl; system("pause"); break; @@ -429,15 +539,17 @@ void F_Second_Program_Menu() { cout << "\t D I S P L A Y D E T A I L S\n"; cout << "==========================================\n"; master1.display(); - cout << endl << endl; + cout << endl + << endl; system("pause"); break; case '3': system("cls"); master1.update(); - cout << endl << endl; - //system("pause"); + cout << endl + << endl; + // system("pause"); break; case '0': @@ -446,9 +558,9 @@ void F_Second_Program_Menu() { default: cout << "\t\t Your choice is not abailable in Menu. \n\t\t Please try one more time.\n"; - Sleep(0700); Sleep(0700); + Sleep(0700); + Sleep(0700); break; - } // switch - } // for loop + } // switch + } // for loop } - diff --git a/OOP2_Lab7_Extra/Activity-1.docx b/Lab_17/Activity-1.docx similarity index 100% rename from OOP2_Lab7_Extra/Activity-1.docx rename to Lab_17/Activity-1.docx diff --git a/OOP2_Lab7_Extra/Education.cpp b/Lab_17/Education.cpp similarity index 100% rename from OOP2_Lab7_Extra/Education.cpp rename to Lab_17/Education.cpp diff --git a/Lab_18/README.md b/Lab_18/README.md new file mode 100644 index 0000000..3980592 --- /dev/null +++ b/Lab_18/README.md @@ -0,0 +1,26 @@ +# Practical Lab Assignment - Virtual function + +### Program 1 +Create a base class called shape. + +Use this class to store two double type values that could be used to compute the area of figures. + +Add to the base class, a member function: +``` +get_data(): to initialize base class data members. +display_area(): to compute and display area of figures. +``` +Make display area as a virtual function and override this function into the derived classes to suit their requirements. + +Derive two classes called triangle and rectangle from the base shape. + +Using these three classes, design a program that will accept dimension of a triangle or a rectangle interactively, and display the area. + +(Remember the two values given as input will be treated as length of two sides in case of rectangles, and as base and heights in the case of triangles.) + +### Program 1a +Extend the above program to display area of circles. + +This requires addition of a new derived class ‘circle’ that computes the area of a circle. + +Remember, for a circle we need only one value its radius, but the get_data function in the base class requires two values to be passed. diff --git a/OOP2_Lab8/U1910049.cpp b/Lab_18/main.cpp similarity index 56% rename from OOP2_Lab8/U1910049.cpp rename to Lab_18/main.cpp index 1a50b45..336390f 100644 --- a/OOP2_Lab8/U1910049.cpp +++ b/Lab_18/main.cpp @@ -5,196 +5,253 @@ #include using namespace std; -double b ; double h ; // global variables for base and height +double b; +double h; // global variables for base and height // Functions for Main Menus void F_First(); void F_Second(); // Base Class -class Shape { // Abstract class +class Shape +{ // Abstract class protected: double base; double height; + public: - void get_data(double base, double height) { - this -> base = base; - this -> height = height; + void get_data(double base, double height) + { + this->base = base; + this->height = height; } void virtual display_area() = 0; // pure virtual function }; // Triangle class to calculate the area of triangle -class Triangle : public Shape { +class Triangle : public Shape +{ public: - void display_area() { + void display_area() + { cout << "Area of triangle: " << 0.5 * base * height << endl; } }; // Rectangle class to calculate the area of rectangle -class Rectanglee : public Shape { +class Rectanglee : public Shape +{ public: - void display_area() { + void display_area() + { cout << "Area of Rectangle: " << base * height << endl; } }; - -class Circle : public Shape{ +class Circle : public Shape +{ public: - void display_area() { + void display_area() + { cout << "Area of Circle: " << base * base * 3.1415 << endl; } }; - -int main() { - for (int k = 0; k < 1000; k++) { +int main() +{ + for (int k = 0; k < 1000; k++) + { system("cls"); - cout << " M A I N M E N U\n" << "-------------------------------\n" << "1. First program\n" << "2. Second program\n" << "0. Exit\n" << "-------------------------------\n" << "Your choice: \n"; + cout << " M A I N M E N U\n" + << "-------------------------------\n" + << "1. First program\n" + << "2. Second program\n" + << "0. Exit\n" + << "-------------------------------\n" + << "Your choice: \n"; switch (_getch()) { // First program - case 49: + case 49: F_First(); - break; + break; // second program - case 50: + case 50: F_Second(); - break; - default: + break; + default: cout << " Your choice is not available in Menu.\n Please, enter one more time.\n"; - Sleep(0700); Sleep(0700); - break; + Sleep(0700); + Sleep(0700); + break; case 48: return 0; break; } // Switch - } // For loop + } // For loop system("pause"); } - -void F_First(){ - for (int k = 0; k < 1000; k++) { +void F_First() +{ + for (int k = 0; k < 1000; k++) + { system("cls"); - cout << " C A L C U L A T I N G A R E A S\n" << "-------------------------------------------\n" << "1. Triangle\n" << "2. Rectangle\n" << "0. Back\n" << "Your choice: \n"; + cout << " C A L C U L A T I N G A R E A S\n" + << "-------------------------------------------\n" + << "1. Triangle\n" + << "2. Rectangle\n" + << "0. Back\n" + << "Your choice: \n"; switch (_getch()) { // Case to Exit from the program - case 48: { + case 48: + { system("cls"); main(); - }break; + } + break; // First program - case 49: { + case 49: + { system("cls"); cout << " T R I A N G L E \n"; cout << "----------------------------------\n"; - Shape* shape; // + Shape *shape; // Triangle triangle; shape = ▵ // overriding functions for triangle - cout << "Enter the base: "; cin >> b; - cout << "Entet the height: "; cin >> h; - shape->get_data(b,h); + cout << "Enter the base: "; + cin >> b; + cout << "Entet the height: "; + cin >> h; + shape->get_data(b, h); shape->display_area(); cout << "-----------------------------------\n\n"; system("pause"); - }break; + } + break; // second program - case 50: { + case 50: + { system("cls"); cout << " R E C T A N G L E \n"; cout << "----------------------------------\n"; - Shape* shape; // + Shape *shape; // Rectanglee rectangle; shape = &rectangle; - cout << "Enter the base: "; cin >> b; - cout << "Entet the height: "; cin >> h; - shape->get_data(b,h); + cout << "Enter the base: "; + cin >> b; + cout << "Entet the height: "; + cin >> h; + shape->get_data(b, h); shape->display_area(); cout << "------------------------------------\n\n"; system("pause"); - }break; + } + break; - default: { + default: + { cout << "Your choice is not available in Menu.\nPlease, enter one more time.\n"; - Sleep(0700); Sleep(0700); + Sleep(0700); + Sleep(0700); } - break; + break; } // Switch - } // For loop + } // For loop system("pause"); } - -void F_Second() { - for (int k = 0; k < 1000; k++) { +void F_Second() +{ + for (int k = 0; k < 1000; k++) + { system("cls"); - cout << " S E C O N D P R O G R A M\n" << "-------------------------------------\n" << "1. Triangle\n" << "2. Rectangle\n" << "3. Circle\n"<< "0. Back\n" << "Your choice: \n"; + cout << " S E C O N D P R O G R A M\n" + << "-------------------------------------\n" + << "1. Triangle\n" + << "2. Rectangle\n" + << "3. Circle\n" + << "0. Back\n" + << "Your choice: \n"; switch (_getch()) { // Case to Exit from the program - case 48: { + case 48: + { system("cls"); main(); - }break; + } + break; // First program - case 49: { + case 49: + { system("cls"); cout << " T R I A N G L E \n"; cout << "----------------------------------\n"; - Shape* shape; // + Shape *shape; // Triangle triangle; shape = ▵ // overriding functions for triangle - cout << "Enter the base: "; cin >> b; - cout << "Entet the height: "; cin >> h; - shape->get_data(b,h); + cout << "Enter the base: "; + cin >> b; + cout << "Entet the height: "; + cin >> h; + shape->get_data(b, h); shape->display_area(); cout << "-----------------------------------\n\n"; system("pause"); - }break; + } + break; // second program - case 50: { + case 50: + { system("cls"); cout << " R E C T A N G L E \n"; cout << "----------------------------------\n"; - Shape* shape; // + Shape *shape; // Rectanglee rectangle; shape = &rectangle; - cout << "Enter the base: "; cin >> b; - cout << "Entet the height: "; cin >> h; - shape->get_data(b,h); + cout << "Enter the base: "; + cin >> b; + cout << "Entet the height: "; + cin >> h; + shape->get_data(b, h); shape->display_area(); cout << "------------------------------------\n\n"; system("pause"); - }break; + } + break; // Third program - case 51: { + case 51: + { system("cls"); cout << " C I R C L E \n"; cout << "----------------------------------\n"; - Shape* shape; // + Shape *shape; // Circle circle1; shape = &circle1; - cout << "Enter the radius: "; cin >> b; + cout << "Enter the radius: "; + cin >> b; shape->get_data(b, 0.0); shape->display_area(); cout << "------------------------------------\n\n"; system("pause"); - }break; + } + break; - default: { + default: + { cout << "Your choice is not available in Menu.\nPlease, enter one more time.\n"; - Sleep(0700); Sleep(0700); + Sleep(0700); + Sleep(0700); } - break; + break; } // Switch - } // For loop + } // For loop system("pause"); } \ No newline at end of file diff --git a/Lab_19/README.md b/Lab_19/README.md new file mode 100644 index 0000000..4e6c202 --- /dev/null +++ b/Lab_19/README.md @@ -0,0 +1,13 @@ +# Practical Lab Assignment - File Handling + +1. Create two file “one.txt” and “two.txt” which contains first 10 even numbers and first ten multiples of 5 respectively; Read the two files, find the sum of all the number of these two files and store it in the variable TOTAL. Write this value in third file named “total.txt”. + +2. A file contains a list of telephone numbers in the following form: + ``` + John 23456 + Ahmed 9876 + ... ... + ``` + The names contain only one word and the names and telephone numbers are separated by white spaces. Write a program to read the file and output the list in the two columns. + +3. Enter 20 numbers in a file named “Numbers.txt”. Ask user to enter any number and search if it exists in the file or not. diff --git a/OOP2_Lab9/contacts.txt b/Lab_19/contacts.txt similarity index 100% rename from OOP2_Lab9/contacts.txt rename to Lab_19/contacts.txt diff --git a/OOP2_Lab9/U1910049_Lab9.cpp b/Lab_19/main.cpp similarity index 68% rename from OOP2_Lab9/U1910049_Lab9.cpp rename to Lab_19/main.cpp index e09dddd..7103f98 100644 --- a/OOP2_Lab9/U1910049_Lab9.cpp +++ b/Lab_19/main.cpp @@ -1,4 +1,4 @@ -// All three programs are written here +// All three programs are written here // A menu driven program which allows to use all programs at the same time // Done be Rustam Zokirov (U1910049) // Last change done in April 13, 2020 @@ -11,23 +11,25 @@ using namespace std; -int main(); +int main(); -void F_First_Program() { +void F_First_Program() +{ // creating a text file one.txt ofstream out_one; out_one.open("one.txt"); - for (int i = 2; i <= 2 * 10; i = i + 2) { + for (int i = 2; i <= 2 * 10; i = i + 2) + { out_one << i << endl; // writing to file first ten even numbers } out_one.close(); // closing the file - // creating a text file one.txt ofstream out_two; out_two.open("two.txt"); - for (int i = 5; i <= 5 * 10; i = i + 5) { + for (int i = 5; i <= 5 * 10; i = i + 5) + { out_two << i << endl; // writing to file first ten multiples of five } out_two.close(); // closing the file @@ -38,13 +40,13 @@ void F_First_Program() { in_one.open("one.txt"); // opening files in_two.open("two.txt"); - int total = 0; int num1 = 0; int num2 = 0; - while (in_one && in_two) { - total += num1 + num2; // calculating the total + while (in_one && in_two) + { + total += num1 + num2; // calculating the total in_one >> num1; in_two >> num2; } @@ -65,17 +67,23 @@ void F_First_Program() { in_total >> total; cout << "TOTAL: " << total << "\n\n"; // displaying the total in console - + in_total.close(); // closing the file after executing } +void F_Second_Program() +{ -void F_Second_Program(){ - - for (int k = 0; k < 1000; k++) { + for (int k = 0; k < 1000; k++) + { system("cls"); - cout << "C O N T A C T S\n" << "------------------\n" << "1. Add a contact\n" << "2. Contacts\n" << "0. Back\n" << "Your choice: \n"; - + cout << "C O N T A C T S\n" + << "------------------\n" + << "1. Add a contact\n" + << "2. Contacts\n" + << "0. Back\n" + << "Your choice: \n"; + ofstream out_contacts("contacts.txt", ios::app); string name, phone; @@ -83,82 +91,95 @@ void F_Second_Program(){ switch (_getch()) { // case 49 is for adding a new contact into a list - case 49: { + case 49: + { system("cls"); cout << "Adding a new contact. Input a contact info:\n\n"; - cout << "Enter the name: "; cin >> name; - cout << "Enter the phone number: "; cin >> phone; + cout << "Enter the name: "; + cin >> name; + cout << "Enter the phone number: "; + cin >> phone; // storing the data in file - out_contacts << left << setw (12) << name << "\t" << phone << "\n"; - out_contacts.close(); //closing the file + out_contacts << left << setw(12) << name << "\t" << phone << "\n"; + out_contacts.close(); // closing the file cout << "Successfully added!\n\n"; - - system("pause"); - } - break; + system("pause"); + } + break; - case 50: { + case 50: + { system("cls"); ifstream in_contacts("contacts.txt"); // getting data from the file - while (in_contacts >> name >> phone) { + while (in_contacts >> name >> phone) + { // displaying the data cout << left << setw(12) << name << "\t" << phone << endl; } in_contacts.close(); // closing the file system("pause"); } - break; + break; - - case 48: { + case 48: + { main(); // to back to main menu } - break; + break; - default: { + default: + { cout << "Your choice is not available in Menu.\nPlease try one more time\n"; system("pause"); } - break; + break; } // switch - } // for loop + } // for loop } +void F_Third_Program() +{ -void F_Third_Program(){ - - for (int k = 0; k < 1000; k++) { + for (int k = 0; k < 1000; k++) + { system("cls"); - cout << "S E A R C H I N G F O R N U M B E R \n" << "------------------------------------\n" << "1. Add numbers\n" << "2. Search for number\n" << "0. Back\n" << "Your choice: \n"; + cout << "S E A R C H I N G F O R N U M B E R \n" + << "------------------------------------\n" + << "1. Add numbers\n" + << "2. Search for number\n" + << "0. Back\n" + << "Your choice: \n"; ofstream out_numbers("numbers.txt", ios::app); // the list could be contiunied after the program execution int numbers; - + switch (_getch()) { - case 49: { + case 49: + { system("cls"); cout << "ENYER NUMBERS\n"; // inputing numbers - for (int i = 1; i <= 20; i++) { - cout << "[ " << i << " ] -> "; cin >> numbers; + for (int i = 1; i <= 20; i++) + { + cout << "[ " << i << " ] -> "; + cin >> numbers; out_numbers << numbers << endl; } - out_numbers.close(); //closing the file + out_numbers.close(); // closing the file - system("pause"); } - break; - + break; - case 50: { + case 50: + { system("cls"); ifstream in_numbers("numbers.txt"); @@ -166,10 +187,11 @@ void F_Third_Program(){ int search_number; bool isAnswerHere = 0; // for finding the searching number from available list - cout << "Enter the number to search: "; + cout << "Enter the number to search: "; cin >> search_number; - while (in_numbers) { + while (in_numbers) + { in_numbers >> numbers; if (search_number == numbers) isAnswerHere = 1; @@ -182,28 +204,35 @@ void F_Third_Program(){ system("pause"); } - break; + break; - - case 48: { + case 48: + { main(); } - break; + break; - default: { + default: + { cout << "Your choice is not available in Menu.\nPlease try one more time\n"; system("pause"); } - break; + break; } // switch - } // for loop + } // for loop } - -int main(){ - for (int k = 0; k < 1000; k++) { +int main() +{ + for (int k = 0; k < 1000; k++) + { system("cls"); - cout << "M A I N M E N U\n"<< "-------------------\n" << "1. First Program\n" << "2. Second Program\n" << "3. Third Program\n" << "Your choice: \n"; + cout << "M A I N M E N U\n" + << "-------------------\n" + << "1. First Program\n" + << "2. Second Program\n" + << "3. Third Program\n" + << "Your choice: \n"; switch (_getch()) { @@ -213,33 +242,29 @@ int main(){ system("pause"); break; - case 50: system("cls"); F_Second_Program(); system("pause"); break; - case 51: system("cls"); F_Third_Program(); system("pause"); break; - case 48: return 0; break; - default: cout << "Your choice is not available in Menu.\nPlease try one more time\n"; system("pause"); break; } // switch - } // for loop + } // for loop system("pause"); return 0; diff --git a/OOP2_Lab9/numbers.txt b/Lab_19/numbers.txt similarity index 100% rename from OOP2_Lab9/numbers.txt rename to Lab_19/numbers.txt diff --git a/OOP2_Lab9/one.txt b/Lab_19/one.txt similarity index 100% rename from OOP2_Lab9/one.txt rename to Lab_19/one.txt diff --git a/OOP2_Lab9/total.txt b/Lab_19/total.txt similarity index 100% rename from OOP2_Lab9/total.txt rename to Lab_19/total.txt diff --git a/OOP2_Lab9/two.txt b/Lab_19/two.txt similarity index 100% rename from OOP2_Lab9/two.txt rename to Lab_19/two.txt diff --git a/OOP2_Lab10/Person.cpp b/Lab_20/Person.cpp similarity index 67% rename from OOP2_Lab10/Person.cpp rename to Lab_20/Person.cpp index a6ed6ca..04c1a53 100644 --- a/OOP2_Lab10/Person.cpp +++ b/Lab_20/Person.cpp @@ -1,4 +1,4 @@ -// Both programs are written here +// Both programs are written here // A menu driven program which allows to use all programs at the same time // Done be Rustam Zokirov (U1910049) // Last change done in April 20, 2020 @@ -7,7 +7,7 @@ #include #include // for getch() #include // library which allows to work with files -#include // for setw() - allignment +#include // for setw() - allignment using namespace std; @@ -17,69 +17,83 @@ void F_Second_Program(); int main(); int position = 1; // global variable for numbering the list of contacts -class Person { -protected: +class Person +{ +protected: string name; string tell_number; public: - void setData(string name, string tell_number) { + void setData(string name, string tell_number) + { this->name = name; this->tell_number = tell_number; } - string getName() { + string getName() + { return name; } - string getTellNumber() { + string getTellNumber() + { return tell_number; } - void displayData() { + void displayData() + { cout << " " << position << ". " << left << setw(10) << name << "\t " << tell_number << endl; position++; } - }; - -void F_First_Program() { +void F_First_Program() +{ Person p; // creating an object of a class Person - for (int k = 0; k < 1000; k++) { + for (int k = 0; k < 1000; k++) + { system("cls"); - cout << " C O N T A C T S\n" << "------------------\n" << " 1. Add a contact\n" << " 2. Contacts\n" << " 0. Back\n" << " Your choice: \n"; - + cout << " C O N T A C T S\n" + << "------------------\n" + << " 1. Add a contact\n" + << " 2. Contacts\n" + << " 0. Back\n" + << " Your choice: \n"; + string name, tell_number; // contact info which will be inputted by user switch (_getch()) { // case 49 is for adding a new contact into a list - case 49: { + case 49: + { system("cls"); ofstream out_contacts("contacts", ios::binary | ios::app); // creating a file | binary file | append mode cout << " ADD TO CONTACT \n-----------------------------\n Enter a contact information.\n\n"; - cout << " Enter the name: "; cin >> name; - cout << " Enter the phone number: "; cin >> tell_number; + cout << " Enter the name: "; + cin >> name; + cout << " Enter the phone number: "; + cin >> tell_number; p.setData(name, tell_number); // setting inputted data // storing the data in file - out_contacts.write((char*)&p, sizeof(Person)); - out_contacts.close(); //closing the file + out_contacts.write((char *)&p, sizeof(Person)); + out_contacts.close(); // closing the file cout << "\n Successfully added!\n\n"; system("pause"); } - break; + break; - // case 50 lists all Contacts - case 50: { + // case 50 lists all Contacts + case 50: + { system("cls"); ifstream in_contacts("contacts", ios::binary); // getting data from the file @@ -87,7 +101,8 @@ void F_First_Program() { cout << " ALL CONTACTS\n---------------------------\n"; cout << " Name Phone\n---------------------------\n"; - while (in_contacts.read((char*) & p, sizeof(Person))) { + while (in_contacts.read((char *)&p, sizeof(Person))) + { // displaying the data p.displayData(); } @@ -97,36 +112,47 @@ void F_First_Program() { cout << endl; system("pause"); } - break; + break; - // to back to main menu - case 48: { - main(); + // to back to main menu + case 48: + { + main(); } - break; + break; - default: { + default: + { cout << " Your choice is not available in Menu.\n Please try one more time\n\n"; system("pause"); } - break; + break; } // switch - } // for loop + } // for loop } - -void F_Second_Program() { +void F_Second_Program() +{ Person p; // global object for each cases - for (int k = 0; k < 1000; k++) { + for (int k = 0; k < 1000; k++) + { system("cls"); - cout << " C O N T A C T S\n" << "--------------------------------------\n" << " 1. Search contact by Phone number\n" << " 2. Search contact by Name\n" << " 3. Delete a contact\n" << " 4. Add a record to a specific position\n" << " 0. Back\n" << " Your choice: \n"; + cout << " C O N T A C T S\n" + << "--------------------------------------\n" + << " 1. Search contact by Phone number\n" + << " 2. Search contact by Name\n" + << " 3. Delete a contact\n" + << " 4. Add a record to a specific position\n" + << " 0. Back\n" + << " Your choice: \n"; switch (_getch()) { // case 49 for searching the contact by Phone Number - case 49: { + case 49: + { system("cls"); cout << " SEARCH CONTACT BY PHONE NUMBER\n-------------------------------\n"; @@ -136,10 +162,11 @@ void F_Second_Program() { ifstream in_contacts_list("contacts", ios::binary); // getting data from the file cout << " List of all Contacts: \n"; cout << " Name Phone\n-------------------------------\n"; - while (in_contacts_list.read((char*)&p, sizeof(Person))) { + while (in_contacts_list.read((char *)&p, sizeof(Person))) + { // displaying the data p.displayData(); - } + } position = 1; in_contacts_list.close(); @@ -147,12 +174,14 @@ void F_Second_Program() { cin >> search_by_tell_number; ifstream in_contacts("contacts", ios::binary); // getting data from the file - //in_contacts.seekg(0, ios::end); - + // in_contacts.seekg(0, ios::end); + // cheaking the list for the specific data cout << " Found Contact(s): \n"; - while (in_contacts.read((char*)&p, sizeof(Person))) { - if (search_by_tell_number == p.getTellNumber()) { + while (in_contacts.read((char *)&p, sizeof(Person))) + { + if (search_by_tell_number == p.getTellNumber()) + { isFound = 1; p.displayData(); } @@ -163,20 +192,22 @@ void F_Second_Program() { cout << endl; system("pause"); } - break; + break; - // case 50 for searching the contact by Name - case 50: { + // case 50 for searching the contact by Name + case 50: + { system("cls"); cout << " SEARCH CONTACT BY NAME\n-----------------------------\n"; - + string search_by_name; // for searching the contact with his name bool isFound = 0; ifstream in_contacts_list("contacts", ios::binary); // getting data from the file cout << " List of all Contacts: \n"; cout << " Name Phone\n-----------------------------\n"; - while (in_contacts_list.read((char*)&p, sizeof(Person))) { + while (in_contacts_list.read((char *)&p, sizeof(Person))) + { // displaying the data p.displayData(); } @@ -187,37 +218,41 @@ void F_Second_Program() { cin >> search_by_name; ifstream in_contacts("contacts", ios::binary); // getting data from the file - //in_contacts.seekg(0, ios::end); + // in_contacts.seekg(0, ios::end); // cheaking the list for the specific data cout << " Found Contact(s): \n"; - while (in_contacts.read((char*)&p, sizeof(Person))) { - if (search_by_name == p.getName()) { + while (in_contacts.read((char *)&p, sizeof(Person))) + { + if (search_by_name == p.getName()) + { isFound = 1; p.displayData(); } } position = 1; in_contacts.close(); // closing the file - + cout << endl; system("pause"); } - break; + break; - // case 51 for deleting a contact - case 51: { + // case 51 for deleting a contact + case 51: + { system("cls"); cout << " DELETE A CONTACT\n---------------------\n"; - + string tell_number_for_deletion; ifstream in_contacts_list("contacts", ios::binary); // getting data from the file cout << " List of all Contacts: \n"; cout << " Name Phone\n---------------------\n"; - while (in_contacts_list.read((char*)&p, sizeof(Person))) { + while (in_contacts_list.read((char *)&p, sizeof(Person))) + { // displaying the data - p.displayData(); + p.displayData(); } position = 1; in_contacts_list.close(); @@ -230,11 +265,14 @@ void F_Second_Program() { cout << " Enter phone number of contact to be deleted: "; cin >> tell_number_for_deletion; - while (in_contacts.read((char*)&p, sizeof(Person))) { - if (p.getTellNumber() != tell_number_for_deletion) { - out_temp.write((char*)&p, sizeof(Person)); + while (in_contacts.read((char *)&p, sizeof(Person))) + { + if (p.getTellNumber() != tell_number_for_deletion) + { + out_temp.write((char *)&p, sizeof(Person)); } - else if (p.getTellNumber() == tell_number_for_deletion) { + else if (p.getTellNumber() == tell_number_for_deletion) + { cout << "\n Successfully deleted\n"; } } @@ -247,7 +285,8 @@ void F_Second_Program() { ifstream in_contacts_list2("contacts", ios::binary); // getting data from the file cout << "\n List of all Contacts: \n"; cout << " Name Phone\n---------------------\n"; - while (in_contacts_list2.read((char*)&p, sizeof(Person))) { + while (in_contacts_list2.read((char *)&p, sizeof(Person))) + { // displaying the data p.displayData(); } @@ -257,17 +296,19 @@ void F_Second_Program() { cout << endl; system("pause"); } - break; + break; - // case 52 for adding a contact to a specific position - case 52: { + // case 52 for adding a contact to a specific position + case 52: + { system("cls"); cout << " ADD A RECORD TO A SPECIFIC POSITION\n-------------------------------------\n"; - + ifstream in_contacts_list("contacts", ios::binary); // getting data from the file cout << " List of all Contacts: \n"; cout << " Name Phone\n-------------------------------------\n"; - while (in_contacts_list.read((char*)&p, sizeof(Person))) { + while (in_contacts_list.read((char *)&p, sizeof(Person))) + { // displaying the data p.displayData(); } @@ -284,20 +325,25 @@ void F_Second_Program() { // Adding a new contact string name, tell_number; cout << " Enter a contact information.\n"; - cout << " Enter the name: "; cin >> name; - cout << " Enter the phone number: "; cin >> tell_number; - + cout << " Enter the name: "; + cin >> name; + cout << " Enter the phone number: "; + cin >> tell_number; + ofstream out_temp("temp", ios::binary); ifstream in_contacts("contacts", ios::binary); - - while (in_contacts.read((char*)&p, sizeof(Person))) { - if (position_of_insertion != position) { - out_temp.write((char*)&p, sizeof(Person)); + + while (in_contacts.read((char *)&p, sizeof(Person))) + { + if (position_of_insertion != position) + { + out_temp.write((char *)&p, sizeof(Person)); } - else { - out_temp.write((char*)&p, sizeof(Person)); + else + { + out_temp.write((char *)&p, sizeof(Person)); p.setData(name, tell_number); - out_temp.write((char*)&p, sizeof(Person)); + out_temp.write((char *)&p, sizeof(Person)); } position++; } @@ -311,7 +357,8 @@ void F_Second_Program() { ifstream in_contacts_list2("contacts", ios::binary); // getting data from the file cout << "\n List of all Contacts: \n"; cout << " Name Phone\n-------------------------------------\n"; - while (in_contacts_list2.read((char*)&p, sizeof(Person))) { + while (in_contacts_list2.read((char *)&p, sizeof(Person))) + { // displaying the data p.displayData(); } @@ -321,29 +368,36 @@ void F_Second_Program() { cout << endl; system("pause"); } - break; + break; - // Going back to Main Menu - case 48: { - main(); + // Going back to Main Menu + case 48: + { + main(); } - break; + break; - // default case - default: { + // default case + default: + { cout << " Your choice is not available in Menu.\n Please try one more time\n\n"; system("pause"); } - break; + break; } // switch - } // for loop + } // for loop } - -int main() { - for (int k = 0; k < 1000; k++) { +int main() +{ + for (int k = 0; k < 1000; k++) + { system("cls"); - cout << " M A I N M E N U\n" << "-------------------\n" << " 1. First Program\n" << " 2. Second Program\n" << " Your choice: \n"; + cout << " M A I N M E N U\n" + << "-------------------\n" + << " 1. First Program\n" + << " 2. Second Program\n" + << " Your choice: \n"; switch (_getch()) { @@ -354,7 +408,7 @@ int main() { system("pause"); break; - // Second Program + // Second Program case 50: system("cls"); F_Second_Program(); @@ -367,7 +421,7 @@ int main() { break; } // switch - } // for loop + } // for loop system("pause"); return 0; diff --git a/Lab_20/README.md b/Lab_20/README.md new file mode 100644 index 0000000..33fe6f2 --- /dev/null +++ b/Lab_20/README.md @@ -0,0 +1,10 @@ +# Practical Lab Assignment - File Handling Operations + +Create a class Person with two private members name and telephone number + +Write a program that will create a data file containing name and telephone numbers of person. Use a class object to store each set of data. Read the file contents and display it on screen. +- Write an interactive menu driven program that will access the file created in program no. 1 and implement the following tasks: +- Determine the telephone number of the specified person. +- Determine the name if telephone number is known. +- Delete a record. +- Add a record to a specific position. diff --git a/OOP2_Lab10/contacts b/Lab_20/contacts similarity index 100% rename from OOP2_Lab10/contacts rename to Lab_20/contacts diff --git a/OOP2-FA/city_temperature_control.cpp b/Lab_21/city_temperature_control.cpp similarity index 100% rename from OOP2-FA/city_temperature_control.cpp rename to Lab_21/city_temperature_control.cpp diff --git a/OOP2-FA/e-commerce.cpp b/Lab_21/e-commerce.cpp similarity index 100% rename from OOP2-FA/e-commerce.cpp rename to Lab_21/e-commerce.cpp diff --git a/OOP1-Lab1/Tasks.docx b/OOP1-Lab1/Tasks.docx deleted file mode 100644 index 807a849..0000000 Binary files a/OOP1-Lab1/Tasks.docx and /dev/null differ diff --git a/OOP1-Lab2/OddEven.cpp b/OOP1-Lab2/OddEven.cpp deleted file mode 100644 index 0a8ce19..0000000 --- a/OOP1-Lab2/OddEven.cpp +++ /dev/null @@ -1,16 +0,0 @@ -//U1910049 -//Lab assignment #3 -//Program to find whether given number is even or odd. -#include -using namespace std; -int main1() { - int a; - cout << "Enter the number: "; - cin >> a; - if (a % 2 == 0) - cout << "Your number is Even!"<< endl; - else - cout << "Your number is Odd!"<< endl; - system("pause"); - return 0; -} \ No newline at end of file diff --git a/OOP1-Lab2/Swapping.cpp b/OOP1-Lab2/Swapping.cpp deleted file mode 100644 index 2dc4f7c..0000000 --- a/OOP1-Lab2/Swapping.cpp +++ /dev/null @@ -1,18 +0,0 @@ -//Program to show swap of two no's without using third variable -#include -using namespace std; -int main(){ - float a, b; - cout << "Enter first number: "; - cin >> a ; - cout << "Enter second number: "; - cin >> b; - a = a + b; - b = a - b; - a = a - b; - cout << "We have swapped your numbers, result in below." << endl; - cout << "a = " << a << endl; - cout << "b = " << b << endl; - system("pause"); - return 0; -} \ No newline at end of file diff --git a/OOP1-Lab2/Tasks.docx b/OOP1-Lab2/Tasks.docx deleted file mode 100644 index ae024af..0000000 Binary files a/OOP1-Lab2/Tasks.docx and /dev/null differ diff --git a/OOP1-Lab2/Temperature.cpp b/OOP1-Lab2/Temperature.cpp deleted file mode 100644 index 9d1e82b..0000000 --- a/OOP1-Lab2/Temperature.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include -using namespace std; - -int main3() -{ - float C, F; - cout << "Enter your temperature in Celcius: "; - cin >> C; - F = C * 1.8 + 32; - cout << "In Celcius: " << C << "*C ;" << endl; - cout << "In Fahrenheit: " << F << "F ;" << endl; - - return 0; -} \ No newline at end of file diff --git a/OOP1-Lab3/Tasks.docx b/OOP1-Lab3/Tasks.docx deleted file mode 100644 index 62235b5..0000000 Binary files a/OOP1-Lab3/Tasks.docx and /dev/null differ diff --git a/OOP1-Lab4/Lab_Assignment_week-6.docx b/OOP1-Lab4/Lab_Assignment_week-6.docx deleted file mode 100644 index e066556..0000000 Binary files a/OOP1-Lab4/Lab_Assignment_week-6.docx and /dev/null differ diff --git a/OOP1-Lab4/Source.cpp b/OOP1-Lab4/Source.cpp deleted file mode 100644 index fd94e39..0000000 --- a/OOP1-Lab4/Source.cpp +++ /dev/null @@ -1,16 +0,0 @@ -//Lab assignment #5 -//ID:U1910049; Name:Zokirov Rustam -//Control structure - Nested Loop - -#include -using namespace std; -int main() { - for (int i = 1;i <= 5;i++) { - for (int j = 1;j <= i;j++) { - cout << "*"; - } - cout << endl; - } - system("pause"); - return 0; -} \ No newline at end of file diff --git a/OOP1-Lab4/Source1.cpp b/OOP1-Lab4/Source1.cpp deleted file mode 100644 index 02258d3..0000000 --- a/OOP1-Lab4/Source1.cpp +++ /dev/null @@ -1,19 +0,0 @@ -//Lab assignment #5 -//ID:U1910049; Name:Zokirov Rustam -//Control structure - Nested Loop - -#include -using namespace std; -int main2() { - for (int i = 1; i <= 5;i++) { - for (int j = 5;j >= 1;j--) { - if (i >= j) - cout << "*"; - else - cout << " "; - } - cout << endl; - } - system("pause"); - return 0; -} \ No newline at end of file diff --git a/OOP1-Lab4/Source2.cpp b/OOP1-Lab4/Source2.cpp deleted file mode 100644 index 45ee5a5..0000000 --- a/OOP1-Lab4/Source2.cpp +++ /dev/null @@ -1,20 +0,0 @@ -//Lab assignment #5 -//ID:U1910049; Name:Zokirov Rustam -//Control structure - Nested Loop - -#include -using namespace std; -int main3() { - for (int i = 1; i <= 5;i+=2) { - for (int j = 3;j >= i;j-=2) { - cout << " "; - } - - for (int j = 1;j <=i;j++) { - cout << "*"; - } - cout << endl; - } - system("pause"); - return 0; -} \ No newline at end of file diff --git a/OOP1-Lab4/Source3.cpp b/OOP1-Lab4/Source3.cpp deleted file mode 100644 index 7d7e611..0000000 --- a/OOP1-Lab4/Source3.cpp +++ /dev/null @@ -1,22 +0,0 @@ -//Lab assignment #5 -//ID:U1910049; Name:Zokirov Rustam -//Control structure - Nested Loop - -#include -using namespace std; -int main4() { - for (int i = 1;i <= 5;i++) { - for (int j = 1;j <= i;j++) { - cout << "*"; - } - cout << endl; - } - for (int i = 1;i <= 5;i++) { - for (int j = 5;j >= i; j--) { - cout << "*"; - } - cout << endl; - } - system("pause"); - return 0; -} \ No newline at end of file diff --git a/OOP1-Lab4/Source4.cpp b/OOP1-Lab4/Source4.cpp deleted file mode 100644 index 2ea6afb..0000000 --- a/OOP1-Lab4/Source4.cpp +++ /dev/null @@ -1,16 +0,0 @@ -//Lab assignment #5 -//ID:U1910049; Name:Zokirov Rustam -//A program to add first seven terms of the following series using for loop:1 / !1 + 2 / !2 + 3 / !3 + . - -#include -using namespace std; -int main5() { - float sum = 0,fact=1; - for (int i = 1;i <= 7;i++) { - fact = fact * i; - sum += i / fact; - } -cout << "Sum is : " << sum << endl; - system("pause"); - return 0; -} \ No newline at end of file diff --git a/OOP1-Lab5/Lab_Assignment_Week-9.docx b/OOP1-Lab5/Lab_Assignment_Week-9.docx deleted file mode 100644 index 7dd5db6..0000000 Binary files a/OOP1-Lab5/Lab_Assignment_Week-9.docx and /dev/null differ diff --git a/OOP1-Lab5/Source.cpp b/OOP1-Lab5/Source.cpp deleted file mode 100644 index 6854b00..0000000 --- a/OOP1-Lab5/Source.cpp +++ /dev/null @@ -1,25 +0,0 @@ -//Practical Lab Assignment-7(Week 9) -//ID:U1910049 Name:Rustam Zokirov -//Program to calculate area of a circle using functions - -#include -#include //C++ libriry which is including "pow" and PI=3.14 -using namespace std; -float area(float radius) {//function for calculating the area - float area; - area = (atan(1) * 4) * (pow(radius, 2));//"atan" is the function which is finding the PI=3.14 - return area; -}//end function "area" -int main1() { - float radius; - cout << "Please enter the radius of circle: "; - cin >> radius;//inputing the radius - - if (radius > 0) - cout << area(radius) << endl;//calling the function "area" for calculating the Area of Circle - - else - cout << "INVALID Radius!"< -#include //C++ libriry which is calculating "pow" and PI=3.14 -using namespace std; -int main2(){ - int a, b; - cout << "Enter two numbers: "; - cin >> a >> b; - swap(a, b);//C++ function to swap two numbers - cout << a << " & " << b << endl; //swap is the function which is contained in c++ ==> - //==> there is no need to open new function to swap - return 0; -}//ending the function main \ No newline at end of file diff --git a/OOP1-Lab5/Source2.cpp b/OOP1-Lab5/Source2.cpp deleted file mode 100644 index 904b4c1..0000000 --- a/OOP1-Lab5/Source2.cpp +++ /dev/null @@ -1,22 +0,0 @@ -//Practical Lab Assignment-7(Week 9) -//ID:U1910049 Name:Rustam Zokirov -//Program to convert into minutes -#include -using namespace std; -double converting1(double hours, double minutes, double seconds) {//initializing the variables - return (hours * 60) + (minutes)+(seconds / 60);// returning the function "converting" -} -int main3() { - double hours, minutes, seconds; - cout << "Hours: "; - cin >> hours; //Prompting user for data and - cout << "Minutes: "; //reading 3 numbers for user - cin >> minutes; //! - cout << "Seconds: "; - cin >> seconds; - if (hours >= 0 && minutes >= 0 && seconds >= 0)//the program will be executed when all numbers are positive - cout << "The time in minutes is " << converting1(hours, minutes, seconds) << endl; - else //calling function to calculate the main function - cout << "Invalid inputs!" << endl; - return 0;//indicates that the program will ended successfully -} \ No newline at end of file diff --git a/OOP1-Lab5/Source3.cpp b/OOP1-Lab5/Source3.cpp deleted file mode 100644 index 2bc91da..0000000 --- a/OOP1-Lab5/Source3.cpp +++ /dev/null @@ -1,28 +0,0 @@ -//Practical Lab Assignment-7(Week 9) -//ID:U1910049 Name:Rustam Zokirov -//Program to sum the series up to n - -#include -#include -using namespace std; -double qwerty(double n, double sum, double fact) { - for (int i = 1; i <= n; i++) { - fact = fact * i;//calculating the factorial of the numbers - sum += (pow(i,i) / (fact));//executing the sum of numbers - }//"pow" is raising 'i' to power 'i' - return sum;// -}//end function qwerty - -int main() { - double n; - double sum=0; - double fact = 1; - cout << "Please ebter the number: ";//outputing and inputing the number - cin >> n; - if (n>0)//the program will calculate the sum when numbers is positive - cout << "Sum is: " << qwerty(n, sum, fact) << endl;//calling the function qwerty - else//when the number is negative 'else' will work - cout << "INVALID INPUT!" << endl; - system("pause"); - return 0; -}//ending the program successfully \ No newline at end of file diff --git a/OOP1-Lab6/Lab_Assignment_Week-10.docx b/OOP1-Lab6/Lab_Assignment_Week-10.docx deleted file mode 100644 index 41b324d..0000000 Binary files a/OOP1-Lab6/Lab_Assignment_Week-10.docx and /dev/null differ diff --git a/OOP1-Lab6/Source.cpp b/OOP1-Lab6/Source.cpp deleted file mode 100644 index 7be1d5a..0000000 --- a/OOP1-Lab6/Source.cpp +++ /dev/null @@ -1,440 +0,0 @@ -#include -#include -#include -#include -using namespace std; - -void first() { - //when the case 1 in the main menu - for (int l = 0;l < 120;l++) { - cout << "="; - } - cout << endl; - cout << "\t\t\t\t***Area of Geometrical figures.***\n"; - for (int l = 0;l < 120;l++) { - cout << "="; - } - cout << endl; - cout << " [1] Circle" << endl; - cout << " [2] Rectangle" << endl; - cout << " [3] Triangle" << endl; - cout << " [4] Square" << endl; - cout << " [5] EXIT to MAIN MENU" << endl; - cout << endl; -} - -void second() { - //when the case 2 in the main menu - for (int l = 0;l < 120;l++) { - cout << "="; - } - cout << endl; - cout << "\t\t\t\t***Circumference of Geometrical figures.***\n"; - for (int l = 0;l < 120;l++) { - cout << "="; - } - cout << endl; - cout << " [1] Circle" << endl; - cout << " [2] Rectangle" << endl; - cout << " [3] Triangle" << endl; - cout << " [4] Square" << endl; - cout << " [5] EXIT to MAIN MENU" << endl; - cout << endl; -} - -void third() { - //when the case 3 in the main menu - for (int l = 0;l < 120;l++) { - cout << "="; - } - cout << endl; - cout << "\t\t\t\t***Find the Largest number among 3 numbers.***\n"; - for (int l = 0;l < 120;l++) { - cout << "="; - } - cout << endl; - -} - -/////Overloading functions for the Finding AREA///// -double area(double radius) { //overloading function for finding the area of circle - double area1; - double input_radius; - area1 = 3.141592653589793238463 * pow(radius, 2); - cout << "The area of Circle: " << area1 << endl; - cout << endl; - return area1; -} -double area(double sideA, double sideB) { //overloading function for finding the area of rectengle - double area2; - area2 = sideA * sideB; - cout << "The area of Rectangle: " << area2 << endl; - cout << endl; - return area2; -} - -double area(double sidetriangleA, double sidetriangleB, double sidetriangleC) { //overloading function for finding the area of triangle - double area3,S; - S = (sidetriangleA + sidetriangleB + sidetriangleC) / 2; - area3 = sqrt(S * (S - sidetriangleA) * (S - sidetriangleB) * (S - sidetriangleC)); - cout << "The area of triangle: " << area3 << endl; - cout << endl; - return area3; -} - -float area(float sidesquare) ////overloading function for finding the area of square -{ - float area4; - area4 = pow(sidesquare, 2); - cout << "The area of square: " << area4 << endl; - cout << endl; - return area4; -} - -//////Overloading functions for finding CIRCUMFERENCE/////// -double circumference(double radius) { - double circumference1; - double input_radius; - circumference1 = 2*3.141592653589793238463 * radius; - cout << "The circumference of Circle: " << circumference1 << endl; - cout << endl; - return circumference1; -} - -double circumference(double sideA, double sideB) { - double circumference2; - circumference2 = 2*(sideA + sideB); - cout << "The circumference of Rectangle: " << circumference2 << endl; - cout << endl; - return circumference2; -} - -double circumference(double sidetriangleA, double sidetriangleB, double sidetriangleC) { - double circumference3; - circumference3 = sidetriangleA + sidetriangleB + sidetriangleC; - cout << "The circumference of triangle: " << circumference3 << endl; - cout << endl; - return circumference3; -} - -float circumference(float sidesquare) -{ - float circumference4; - circumference4 = 4*sidesquare; - cout << "The circumference of square: " << circumference4 << endl; - cout << endl; - return circumference4; -} - -//Overloading function for inputing 3 in the main menu -int findlargest(int n1, int n2, int n3) { - - if (n1 >= n2 && n1 >= n3) - { - cout << "Largest number: " << n1 << endl; - } - if (n2 >= n1 && n2 >= n3) - { - cout << "Largest number: " << n2 << endl; - } - if (n3 >= n1 && n3 >= n2) { - cout << "Largest number: " << n3 << endl; - } - - return n1, n2, n3; -} - -double findlargest(double n1, double n2, double n3) { - - if (n1 >= n2 && n1 >= n3) - { - cout << "Largest number: " << n1 << endl; - } - if (n2 >= n1 && n2 >= n3) - { - cout << "Largest number: " << n2 << endl; - } - if (n3 >= n1 && n3 >= n2) { - cout << "Largest number: " << n3 << endl; - } - else if(n1==n2==n3) - cout << "Largest number : " << n3 << endl; - return n1, n2, n3; -} - -//overloading function with templates -template -T Large(T n1, T n2, T n3) -{ - if (n1 >= n2 && n1 >= n3) - { - cout << "Largest number: " << n1 << endl; - } - if (n2 >= n1 && n2 >= n3) - { - cout << "Largest number: " << n2 << endl; - } - if (n3 >= n1 && n3 >= n2) { - cout << "Largest number: " << n3 << endl; - } - else if (n1 == n2 == n3) - cout << "Largest number : " << n3 << endl; - - return n1, n2, n3; -} - -/////////////////////////////////////***STARTING POINT***//////////////////////////////////////////////////// -int main() { - system("color 3E"); - int numberforoperation=0; - double radius1; - double sideA, sideB; - double sidetriangleA, sidetriangleB, sidetriangleC; - float sidesquare; - double n1, n2, n3; - - for (int l = 0;l < 120;l++) { - cout << "="; - } - cout << endl; - cout << "\t\t\t\t\tHello! Welcome to the main menu.\n"; - cout << "\t\t WARNING!!! Enter only numbers!!! And the 'y/n' when you will be asked!\n"; - for (int l = 0;l < 120;l++) { - cout << "="; - } - cout << endl; - cout << "\t[1] Area of Geometrical Figures.\n"; - cout << "\t[2] Circumference of geometrical figures.\n"; - cout << "\t[3] Find the largest number.\n"; - cout << "\t[4] finding the largest number with function template.\n"; - cout << "\t[5] EXIT\n"; - cout << endl; - b: - cout << " Please enter the number of operation you would like to execute: "; - cin >> numberforoperation; - if (numberforoperation > 0 && numberforoperation < 6) { - system("cls"); - switch (numberforoperation) - { - case 1://first11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 - first(); - int firstfirst; - f: - cout << " Choose one figure: "; - cin >> firstfirst; - if (firstfirst > 0 && firstfirst < 6) { - system("cls"); //ends the main menu - switch (firstfirst)//firstfirst - { - system("cls"); //ends the main menu - case 1: - cout << "\t\t\t\t***CIRCLE***\n"; - a: - cout << "Enter the radius of the circle: "; - cin >> radius1; - if (radius1 > 0) { - area(radius1); - first(); - goto f; - } - else goto a; - break; - - case 2: - cout << "\t\t\t\t***RECTANGLE***\n"; - c: - cout << "Enter the height of rectangle: "; - cin >> sideA; - cout << "Enter the width of the rectangle: "; - cin >> sideB; - cout << endl; - if (sideA > 0 && sideB > 0) { - area(sideA, sideB); - - first(); - goto f; - } - else goto c; - break; - case 3: - cout << "\t\t\t\t***TRIANGLE***" << endl; - d: - cout << "Enter the first side of the triangle: "; - cin >> sidetriangleA; - cout << "Enter the second side of the triangle: "; - cin >> sidetriangleB; - cout << "Enter the third side of the triangle: "; - cin >> sidetriangleC; - cout << endl; - if (sidetriangleA > 0 && sidetriangleB > 0 && sidetriangleC > 0 && sidetriangleC < sidetriangleA + sidetriangleB && sidetriangleA < sidetriangleB + sidetriangleC && sidetriangleB < sidetriangleC + sidetriangleA) - { - area(sidetriangleA, sidetriangleB, sidetriangleC); - - first(); - goto f; - } - else - goto d; - break; - case 4: - cout << "\t\t\t\t***Square***" << endl; - e: - cout << "Enter the side of square: "; - cin >> sidesquare; - if (sidesquare > 0) { - area(sidesquare); - - first(); - goto f; - } - else goto e; - break; - case 5: { - main(); - break; - } - default: - break; - } - break; - } - else goto f; - break; - - case 2://second2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 - second(); - int secondsecond; - g: - cout << " Choose one figure: "; - cin >> secondsecond; - if (secondsecond > 0 && secondsecond < 6) { - system("cls"); //ends the main menu - switch (secondsecond)//firstfirst - { - system("cls"); //ends the main menu - case 1: - cout << "\t\t\t\t***CIRCLE***\n"; - h: - cout << "Enter the radius of the circle: "; - cin >> radius1; - if (radius1 > 0) { - circumference(radius1); - second(); - goto g; - } - else goto h; - break; - - case 2: - cout << "\t\t\t\t***RECTANGLE***\n"; - j: - cout << "Enter the height of rectangle: "; - cin >> sideA; - cout << "Enter the width of the rectangle: "; - cin >> sideB; - cout << endl; - if (sideA > 0 && sideB > 0) { - circumference(sideA, sideB); - second(); - goto g; - } - else goto j; - break; - case 3: - cout << "\t\t\t\t***TRIANGLE***" << endl; - d1: - cout << "Enter the first side of the triangle: "; - cin >> sidetriangleA; - cout << "Enter the second side of the triangle: "; - cin >> sidetriangleB; - cout << "Enter the third side of the triangle: "; - cin >> sidetriangleC; - cout << endl; - if (sidetriangleA > 0 && sidetriangleB > 0 && sidetriangleC > 0 && sidetriangleC < sidetriangleA + sidetriangleB && sidetriangleA < sidetriangleB + sidetriangleC && sidetriangleB < sidetriangleC + sidetriangleA) - { - circumference(sidetriangleA, sidetriangleB, sidetriangleC); - second(); - goto g; - } - else - goto d1; - break; - - case 4: - cout << "\t\t\t\t***Square***" << endl; - e1: - cout << "Enter the side of square: "; - cin >> sidesquare; - if (sidesquare > 0) { - circumference(sidesquare); - second(); - goto g; - } - else goto e1; - break; - case 5: main(); - break; - default: - break; - } - break; - } - else goto g; - break; - /////////////////////////////////////////////////////////////////////////////////////////////////////////// - case 3://third333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333 - third(); - cout << "\t\t\tPlease enter 3 numbers to compare.\n\t\t\tYou can write even an integer or decimal number. For example: 123, 12.123, 0,123 \n"; - x: - cout << endl; - cout << "Enter the first number: "; - cin >> n1; - cout << "Enter the second number: "; - cin >> n2; - cout << "Enter the third number: "; - cin >> n3; - findlargest(n1, n2, n3); - char quit; - cout << "Do you want to try again(y/n)? "; - if (cin >> quit && quit == 'y') //when user will input 'y' the code will again ask you to input a 3 numbers - goto x; //when it will be 'n' the code will go to the main menu - else { - system("cls"); - main(); - } - break; - - ///////////////////////////////////////////////////////////////////////////////////////////////////////////// - case 4://four4444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444 - third(); - cout << "\t\t\tPlease enter 3 numbers to compare.\n\t\t\tYou can write even an integer or decimal number. For example: 123, 12.123, 0,123 \n"; - qw: - cout << endl; - cout << "Enter the first number: "; - cin >> n1; - cout << "Enter the second number: "; - cin >> n2; - cout << "Enter the third number: "; - cin >> n3; - findlargest(n1, n2, n3); - char quit2; - cout << "Do you want to try again(y/n)? ";//when user will input 'y' the code will again ask you to input a 3 numbers - if (cin >> quit2 && quit2 == 'y') //when it will be 'n' the code will go to the main menu - goto qw; - else { - system("cls"); - main(); - } - break; //breaking the case 4 of the main menu - default: - break;//breaking the default - } - } - else goto b; - system("pause"); - return 0; -} - -// bad practices with goto -// never use it next time -// Rustam_Z diff --git a/OOP1-Lab7/Lab_Assignment_Week-11.docx b/OOP1-Lab7/Lab_Assignment_Week-11.docx deleted file mode 100644 index d2f4ae0..0000000 Binary files a/OOP1-Lab7/Lab_Assignment_Week-11.docx and /dev/null differ diff --git a/OOP1-Lab7/fibonacci.cpp b/OOP1-Lab7/fibonacci.cpp deleted file mode 100644 index ea802f0..0000000 --- a/OOP1-Lab7/fibonacci.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include -using namespace std; -int fibonacci(int num) {//new function 'fibonacci' for calculating fibonacci series - if (num <= 1) { - return num; - } - else { - return(fibonacci(num - 1) + fibonacci(num - 2)); - } -} -int main() { - cout << "\t\t\t***Program to calculate the sum of natural numbers using recursion***" << endl; - cout << "Enter how many numbers would you like to output : "; - int num; - cin >> num; - cout << "Fibonnaci Series : ";//inputing the quantity of numbers - for(int i=0; i -using namespace std; -int gcd(int x, int y) { - if (x == 0 || y==0) - return y,x;//will input non-zero number when even one number inputed in zero - if (x == y) - return x;//will return first number when both of the numbers are equal - if (x > y) - return gcd(x - y, y);//when first number is greater than second - if( y > x ) - return gcd(x, y - x);//when second number is greater than first -} -int main4() { - cout << "\t\t\t***Program to calculate the G.C.D for two integers usin recurion.***" << endl; - cout << "Please enter two integers: " << endl; - int x,y; - cin >> x >> y; - cout << "The G.C.D of " << x << "and " << y << " is " << gcd(x, y);//calling function in the main function - return 0; -} \ No newline at end of file diff --git a/OOP1-Lab7/power.cpp b/OOP1-Lab7/power.cpp deleted file mode 100644 index 1c03dfb..0000000 --- a/OOP1-Lab7/power.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include -#include -using namespace std; - long long int power(long long int x, long long int y) { - if (y == 0) - return 1; - else - return x*power(x, y - 1); -} -int main1() { - cout << "\t\t\t***Program to calculate the x^y using recursion***" << endl; - int x,y; - cout << "Please enter the numbers x^y: "; - cin >>x>>y;//inpuing the interval of the numbers - cout << "Result: " << power(x,y);//calling function 'power' - cout << endl; - system("pause"); - return 0; -} \ No newline at end of file diff --git a/OOP1-Lab7/sum.cpp b/OOP1-Lab7/sum.cpp deleted file mode 100644 index 1f384c4..0000000 --- a/OOP1-Lab7/sum.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include -using namespace std; -long long int sum(long long int n) {//fuction called 'sum' foe calculating the sum of the natural numbers - if (n == 0) - return 0;//will return '0' when number will come to 0 - else - return n + sum(n - 1);//using recursion -} - -int main2() { - cout << "\t\t\t***Program to calculate the sum of natural numbers using recursion***" << endl; - int num; - cout << "Please enter the interval: "; - cin >> num;//inpuing the interval of the numbers - cout<<"The sum is : "< -using namespace std; -int main3() { - int a[10]; - int n = 10; - cout << "Input numbers for into arrays." << endl; - for (int i = 0; i < n;i++) - { - cout << "a[" << i << "] = "; //inputing array - cin >> a[i]; - } - int value; - int position; - cout << "Enter value which you want to delete: "; - cin >> value; - for (int i = 0;i < n;i++) { //finding the position - if (value == a[i]) - position = i; - } - for (int i = position;i < n;i++){ //incrementing the array elements into 1 - a[i] = a[i + 1]; - - } - n = n - 1; - for(int i=0; i -#include - -using namespace std; - -// Program #1 -class Person { -private: - string name; - int age; - -public: - Person() { // default constructor - age = 17; - name = "Rustam"; - } - Person( int x ) { - age = x; - name = "Rustam"; - } - void Display() { - cout << "Name: " << name << endl; - cout << "Age: " << age << endl; - } -}; - -// Program #2 - class Records { - private: - string name; - float salary; - string date_of_birth; - - public: - Records() { - name = "Rustam"; - salary = 1234; - date_of_birth = "12.34.5678"; - } - Records(string name1, float salary1, string date_of_birth1) { - name = name1; - salary = salary1; - date_of_birth = date_of_birth1; - } - void Display() { - cout << endl; - cout << "Name: " << name << endl; - cout << "Salary: " << salary <> name; - } - void alert_salary() { - cout << "New salary: "; - cin >> salary; - } - void alert_date() { - cout << "New Date of Birth: "; - cin >> date_of_birth; - } - - }; - - // Program #3 - class Account - { - public: - Account() { - cout << "Object is being Created" << endl; - name = "Rustam"; - number = "123456789"; - balance = 12345; - } - ~Account() { - cout << "Object is being Deleted" << endl; - } - void Display() { - cout << "Name: " << name << endl << "Number: " << number << endl << "Balance: " << balance << endl; - } - private: - string name; - string number; - float balance; - }; - - // Program #4 - class Rectangle { - private: - double height; - double width; - public: - Rectangle() { - height = 5; - width = 5; - } - - Rectangle(double height2, double width2) { - height = height2; - width = width2; - } - void setHeight(double a) { - height = a; - } - double getHeight() { - return height; - } - void setWidth(double b) { - width= b; - } - double getWidht() { - return width; - } - double getArea() { - return width * height; - } - double getPerimeter() { - return 2 * (width + height); - } - - }; - - - - - void main_menu_view() { - cout << "Main menu: \n"; - cout << "[1] Person's info\n"; - cout << "[2] Records\n"; - cout << "[3] Account\n"; - cout << "[4] Triangle\n"; - cout << "[0] Exit\n"; - cout << "Your Choice: "; -} -int main() { - - string user_choise; - main_menu_view(); - cin >> user_choise; - - // main_menu_validation_check - if (user_choise == "1") { - system("cls"); - int x; - cout << "Input Age: "; - cin >> x; - Person person1, person2(x); - person1.Display(); - cout << endl; - person2.Display(); - } - else if (user_choise == "2") { - system("cls"); - cout << "Records: " << endl; - string name; - float salary; - string date_of_birth; - cout << "Name: "; - cin >> name; - cout << "Salary: "; - cin >> salary; - cout << "Date of birth: "; - cin >> date_of_birth; - - Records record1, record2(name, salary, date_of_birth); - record1.Display(); - record2.Display(); - cout << endl; - - Records * ptr = &record1; - ptr->alert_name(); - ptr->alert_salary(); - ptr->alert_date(); - - record1.Display(); - record2.Display(); - - } - else if (user_choise == "3") { - system("cls"); - Account a; - a.Display(); - a.~Account(); - - } - else if (user_choise == "4") { - system("cls"); - Rectangle r; - double width1, height1; - - cout << "Enter the widht fo the rectangle: "; - cin >> width1; - cout << "Enter the height fo the rectangle: "; - cin >> height1; - - Rectangle r2(height1, width1); - - r2.setHeight(height1); - r2.setWidth(width1); - - system("cls"); - - int user_choice_1; - /*int qwerty; - cin >> qwerty;*/ - while (user_choice_1 >= 1) - { - cout << "Rectangle: \n"; - cout << "[1] Area\n"; - cout << "[2] Perimeter\n"; - cout << "[0] Exit\n"; - cin >> user_choice_1; - switch (user_choice_1) - { - case 1: - system("cls"); - cout << "The Area is: (Default Constructor (5,5)) : " << r.getArea() << endl << endl; - cout << "The Area is: (Parametric Constructor) : " << r2.getArea() << endl; - cout << endl; - - break; - case 2: - system("cls"); - cout << "The Perimeter is: (Default Constructor(5,5) : " << r.getPerimeter() << endl << endl; - cout << "The Perimeter is: (Parametric Constructor) : " << r2.getPerimeter() << endl; - break; - case 0: break; - - - } - } - } - else if (user_choise == "0") { - return 0; - } - else { - system("cls"); - cout << "Please try again !!!\n"; - main(); - } - - - return 0; -} - diff --git a/OOP2_Lab3/Spring_2018_-_OOP2_-_Lab_Assignment_3.docx b/OOP2_Lab3/Spring_2018_-_OOP2_-_Lab_Assignment_3.docx deleted file mode 100644 index b87d35e..0000000 Binary files a/OOP2_Lab3/Spring_2018_-_OOP2_-_Lab_Assignment_3.docx and /dev/null differ diff --git a/OOP2_Lab4/Lab4_operator_overloading_Unary.docx b/OOP2_Lab4/Lab4_operator_overloading_Unary.docx deleted file mode 100644 index c6b0d3d..0000000 Binary files a/OOP2_Lab4/Lab4_operator_overloading_Unary.docx and /dev/null differ diff --git a/OOP2_Lab5/Lab5._operator_overloading_binary.docx b/OOP2_Lab5/Lab5._operator_overloading_binary.docx deleted file mode 100644 index ec0b9be..0000000 Binary files a/OOP2_Lab5/Lab5._operator_overloading_binary.docx and /dev/null differ diff --git a/OOP2_Lab6/lab_6_inheritance_exercise.docx b/OOP2_Lab6/lab_6_inheritance_exercise.docx deleted file mode 100644 index 1c3762a..0000000 Binary files a/OOP2_Lab6/lab_6_inheritance_exercise.docx and /dev/null differ diff --git a/OOP2_Lab8/Lab_8_virtual_functions.docx b/OOP2_Lab8/Lab_8_virtual_functions.docx deleted file mode 100644 index 68eaf76..0000000 Binary files a/OOP2_Lab8/Lab_8_virtual_functions.docx and /dev/null differ diff --git a/OOP2_Lab9/Lab_9_Text_File_Operations_.docx b/OOP2_Lab9/Lab_9_Text_File_Operations_.docx deleted file mode 100644 index db7e01f..0000000 Binary files a/OOP2_Lab9/Lab_9_Text_File_Operations_.docx and /dev/null differ diff --git a/Bank management system/Header.h b/Project_Bank_Management_System/Header.h similarity index 100% rename from Bank management system/Header.h rename to Project_Bank_Management_System/Header.h diff --git a/Bank management system/Project3.exe b/Project_Bank_Management_System/Project3.exe similarity index 100% rename from Bank management system/Project3.exe rename to Project_Bank_Management_System/Project3.exe diff --git a/Bank management system/data.txt b/Project_Bank_Management_System/data.txt similarity index 100% rename from Bank management system/data.txt rename to Project_Bank_Management_System/data.txt diff --git a/Bank management system/BMS.cpp b/Project_Bank_Management_System/main.cpp similarity index 77% rename from Bank management system/BMS.cpp rename to Project_Bank_Management_System/main.cpp index 55e2c14..11920f7 100644 --- a/Bank management system/BMS.cpp +++ b/Project_Bank_Management_System/main.cpp @@ -1,6 +1,7 @@ #include "Header.h" -int main() { +int main() +{ srand(time(0)); ::available = rand() % 200000; MainMenu(); @@ -10,12 +11,14 @@ int main() { return 0; } -void MainMenu() { +void MainMenu() +{ system("color 9E"); char num; char choice; - do { - + do + { + bool checked = false; string checkName, checkPassword; accounts data; @@ -37,48 +40,56 @@ void MainMenu() { cout << "\n Please enter your password:"; cout << "\n "; cin >> checkPassword; - for (int i = 0;i<::increaments; i++) { - - if (oldData[i].name == checkName && oldData[i].password == checkPassword) { + for (int i = 0; i < ::increaments; i++) + { + + if (oldData[i].name == checkName && oldData[i].password == checkPassword) + { ::accountNum = i; ::balance = oldData[i].balance; ::borrow = oldData[i].borrowed; checked = true; } - } - if (checked) { - do { + if (checked) + { + do + { system("CLS"); - cout << "\n Hello "<> data.name; - cout << "\n Input yuor password without space"; + cout << "\n Input your password without space"; cout << "\n "; cin >> data.password; data.balance = 0; @@ -88,19 +99,11 @@ void MainMenu() { case 51: break; default: - cout << "\n There is no such ssection"; + cout << "\n There is no such section"; cout << "\n Please try one more time"; break; } } while (choice != 51); - - - - cout << "\n "; } - - - - diff --git a/E-Commerce App V1.0/BreadBakery.h b/Project_E-Commerce_App_V1.0/BreadBakery.h similarity index 100% rename from E-Commerce App V1.0/BreadBakery.h rename to Project_E-Commerce_App_V1.0/BreadBakery.h diff --git a/E-Commerce App V1.0/Header.h b/Project_E-Commerce_App_V1.0/Header.h similarity index 100% rename from E-Commerce App V1.0/Header.h rename to Project_E-Commerce_App_V1.0/Header.h diff --git a/E-Commerce App V1.0/Loading.h b/Project_E-Commerce_App_V1.0/Loading.h similarity index 100% rename from E-Commerce App V1.0/Loading.h rename to Project_E-Commerce_App_V1.0/Loading.h diff --git a/E-Commerce App V1.0/Vegetables.h b/Project_E-Commerce_App_V1.0/Vegetables.h similarity index 100% rename from E-Commerce App V1.0/Vegetables.h rename to Project_E-Commerce_App_V1.0/Vegetables.h diff --git a/E-Commerce App V1.0/Water.h b/Project_E-Commerce_App_V1.0/Water.h similarity index 100% rename from E-Commerce App V1.0/Water.h rename to Project_E-Commerce_App_V1.0/Water.h diff --git a/E-Commerce App V1.0/main.cpp b/Project_E-Commerce_App_V1.0/main.cpp similarity index 100% rename from E-Commerce App V1.0/main.cpp rename to Project_E-Commerce_App_V1.0/main.cpp diff --git a/E-Commerce App V2.0/Loading_Page.h b/Project_E-Commerce_App_V2.0/Loading_Page.h similarity index 100% rename from E-Commerce App V2.0/Loading_Page.h rename to Project_E-Commerce_App_V2.0/Loading_Page.h diff --git a/E-Commerce App V2.0/Person.h b/Project_E-Commerce_App_V2.0/Person.h similarity index 100% rename from E-Commerce App V2.0/Person.h rename to Project_E-Commerce_App_V2.0/Person.h diff --git a/E-Commerce App V2.0/Products.h b/Project_E-Commerce_App_V2.0/Products.h similarity index 100% rename from E-Commerce App V2.0/Products.h rename to Project_E-Commerce_App_V2.0/Products.h diff --git a/E-Commerce App V2.0/User_Info.txt b/Project_E-Commerce_App_V2.0/User_Info.txt similarity index 100% rename from E-Commerce App V2.0/User_Info.txt rename to Project_E-Commerce_App_V2.0/User_Info.txt diff --git a/E-Commerce App V2.0/Validation.h b/Project_E-Commerce_App_V2.0/Validation.h similarity index 100% rename from E-Commerce App V2.0/Validation.h rename to Project_E-Commerce_App_V2.0/Validation.h diff --git a/E-Commerce App V2.0/main.cpp b/Project_E-Commerce_App_V2.0/main.cpp similarity index 100% rename from E-Commerce App V2.0/main.cpp rename to Project_E-Commerce_App_V2.0/main.cpp diff --git a/E-Commerce App V2.0/screenshots/authentication.png b/Project_E-Commerce_App_V2.0/screenshots/authentication.png similarity index 100% rename from E-Commerce App V2.0/screenshots/authentication.png rename to Project_E-Commerce_App_V2.0/screenshots/authentication.png diff --git a/E-Commerce App V2.0/screenshots/authorization.png b/Project_E-Commerce_App_V2.0/screenshots/authorization.png similarity index 100% rename from E-Commerce App V2.0/screenshots/authorization.png rename to Project_E-Commerce_App_V2.0/screenshots/authorization.png diff --git a/E-Commerce App V2.0/screenshots/loading.png b/Project_E-Commerce_App_V2.0/screenshots/loading.png similarity index 100% rename from E-Commerce App V2.0/screenshots/loading.png rename to Project_E-Commerce_App_V2.0/screenshots/loading.png diff --git a/E-Commerce App V2.0/screenshots/menu.png b/Project_E-Commerce_App_V2.0/screenshots/menu.png similarity index 100% rename from E-Commerce App V2.0/screenshots/menu.png rename to Project_E-Commerce_App_V2.0/screenshots/menu.png diff --git a/E-Commerce App V2.0/screenshots/product list.png b/Project_E-Commerce_App_V2.0/screenshots/product list.png similarity index 100% rename from E-Commerce App V2.0/screenshots/product list.png rename to Project_E-Commerce_App_V2.0/screenshots/product list.png diff --git a/E-Commerce App V3.0/Loading_Page.h b/Project_E-Commerce_App_V3.0/Loading_Page.h similarity index 100% rename from E-Commerce App V3.0/Loading_Page.h rename to Project_E-Commerce_App_V3.0/Loading_Page.h diff --git a/E-Commerce App V3.0/Password_Vali_Asterisk.h b/Project_E-Commerce_App_V3.0/Password_Vali_Asterisk.h similarity index 100% rename from E-Commerce App V3.0/Password_Vali_Asterisk.h rename to Project_E-Commerce_App_V3.0/Password_Vali_Asterisk.h diff --git a/E-Commerce App V3.0/Person.h b/Project_E-Commerce_App_V3.0/Person.h similarity index 100% rename from E-Commerce App V3.0/Person.h rename to Project_E-Commerce_App_V3.0/Person.h diff --git a/E-Commerce App V3.0/Products.h b/Project_E-Commerce_App_V3.0/Products.h similarity index 100% rename from E-Commerce App V3.0/Products.h rename to Project_E-Commerce_App_V3.0/Products.h diff --git a/E-Commerce App V3.0/User_Info.txt b/Project_E-Commerce_App_V3.0/User_Info.txt similarity index 100% rename from E-Commerce App V3.0/User_Info.txt rename to Project_E-Commerce_App_V3.0/User_Info.txt diff --git a/E-Commerce App V3.0/Validation.h b/Project_E-Commerce_App_V3.0/Validation.h similarity index 100% rename from E-Commerce App V3.0/Validation.h rename to Project_E-Commerce_App_V3.0/Validation.h diff --git a/E-Commerce App V3.0/main.cpp b/Project_E-Commerce_App_V3.0/main.cpp similarity index 100% rename from E-Commerce App V3.0/main.cpp rename to Project_E-Commerce_App_V3.0/main.cpp diff --git a/E-Commerce App V3.0/screenshots/authentication.png b/Project_E-Commerce_App_V3.0/screenshots/authentication.png similarity index 100% rename from E-Commerce App V3.0/screenshots/authentication.png rename to Project_E-Commerce_App_V3.0/screenshots/authentication.png diff --git a/E-Commerce App V3.0/screenshots/authorization.png b/Project_E-Commerce_App_V3.0/screenshots/authorization.png similarity index 100% rename from E-Commerce App V3.0/screenshots/authorization.png rename to Project_E-Commerce_App_V3.0/screenshots/authorization.png diff --git a/E-Commerce App V3.0/screenshots/loading.png b/Project_E-Commerce_App_V3.0/screenshots/loading.png similarity index 100% rename from E-Commerce App V3.0/screenshots/loading.png rename to Project_E-Commerce_App_V3.0/screenshots/loading.png diff --git a/E-Commerce App V3.0/screenshots/menu.png b/Project_E-Commerce_App_V3.0/screenshots/menu.png similarity index 100% rename from E-Commerce App V3.0/screenshots/menu.png rename to Project_E-Commerce_App_V3.0/screenshots/menu.png diff --git a/E-Commerce App V3.0/screenshots/product list.png b/Project_E-Commerce_App_V3.0/screenshots/product list.png similarity index 100% rename from E-Commerce App V3.0/screenshots/product list.png rename to Project_E-Commerce_App_V3.0/screenshots/product list.png diff --git a/Labirint Game/olaf-game.cpp b/Project_Labirint_Game/olaf-game.cpp similarity index 100% rename from Labirint Game/olaf-game.cpp rename to Project_Labirint_Game/olaf-game.cpp diff --git a/Labirint Game/sfml/bin/openal32.dll b/Project_Labirint_Game/sfml/bin/openal32.dll similarity index 100% rename from Labirint Game/sfml/bin/openal32.dll rename to Project_Labirint_Game/sfml/bin/openal32.dll diff --git a/Labirint Game/sfml/bin/sfml-audio-2.dll b/Project_Labirint_Game/sfml/bin/sfml-audio-2.dll similarity index 100% rename from Labirint Game/sfml/bin/sfml-audio-2.dll rename to Project_Labirint_Game/sfml/bin/sfml-audio-2.dll diff --git a/Labirint Game/sfml/bin/sfml-audio-d-2.dll b/Project_Labirint_Game/sfml/bin/sfml-audio-d-2.dll similarity index 100% rename from Labirint Game/sfml/bin/sfml-audio-d-2.dll rename to Project_Labirint_Game/sfml/bin/sfml-audio-d-2.dll diff --git a/Labirint Game/sfml/bin/sfml-graphics-2.dll b/Project_Labirint_Game/sfml/bin/sfml-graphics-2.dll similarity index 100% rename from Labirint Game/sfml/bin/sfml-graphics-2.dll rename to Project_Labirint_Game/sfml/bin/sfml-graphics-2.dll diff --git a/Labirint Game/sfml/bin/sfml-graphics-d-2.dll b/Project_Labirint_Game/sfml/bin/sfml-graphics-d-2.dll similarity index 100% rename from Labirint Game/sfml/bin/sfml-graphics-d-2.dll rename to Project_Labirint_Game/sfml/bin/sfml-graphics-d-2.dll diff --git a/Labirint Game/sfml/bin/sfml-network-2.dll b/Project_Labirint_Game/sfml/bin/sfml-network-2.dll similarity index 100% rename from Labirint Game/sfml/bin/sfml-network-2.dll rename to Project_Labirint_Game/sfml/bin/sfml-network-2.dll diff --git a/Labirint Game/sfml/bin/sfml-network-d-2.dll b/Project_Labirint_Game/sfml/bin/sfml-network-d-2.dll similarity index 100% rename from Labirint Game/sfml/bin/sfml-network-d-2.dll rename to Project_Labirint_Game/sfml/bin/sfml-network-d-2.dll diff --git a/Labirint Game/sfml/bin/sfml-system-2.dll b/Project_Labirint_Game/sfml/bin/sfml-system-2.dll similarity index 100% rename from Labirint Game/sfml/bin/sfml-system-2.dll rename to Project_Labirint_Game/sfml/bin/sfml-system-2.dll diff --git a/Labirint Game/sfml/bin/sfml-system-d-2.dll b/Project_Labirint_Game/sfml/bin/sfml-system-d-2.dll similarity index 100% rename from Labirint Game/sfml/bin/sfml-system-d-2.dll rename to Project_Labirint_Game/sfml/bin/sfml-system-d-2.dll diff --git a/Labirint Game/sfml/bin/sfml-window-2.dll b/Project_Labirint_Game/sfml/bin/sfml-window-2.dll similarity index 100% rename from Labirint Game/sfml/bin/sfml-window-2.dll rename to Project_Labirint_Game/sfml/bin/sfml-window-2.dll diff --git a/Labirint Game/sfml/bin/sfml-window-d-2.dll b/Project_Labirint_Game/sfml/bin/sfml-window-d-2.dll similarity index 100% rename from Labirint Game/sfml/bin/sfml-window-d-2.dll rename to Project_Labirint_Game/sfml/bin/sfml-window-d-2.dll diff --git a/Labirint Game/sfml/include/SFML/Audio.hpp b/Project_Labirint_Game/sfml/include/SFML/Audio.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Audio.hpp rename to Project_Labirint_Game/sfml/include/SFML/Audio.hpp diff --git a/Labirint Game/sfml/include/SFML/Audio/AlResource.hpp b/Project_Labirint_Game/sfml/include/SFML/Audio/AlResource.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Audio/AlResource.hpp rename to Project_Labirint_Game/sfml/include/SFML/Audio/AlResource.hpp diff --git a/Labirint Game/sfml/include/SFML/Audio/Export.hpp b/Project_Labirint_Game/sfml/include/SFML/Audio/Export.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Audio/Export.hpp rename to Project_Labirint_Game/sfml/include/SFML/Audio/Export.hpp diff --git a/Labirint Game/sfml/include/SFML/Audio/InputSoundFile.hpp b/Project_Labirint_Game/sfml/include/SFML/Audio/InputSoundFile.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Audio/InputSoundFile.hpp rename to Project_Labirint_Game/sfml/include/SFML/Audio/InputSoundFile.hpp diff --git a/Labirint Game/sfml/include/SFML/Audio/Listener.hpp b/Project_Labirint_Game/sfml/include/SFML/Audio/Listener.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Audio/Listener.hpp rename to Project_Labirint_Game/sfml/include/SFML/Audio/Listener.hpp diff --git a/Labirint Game/sfml/include/SFML/Audio/Music.hpp b/Project_Labirint_Game/sfml/include/SFML/Audio/Music.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Audio/Music.hpp rename to Project_Labirint_Game/sfml/include/SFML/Audio/Music.hpp diff --git a/Labirint Game/sfml/include/SFML/Audio/OutputSoundFile.hpp b/Project_Labirint_Game/sfml/include/SFML/Audio/OutputSoundFile.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Audio/OutputSoundFile.hpp rename to Project_Labirint_Game/sfml/include/SFML/Audio/OutputSoundFile.hpp diff --git a/Labirint Game/sfml/include/SFML/Audio/Sound.hpp b/Project_Labirint_Game/sfml/include/SFML/Audio/Sound.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Audio/Sound.hpp rename to Project_Labirint_Game/sfml/include/SFML/Audio/Sound.hpp diff --git a/Labirint Game/sfml/include/SFML/Audio/SoundBuffer.hpp b/Project_Labirint_Game/sfml/include/SFML/Audio/SoundBuffer.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Audio/SoundBuffer.hpp rename to Project_Labirint_Game/sfml/include/SFML/Audio/SoundBuffer.hpp diff --git a/Labirint Game/sfml/include/SFML/Audio/SoundBufferRecorder.hpp b/Project_Labirint_Game/sfml/include/SFML/Audio/SoundBufferRecorder.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Audio/SoundBufferRecorder.hpp rename to Project_Labirint_Game/sfml/include/SFML/Audio/SoundBufferRecorder.hpp diff --git a/Labirint Game/sfml/include/SFML/Audio/SoundFileFactory.hpp b/Project_Labirint_Game/sfml/include/SFML/Audio/SoundFileFactory.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Audio/SoundFileFactory.hpp rename to Project_Labirint_Game/sfml/include/SFML/Audio/SoundFileFactory.hpp diff --git a/Labirint Game/sfml/include/SFML/Audio/SoundFileFactory.inl b/Project_Labirint_Game/sfml/include/SFML/Audio/SoundFileFactory.inl similarity index 100% rename from Labirint Game/sfml/include/SFML/Audio/SoundFileFactory.inl rename to Project_Labirint_Game/sfml/include/SFML/Audio/SoundFileFactory.inl diff --git a/Labirint Game/sfml/include/SFML/Audio/SoundFileReader.hpp b/Project_Labirint_Game/sfml/include/SFML/Audio/SoundFileReader.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Audio/SoundFileReader.hpp rename to Project_Labirint_Game/sfml/include/SFML/Audio/SoundFileReader.hpp diff --git a/Labirint Game/sfml/include/SFML/Audio/SoundFileWriter.hpp b/Project_Labirint_Game/sfml/include/SFML/Audio/SoundFileWriter.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Audio/SoundFileWriter.hpp rename to Project_Labirint_Game/sfml/include/SFML/Audio/SoundFileWriter.hpp diff --git a/Labirint Game/sfml/include/SFML/Audio/SoundRecorder.hpp b/Project_Labirint_Game/sfml/include/SFML/Audio/SoundRecorder.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Audio/SoundRecorder.hpp rename to Project_Labirint_Game/sfml/include/SFML/Audio/SoundRecorder.hpp diff --git a/Labirint Game/sfml/include/SFML/Audio/SoundSource.hpp b/Project_Labirint_Game/sfml/include/SFML/Audio/SoundSource.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Audio/SoundSource.hpp rename to Project_Labirint_Game/sfml/include/SFML/Audio/SoundSource.hpp diff --git a/Labirint Game/sfml/include/SFML/Audio/SoundStream.hpp b/Project_Labirint_Game/sfml/include/SFML/Audio/SoundStream.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Audio/SoundStream.hpp rename to Project_Labirint_Game/sfml/include/SFML/Audio/SoundStream.hpp diff --git a/Labirint Game/sfml/include/SFML/Config.hpp b/Project_Labirint_Game/sfml/include/SFML/Config.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Config.hpp rename to Project_Labirint_Game/sfml/include/SFML/Config.hpp diff --git a/Labirint Game/sfml/include/SFML/GpuPreference.hpp b/Project_Labirint_Game/sfml/include/SFML/GpuPreference.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/GpuPreference.hpp rename to Project_Labirint_Game/sfml/include/SFML/GpuPreference.hpp diff --git a/Labirint Game/sfml/include/SFML/Graphics.hpp b/Project_Labirint_Game/sfml/include/SFML/Graphics.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Graphics.hpp rename to Project_Labirint_Game/sfml/include/SFML/Graphics.hpp diff --git a/Labirint Game/sfml/include/SFML/Graphics/BlendMode.hpp b/Project_Labirint_Game/sfml/include/SFML/Graphics/BlendMode.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Graphics/BlendMode.hpp rename to Project_Labirint_Game/sfml/include/SFML/Graphics/BlendMode.hpp diff --git a/Labirint Game/sfml/include/SFML/Graphics/CircleShape.hpp b/Project_Labirint_Game/sfml/include/SFML/Graphics/CircleShape.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Graphics/CircleShape.hpp rename to Project_Labirint_Game/sfml/include/SFML/Graphics/CircleShape.hpp diff --git a/Labirint Game/sfml/include/SFML/Graphics/Color.hpp b/Project_Labirint_Game/sfml/include/SFML/Graphics/Color.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Graphics/Color.hpp rename to Project_Labirint_Game/sfml/include/SFML/Graphics/Color.hpp diff --git a/Labirint Game/sfml/include/SFML/Graphics/ConvexShape.hpp b/Project_Labirint_Game/sfml/include/SFML/Graphics/ConvexShape.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Graphics/ConvexShape.hpp rename to Project_Labirint_Game/sfml/include/SFML/Graphics/ConvexShape.hpp diff --git a/Labirint Game/sfml/include/SFML/Graphics/Drawable.hpp b/Project_Labirint_Game/sfml/include/SFML/Graphics/Drawable.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Graphics/Drawable.hpp rename to Project_Labirint_Game/sfml/include/SFML/Graphics/Drawable.hpp diff --git a/Labirint Game/sfml/include/SFML/Graphics/Export.hpp b/Project_Labirint_Game/sfml/include/SFML/Graphics/Export.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Graphics/Export.hpp rename to Project_Labirint_Game/sfml/include/SFML/Graphics/Export.hpp diff --git a/Labirint Game/sfml/include/SFML/Graphics/Font.hpp b/Project_Labirint_Game/sfml/include/SFML/Graphics/Font.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Graphics/Font.hpp rename to Project_Labirint_Game/sfml/include/SFML/Graphics/Font.hpp diff --git a/Labirint Game/sfml/include/SFML/Graphics/Glsl.hpp b/Project_Labirint_Game/sfml/include/SFML/Graphics/Glsl.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Graphics/Glsl.hpp rename to Project_Labirint_Game/sfml/include/SFML/Graphics/Glsl.hpp diff --git a/Labirint Game/sfml/include/SFML/Graphics/Glsl.inl b/Project_Labirint_Game/sfml/include/SFML/Graphics/Glsl.inl similarity index 100% rename from Labirint Game/sfml/include/SFML/Graphics/Glsl.inl rename to Project_Labirint_Game/sfml/include/SFML/Graphics/Glsl.inl diff --git a/Labirint Game/sfml/include/SFML/Graphics/Glyph.hpp b/Project_Labirint_Game/sfml/include/SFML/Graphics/Glyph.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Graphics/Glyph.hpp rename to Project_Labirint_Game/sfml/include/SFML/Graphics/Glyph.hpp diff --git a/Labirint Game/sfml/include/SFML/Graphics/Image.hpp b/Project_Labirint_Game/sfml/include/SFML/Graphics/Image.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Graphics/Image.hpp rename to Project_Labirint_Game/sfml/include/SFML/Graphics/Image.hpp diff --git a/Labirint Game/sfml/include/SFML/Graphics/PrimitiveType.hpp b/Project_Labirint_Game/sfml/include/SFML/Graphics/PrimitiveType.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Graphics/PrimitiveType.hpp rename to Project_Labirint_Game/sfml/include/SFML/Graphics/PrimitiveType.hpp diff --git a/Labirint Game/sfml/include/SFML/Graphics/Rect.hpp b/Project_Labirint_Game/sfml/include/SFML/Graphics/Rect.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Graphics/Rect.hpp rename to Project_Labirint_Game/sfml/include/SFML/Graphics/Rect.hpp diff --git a/Labirint Game/sfml/include/SFML/Graphics/Rect.inl b/Project_Labirint_Game/sfml/include/SFML/Graphics/Rect.inl similarity index 100% rename from Labirint Game/sfml/include/SFML/Graphics/Rect.inl rename to Project_Labirint_Game/sfml/include/SFML/Graphics/Rect.inl diff --git a/Labirint Game/sfml/include/SFML/Graphics/RectangleShape.hpp b/Project_Labirint_Game/sfml/include/SFML/Graphics/RectangleShape.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Graphics/RectangleShape.hpp rename to Project_Labirint_Game/sfml/include/SFML/Graphics/RectangleShape.hpp diff --git a/Labirint Game/sfml/include/SFML/Graphics/RenderStates.hpp b/Project_Labirint_Game/sfml/include/SFML/Graphics/RenderStates.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Graphics/RenderStates.hpp rename to Project_Labirint_Game/sfml/include/SFML/Graphics/RenderStates.hpp diff --git a/Labirint Game/sfml/include/SFML/Graphics/RenderTarget.hpp b/Project_Labirint_Game/sfml/include/SFML/Graphics/RenderTarget.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Graphics/RenderTarget.hpp rename to Project_Labirint_Game/sfml/include/SFML/Graphics/RenderTarget.hpp diff --git a/Labirint Game/sfml/include/SFML/Graphics/RenderTexture.hpp b/Project_Labirint_Game/sfml/include/SFML/Graphics/RenderTexture.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Graphics/RenderTexture.hpp rename to Project_Labirint_Game/sfml/include/SFML/Graphics/RenderTexture.hpp diff --git a/Labirint Game/sfml/include/SFML/Graphics/RenderWindow.hpp b/Project_Labirint_Game/sfml/include/SFML/Graphics/RenderWindow.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Graphics/RenderWindow.hpp rename to Project_Labirint_Game/sfml/include/SFML/Graphics/RenderWindow.hpp diff --git a/Labirint Game/sfml/include/SFML/Graphics/Shader.hpp b/Project_Labirint_Game/sfml/include/SFML/Graphics/Shader.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Graphics/Shader.hpp rename to Project_Labirint_Game/sfml/include/SFML/Graphics/Shader.hpp diff --git a/Labirint Game/sfml/include/SFML/Graphics/Shape.hpp b/Project_Labirint_Game/sfml/include/SFML/Graphics/Shape.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Graphics/Shape.hpp rename to Project_Labirint_Game/sfml/include/SFML/Graphics/Shape.hpp diff --git a/Labirint Game/sfml/include/SFML/Graphics/Sprite.hpp b/Project_Labirint_Game/sfml/include/SFML/Graphics/Sprite.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Graphics/Sprite.hpp rename to Project_Labirint_Game/sfml/include/SFML/Graphics/Sprite.hpp diff --git a/Labirint Game/sfml/include/SFML/Graphics/Text.hpp b/Project_Labirint_Game/sfml/include/SFML/Graphics/Text.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Graphics/Text.hpp rename to Project_Labirint_Game/sfml/include/SFML/Graphics/Text.hpp diff --git a/Labirint Game/sfml/include/SFML/Graphics/Texture.hpp b/Project_Labirint_Game/sfml/include/SFML/Graphics/Texture.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Graphics/Texture.hpp rename to Project_Labirint_Game/sfml/include/SFML/Graphics/Texture.hpp diff --git a/Labirint Game/sfml/include/SFML/Graphics/Transform.hpp b/Project_Labirint_Game/sfml/include/SFML/Graphics/Transform.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Graphics/Transform.hpp rename to Project_Labirint_Game/sfml/include/SFML/Graphics/Transform.hpp diff --git a/Labirint Game/sfml/include/SFML/Graphics/Transformable.hpp b/Project_Labirint_Game/sfml/include/SFML/Graphics/Transformable.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Graphics/Transformable.hpp rename to Project_Labirint_Game/sfml/include/SFML/Graphics/Transformable.hpp diff --git a/Labirint Game/sfml/include/SFML/Graphics/Vertex.hpp b/Project_Labirint_Game/sfml/include/SFML/Graphics/Vertex.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Graphics/Vertex.hpp rename to Project_Labirint_Game/sfml/include/SFML/Graphics/Vertex.hpp diff --git a/Labirint Game/sfml/include/SFML/Graphics/VertexArray.hpp b/Project_Labirint_Game/sfml/include/SFML/Graphics/VertexArray.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Graphics/VertexArray.hpp rename to Project_Labirint_Game/sfml/include/SFML/Graphics/VertexArray.hpp diff --git a/Labirint Game/sfml/include/SFML/Graphics/VertexBuffer.hpp b/Project_Labirint_Game/sfml/include/SFML/Graphics/VertexBuffer.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Graphics/VertexBuffer.hpp rename to Project_Labirint_Game/sfml/include/SFML/Graphics/VertexBuffer.hpp diff --git a/Labirint Game/sfml/include/SFML/Graphics/View.hpp b/Project_Labirint_Game/sfml/include/SFML/Graphics/View.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Graphics/View.hpp rename to Project_Labirint_Game/sfml/include/SFML/Graphics/View.hpp diff --git a/Labirint Game/sfml/include/SFML/Main.hpp b/Project_Labirint_Game/sfml/include/SFML/Main.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Main.hpp rename to Project_Labirint_Game/sfml/include/SFML/Main.hpp diff --git a/Labirint Game/sfml/include/SFML/Network.hpp b/Project_Labirint_Game/sfml/include/SFML/Network.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Network.hpp rename to Project_Labirint_Game/sfml/include/SFML/Network.hpp diff --git a/Labirint Game/sfml/include/SFML/Network/Export.hpp b/Project_Labirint_Game/sfml/include/SFML/Network/Export.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Network/Export.hpp rename to Project_Labirint_Game/sfml/include/SFML/Network/Export.hpp diff --git a/Labirint Game/sfml/include/SFML/Network/Ftp.hpp b/Project_Labirint_Game/sfml/include/SFML/Network/Ftp.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Network/Ftp.hpp rename to Project_Labirint_Game/sfml/include/SFML/Network/Ftp.hpp diff --git a/Labirint Game/sfml/include/SFML/Network/Http.hpp b/Project_Labirint_Game/sfml/include/SFML/Network/Http.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Network/Http.hpp rename to Project_Labirint_Game/sfml/include/SFML/Network/Http.hpp diff --git a/Labirint Game/sfml/include/SFML/Network/IpAddress.hpp b/Project_Labirint_Game/sfml/include/SFML/Network/IpAddress.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Network/IpAddress.hpp rename to Project_Labirint_Game/sfml/include/SFML/Network/IpAddress.hpp diff --git a/Labirint Game/sfml/include/SFML/Network/Packet.hpp b/Project_Labirint_Game/sfml/include/SFML/Network/Packet.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Network/Packet.hpp rename to Project_Labirint_Game/sfml/include/SFML/Network/Packet.hpp diff --git a/Labirint Game/sfml/include/SFML/Network/Socket.hpp b/Project_Labirint_Game/sfml/include/SFML/Network/Socket.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Network/Socket.hpp rename to Project_Labirint_Game/sfml/include/SFML/Network/Socket.hpp diff --git a/Labirint Game/sfml/include/SFML/Network/SocketHandle.hpp b/Project_Labirint_Game/sfml/include/SFML/Network/SocketHandle.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Network/SocketHandle.hpp rename to Project_Labirint_Game/sfml/include/SFML/Network/SocketHandle.hpp diff --git a/Labirint Game/sfml/include/SFML/Network/SocketSelector.hpp b/Project_Labirint_Game/sfml/include/SFML/Network/SocketSelector.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Network/SocketSelector.hpp rename to Project_Labirint_Game/sfml/include/SFML/Network/SocketSelector.hpp diff --git a/Labirint Game/sfml/include/SFML/Network/TcpListener.hpp b/Project_Labirint_Game/sfml/include/SFML/Network/TcpListener.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Network/TcpListener.hpp rename to Project_Labirint_Game/sfml/include/SFML/Network/TcpListener.hpp diff --git a/Labirint Game/sfml/include/SFML/Network/TcpSocket.hpp b/Project_Labirint_Game/sfml/include/SFML/Network/TcpSocket.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Network/TcpSocket.hpp rename to Project_Labirint_Game/sfml/include/SFML/Network/TcpSocket.hpp diff --git a/Labirint Game/sfml/include/SFML/Network/UdpSocket.hpp b/Project_Labirint_Game/sfml/include/SFML/Network/UdpSocket.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Network/UdpSocket.hpp rename to Project_Labirint_Game/sfml/include/SFML/Network/UdpSocket.hpp diff --git a/Labirint Game/sfml/include/SFML/OpenGL.hpp b/Project_Labirint_Game/sfml/include/SFML/OpenGL.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/OpenGL.hpp rename to Project_Labirint_Game/sfml/include/SFML/OpenGL.hpp diff --git a/Labirint Game/sfml/include/SFML/System.hpp b/Project_Labirint_Game/sfml/include/SFML/System.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/System.hpp rename to Project_Labirint_Game/sfml/include/SFML/System.hpp diff --git a/Labirint Game/sfml/include/SFML/System/Clock.hpp b/Project_Labirint_Game/sfml/include/SFML/System/Clock.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/System/Clock.hpp rename to Project_Labirint_Game/sfml/include/SFML/System/Clock.hpp diff --git a/Labirint Game/sfml/include/SFML/System/Err.hpp b/Project_Labirint_Game/sfml/include/SFML/System/Err.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/System/Err.hpp rename to Project_Labirint_Game/sfml/include/SFML/System/Err.hpp diff --git a/Labirint Game/sfml/include/SFML/System/Export.hpp b/Project_Labirint_Game/sfml/include/SFML/System/Export.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/System/Export.hpp rename to Project_Labirint_Game/sfml/include/SFML/System/Export.hpp diff --git a/Labirint Game/sfml/include/SFML/System/FileInputStream.hpp b/Project_Labirint_Game/sfml/include/SFML/System/FileInputStream.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/System/FileInputStream.hpp rename to Project_Labirint_Game/sfml/include/SFML/System/FileInputStream.hpp diff --git a/Labirint Game/sfml/include/SFML/System/InputStream.hpp b/Project_Labirint_Game/sfml/include/SFML/System/InputStream.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/System/InputStream.hpp rename to Project_Labirint_Game/sfml/include/SFML/System/InputStream.hpp diff --git a/Labirint Game/sfml/include/SFML/System/Lock.hpp b/Project_Labirint_Game/sfml/include/SFML/System/Lock.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/System/Lock.hpp rename to Project_Labirint_Game/sfml/include/SFML/System/Lock.hpp diff --git a/Labirint Game/sfml/include/SFML/System/MemoryInputStream.hpp b/Project_Labirint_Game/sfml/include/SFML/System/MemoryInputStream.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/System/MemoryInputStream.hpp rename to Project_Labirint_Game/sfml/include/SFML/System/MemoryInputStream.hpp diff --git a/Labirint Game/sfml/include/SFML/System/Mutex.hpp b/Project_Labirint_Game/sfml/include/SFML/System/Mutex.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/System/Mutex.hpp rename to Project_Labirint_Game/sfml/include/SFML/System/Mutex.hpp diff --git a/Labirint Game/sfml/include/SFML/System/NativeActivity.hpp b/Project_Labirint_Game/sfml/include/SFML/System/NativeActivity.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/System/NativeActivity.hpp rename to Project_Labirint_Game/sfml/include/SFML/System/NativeActivity.hpp diff --git a/Labirint Game/sfml/include/SFML/System/NonCopyable.hpp b/Project_Labirint_Game/sfml/include/SFML/System/NonCopyable.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/System/NonCopyable.hpp rename to Project_Labirint_Game/sfml/include/SFML/System/NonCopyable.hpp diff --git a/Labirint Game/sfml/include/SFML/System/Sleep.hpp b/Project_Labirint_Game/sfml/include/SFML/System/Sleep.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/System/Sleep.hpp rename to Project_Labirint_Game/sfml/include/SFML/System/Sleep.hpp diff --git a/Labirint Game/sfml/include/SFML/System/String.hpp b/Project_Labirint_Game/sfml/include/SFML/System/String.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/System/String.hpp rename to Project_Labirint_Game/sfml/include/SFML/System/String.hpp diff --git a/Labirint Game/sfml/include/SFML/System/String.inl b/Project_Labirint_Game/sfml/include/SFML/System/String.inl similarity index 100% rename from Labirint Game/sfml/include/SFML/System/String.inl rename to Project_Labirint_Game/sfml/include/SFML/System/String.inl diff --git a/Labirint Game/sfml/include/SFML/System/Thread.hpp b/Project_Labirint_Game/sfml/include/SFML/System/Thread.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/System/Thread.hpp rename to Project_Labirint_Game/sfml/include/SFML/System/Thread.hpp diff --git a/Labirint Game/sfml/include/SFML/System/Thread.inl b/Project_Labirint_Game/sfml/include/SFML/System/Thread.inl similarity index 100% rename from Labirint Game/sfml/include/SFML/System/Thread.inl rename to Project_Labirint_Game/sfml/include/SFML/System/Thread.inl diff --git a/Labirint Game/sfml/include/SFML/System/ThreadLocal.hpp b/Project_Labirint_Game/sfml/include/SFML/System/ThreadLocal.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/System/ThreadLocal.hpp rename to Project_Labirint_Game/sfml/include/SFML/System/ThreadLocal.hpp diff --git a/Labirint Game/sfml/include/SFML/System/ThreadLocalPtr.hpp b/Project_Labirint_Game/sfml/include/SFML/System/ThreadLocalPtr.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/System/ThreadLocalPtr.hpp rename to Project_Labirint_Game/sfml/include/SFML/System/ThreadLocalPtr.hpp diff --git a/Labirint Game/sfml/include/SFML/System/ThreadLocalPtr.inl b/Project_Labirint_Game/sfml/include/SFML/System/ThreadLocalPtr.inl similarity index 100% rename from Labirint Game/sfml/include/SFML/System/ThreadLocalPtr.inl rename to Project_Labirint_Game/sfml/include/SFML/System/ThreadLocalPtr.inl diff --git a/Labirint Game/sfml/include/SFML/System/Time.hpp b/Project_Labirint_Game/sfml/include/SFML/System/Time.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/System/Time.hpp rename to Project_Labirint_Game/sfml/include/SFML/System/Time.hpp diff --git a/Labirint Game/sfml/include/SFML/System/Utf.hpp b/Project_Labirint_Game/sfml/include/SFML/System/Utf.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/System/Utf.hpp rename to Project_Labirint_Game/sfml/include/SFML/System/Utf.hpp diff --git a/Labirint Game/sfml/include/SFML/System/Utf.inl b/Project_Labirint_Game/sfml/include/SFML/System/Utf.inl similarity index 100% rename from Labirint Game/sfml/include/SFML/System/Utf.inl rename to Project_Labirint_Game/sfml/include/SFML/System/Utf.inl diff --git a/Labirint Game/sfml/include/SFML/System/Vector2.hpp b/Project_Labirint_Game/sfml/include/SFML/System/Vector2.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/System/Vector2.hpp rename to Project_Labirint_Game/sfml/include/SFML/System/Vector2.hpp diff --git a/Labirint Game/sfml/include/SFML/System/Vector2.inl b/Project_Labirint_Game/sfml/include/SFML/System/Vector2.inl similarity index 100% rename from Labirint Game/sfml/include/SFML/System/Vector2.inl rename to Project_Labirint_Game/sfml/include/SFML/System/Vector2.inl diff --git a/Labirint Game/sfml/include/SFML/System/Vector3.hpp b/Project_Labirint_Game/sfml/include/SFML/System/Vector3.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/System/Vector3.hpp rename to Project_Labirint_Game/sfml/include/SFML/System/Vector3.hpp diff --git a/Labirint Game/sfml/include/SFML/System/Vector3.inl b/Project_Labirint_Game/sfml/include/SFML/System/Vector3.inl similarity index 100% rename from Labirint Game/sfml/include/SFML/System/Vector3.inl rename to Project_Labirint_Game/sfml/include/SFML/System/Vector3.inl diff --git a/Labirint Game/sfml/include/SFML/Window.hpp b/Project_Labirint_Game/sfml/include/SFML/Window.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Window.hpp rename to Project_Labirint_Game/sfml/include/SFML/Window.hpp diff --git a/Labirint Game/sfml/include/SFML/Window/Clipboard.hpp b/Project_Labirint_Game/sfml/include/SFML/Window/Clipboard.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Window/Clipboard.hpp rename to Project_Labirint_Game/sfml/include/SFML/Window/Clipboard.hpp diff --git a/Labirint Game/sfml/include/SFML/Window/Context.hpp b/Project_Labirint_Game/sfml/include/SFML/Window/Context.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Window/Context.hpp rename to Project_Labirint_Game/sfml/include/SFML/Window/Context.hpp diff --git a/Labirint Game/sfml/include/SFML/Window/ContextSettings.hpp b/Project_Labirint_Game/sfml/include/SFML/Window/ContextSettings.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Window/ContextSettings.hpp rename to Project_Labirint_Game/sfml/include/SFML/Window/ContextSettings.hpp diff --git a/Labirint Game/sfml/include/SFML/Window/Cursor.hpp b/Project_Labirint_Game/sfml/include/SFML/Window/Cursor.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Window/Cursor.hpp rename to Project_Labirint_Game/sfml/include/SFML/Window/Cursor.hpp diff --git a/Labirint Game/sfml/include/SFML/Window/Event.hpp b/Project_Labirint_Game/sfml/include/SFML/Window/Event.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Window/Event.hpp rename to Project_Labirint_Game/sfml/include/SFML/Window/Event.hpp diff --git a/Labirint Game/sfml/include/SFML/Window/Export.hpp b/Project_Labirint_Game/sfml/include/SFML/Window/Export.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Window/Export.hpp rename to Project_Labirint_Game/sfml/include/SFML/Window/Export.hpp diff --git a/Labirint Game/sfml/include/SFML/Window/GlResource.hpp b/Project_Labirint_Game/sfml/include/SFML/Window/GlResource.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Window/GlResource.hpp rename to Project_Labirint_Game/sfml/include/SFML/Window/GlResource.hpp diff --git a/Labirint Game/sfml/include/SFML/Window/Joystick.hpp b/Project_Labirint_Game/sfml/include/SFML/Window/Joystick.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Window/Joystick.hpp rename to Project_Labirint_Game/sfml/include/SFML/Window/Joystick.hpp diff --git a/Labirint Game/sfml/include/SFML/Window/Keyboard.hpp b/Project_Labirint_Game/sfml/include/SFML/Window/Keyboard.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Window/Keyboard.hpp rename to Project_Labirint_Game/sfml/include/SFML/Window/Keyboard.hpp diff --git a/Labirint Game/sfml/include/SFML/Window/Mouse.hpp b/Project_Labirint_Game/sfml/include/SFML/Window/Mouse.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Window/Mouse.hpp rename to Project_Labirint_Game/sfml/include/SFML/Window/Mouse.hpp diff --git a/Labirint Game/sfml/include/SFML/Window/Sensor.hpp b/Project_Labirint_Game/sfml/include/SFML/Window/Sensor.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Window/Sensor.hpp rename to Project_Labirint_Game/sfml/include/SFML/Window/Sensor.hpp diff --git a/Labirint Game/sfml/include/SFML/Window/Touch.hpp b/Project_Labirint_Game/sfml/include/SFML/Window/Touch.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Window/Touch.hpp rename to Project_Labirint_Game/sfml/include/SFML/Window/Touch.hpp diff --git a/Labirint Game/sfml/include/SFML/Window/VideoMode.hpp b/Project_Labirint_Game/sfml/include/SFML/Window/VideoMode.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Window/VideoMode.hpp rename to Project_Labirint_Game/sfml/include/SFML/Window/VideoMode.hpp diff --git a/Labirint Game/sfml/include/SFML/Window/Window.hpp b/Project_Labirint_Game/sfml/include/SFML/Window/Window.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Window/Window.hpp rename to Project_Labirint_Game/sfml/include/SFML/Window/Window.hpp diff --git a/Labirint Game/sfml/include/SFML/Window/WindowHandle.hpp b/Project_Labirint_Game/sfml/include/SFML/Window/WindowHandle.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Window/WindowHandle.hpp rename to Project_Labirint_Game/sfml/include/SFML/Window/WindowHandle.hpp diff --git a/Labirint Game/sfml/include/SFML/Window/WindowStyle.hpp b/Project_Labirint_Game/sfml/include/SFML/Window/WindowStyle.hpp similarity index 100% rename from Labirint Game/sfml/include/SFML/Window/WindowStyle.hpp rename to Project_Labirint_Game/sfml/include/SFML/Window/WindowStyle.hpp diff --git a/Labirint Game/sfml/lib/cmake/SFML/SFMLConfig.cmake b/Project_Labirint_Game/sfml/lib/cmake/SFML/SFMLConfig.cmake similarity index 100% rename from Labirint Game/sfml/lib/cmake/SFML/SFMLConfig.cmake rename to Project_Labirint_Game/sfml/lib/cmake/SFML/SFMLConfig.cmake diff --git a/Labirint Game/sfml/lib/cmake/SFML/SFMLConfigDependencies.cmake b/Project_Labirint_Game/sfml/lib/cmake/SFML/SFMLConfigDependencies.cmake similarity index 100% rename from Labirint Game/sfml/lib/cmake/SFML/SFMLConfigDependencies.cmake rename to Project_Labirint_Game/sfml/lib/cmake/SFML/SFMLConfigDependencies.cmake diff --git a/Labirint Game/sfml/lib/cmake/SFML/SFMLConfigVersion.cmake b/Project_Labirint_Game/sfml/lib/cmake/SFML/SFMLConfigVersion.cmake similarity index 100% rename from Labirint Game/sfml/lib/cmake/SFML/SFMLConfigVersion.cmake rename to Project_Labirint_Game/sfml/lib/cmake/SFML/SFMLConfigVersion.cmake diff --git a/Labirint Game/sfml/lib/cmake/SFML/SFMLSharedTargets-debug.cmake b/Project_Labirint_Game/sfml/lib/cmake/SFML/SFMLSharedTargets-debug.cmake similarity index 100% rename from Labirint Game/sfml/lib/cmake/SFML/SFMLSharedTargets-debug.cmake rename to Project_Labirint_Game/sfml/lib/cmake/SFML/SFMLSharedTargets-debug.cmake diff --git a/Labirint Game/sfml/lib/cmake/SFML/SFMLSharedTargets-release.cmake b/Project_Labirint_Game/sfml/lib/cmake/SFML/SFMLSharedTargets-release.cmake similarity index 100% rename from Labirint Game/sfml/lib/cmake/SFML/SFMLSharedTargets-release.cmake rename to Project_Labirint_Game/sfml/lib/cmake/SFML/SFMLSharedTargets-release.cmake diff --git a/Labirint Game/sfml/lib/cmake/SFML/SFMLSharedTargets.cmake b/Project_Labirint_Game/sfml/lib/cmake/SFML/SFMLSharedTargets.cmake similarity index 100% rename from Labirint Game/sfml/lib/cmake/SFML/SFMLSharedTargets.cmake rename to Project_Labirint_Game/sfml/lib/cmake/SFML/SFMLSharedTargets.cmake diff --git a/Labirint Game/sfml/lib/cmake/SFML/SFMLStaticTargets-debug.cmake b/Project_Labirint_Game/sfml/lib/cmake/SFML/SFMLStaticTargets-debug.cmake similarity index 100% rename from Labirint Game/sfml/lib/cmake/SFML/SFMLStaticTargets-debug.cmake rename to Project_Labirint_Game/sfml/lib/cmake/SFML/SFMLStaticTargets-debug.cmake diff --git a/Labirint Game/sfml/lib/cmake/SFML/SFMLStaticTargets-release.cmake b/Project_Labirint_Game/sfml/lib/cmake/SFML/SFMLStaticTargets-release.cmake similarity index 100% rename from Labirint Game/sfml/lib/cmake/SFML/SFMLStaticTargets-release.cmake rename to Project_Labirint_Game/sfml/lib/cmake/SFML/SFMLStaticTargets-release.cmake diff --git a/Labirint Game/sfml/lib/cmake/SFML/SFMLStaticTargets.cmake b/Project_Labirint_Game/sfml/lib/cmake/SFML/SFMLStaticTargets.cmake similarity index 100% rename from Labirint Game/sfml/lib/cmake/SFML/SFMLStaticTargets.cmake rename to Project_Labirint_Game/sfml/lib/cmake/SFML/SFMLStaticTargets.cmake diff --git a/Labirint Game/sfml/lib/flac.lib b/Project_Labirint_Game/sfml/lib/flac.lib similarity index 100% rename from Labirint Game/sfml/lib/flac.lib rename to Project_Labirint_Game/sfml/lib/flac.lib diff --git a/Labirint Game/sfml/lib/freetype.lib b/Project_Labirint_Game/sfml/lib/freetype.lib similarity index 100% rename from Labirint Game/sfml/lib/freetype.lib rename to Project_Labirint_Game/sfml/lib/freetype.lib diff --git a/Labirint Game/sfml/lib/ogg.lib b/Project_Labirint_Game/sfml/lib/ogg.lib similarity index 100% rename from Labirint Game/sfml/lib/ogg.lib rename to Project_Labirint_Game/sfml/lib/ogg.lib diff --git a/Labirint Game/sfml/lib/openal32.lib b/Project_Labirint_Game/sfml/lib/openal32.lib similarity index 100% rename from Labirint Game/sfml/lib/openal32.lib rename to Project_Labirint_Game/sfml/lib/openal32.lib diff --git a/Labirint Game/sfml/lib/sfml-audio-d.lib b/Project_Labirint_Game/sfml/lib/sfml-audio-d.lib similarity index 100% rename from Labirint Game/sfml/lib/sfml-audio-d.lib rename to Project_Labirint_Game/sfml/lib/sfml-audio-d.lib diff --git a/Labirint Game/sfml/lib/sfml-audio-d.pdb b/Project_Labirint_Game/sfml/lib/sfml-audio-d.pdb similarity index 100% rename from Labirint Game/sfml/lib/sfml-audio-d.pdb rename to Project_Labirint_Game/sfml/lib/sfml-audio-d.pdb diff --git a/Labirint Game/sfml/lib/sfml-audio-s-d.lib b/Project_Labirint_Game/sfml/lib/sfml-audio-s-d.lib similarity index 100% rename from Labirint Game/sfml/lib/sfml-audio-s-d.lib rename to Project_Labirint_Game/sfml/lib/sfml-audio-s-d.lib diff --git a/Labirint Game/sfml/lib/sfml-audio-s-d.pdb b/Project_Labirint_Game/sfml/lib/sfml-audio-s-d.pdb similarity index 100% rename from Labirint Game/sfml/lib/sfml-audio-s-d.pdb rename to Project_Labirint_Game/sfml/lib/sfml-audio-s-d.pdb diff --git a/Labirint Game/sfml/lib/sfml-audio-s.lib b/Project_Labirint_Game/sfml/lib/sfml-audio-s.lib similarity index 100% rename from Labirint Game/sfml/lib/sfml-audio-s.lib rename to Project_Labirint_Game/sfml/lib/sfml-audio-s.lib diff --git a/Labirint Game/sfml/lib/sfml-audio.lib b/Project_Labirint_Game/sfml/lib/sfml-audio.lib similarity index 100% rename from Labirint Game/sfml/lib/sfml-audio.lib rename to Project_Labirint_Game/sfml/lib/sfml-audio.lib diff --git a/Labirint Game/sfml/lib/sfml-graphics-d.lib b/Project_Labirint_Game/sfml/lib/sfml-graphics-d.lib similarity index 100% rename from Labirint Game/sfml/lib/sfml-graphics-d.lib rename to Project_Labirint_Game/sfml/lib/sfml-graphics-d.lib diff --git a/Labirint Game/sfml/lib/sfml-graphics-d.pdb b/Project_Labirint_Game/sfml/lib/sfml-graphics-d.pdb similarity index 100% rename from Labirint Game/sfml/lib/sfml-graphics-d.pdb rename to Project_Labirint_Game/sfml/lib/sfml-graphics-d.pdb diff --git a/Labirint Game/sfml/lib/sfml-graphics-s-d.lib b/Project_Labirint_Game/sfml/lib/sfml-graphics-s-d.lib similarity index 100% rename from Labirint Game/sfml/lib/sfml-graphics-s-d.lib rename to Project_Labirint_Game/sfml/lib/sfml-graphics-s-d.lib diff --git a/Labirint Game/sfml/lib/sfml-graphics-s-d.pdb b/Project_Labirint_Game/sfml/lib/sfml-graphics-s-d.pdb similarity index 100% rename from Labirint Game/sfml/lib/sfml-graphics-s-d.pdb rename to Project_Labirint_Game/sfml/lib/sfml-graphics-s-d.pdb diff --git a/Labirint Game/sfml/lib/sfml-graphics-s.lib b/Project_Labirint_Game/sfml/lib/sfml-graphics-s.lib similarity index 100% rename from Labirint Game/sfml/lib/sfml-graphics-s.lib rename to Project_Labirint_Game/sfml/lib/sfml-graphics-s.lib diff --git a/Labirint Game/sfml/lib/sfml-graphics.lib b/Project_Labirint_Game/sfml/lib/sfml-graphics.lib similarity index 100% rename from Labirint Game/sfml/lib/sfml-graphics.lib rename to Project_Labirint_Game/sfml/lib/sfml-graphics.lib diff --git a/Labirint Game/sfml/lib/sfml-main-d.lib b/Project_Labirint_Game/sfml/lib/sfml-main-d.lib similarity index 100% rename from Labirint Game/sfml/lib/sfml-main-d.lib rename to Project_Labirint_Game/sfml/lib/sfml-main-d.lib diff --git a/Labirint Game/sfml/lib/sfml-main-s-d.pdb b/Project_Labirint_Game/sfml/lib/sfml-main-s-d.pdb similarity index 100% rename from Labirint Game/sfml/lib/sfml-main-s-d.pdb rename to Project_Labirint_Game/sfml/lib/sfml-main-s-d.pdb diff --git a/Labirint Game/sfml/lib/sfml-main.lib b/Project_Labirint_Game/sfml/lib/sfml-main.lib similarity index 100% rename from Labirint Game/sfml/lib/sfml-main.lib rename to Project_Labirint_Game/sfml/lib/sfml-main.lib diff --git a/Labirint Game/sfml/lib/sfml-network-d.lib b/Project_Labirint_Game/sfml/lib/sfml-network-d.lib similarity index 100% rename from Labirint Game/sfml/lib/sfml-network-d.lib rename to Project_Labirint_Game/sfml/lib/sfml-network-d.lib diff --git a/Labirint Game/sfml/lib/sfml-network-d.pdb b/Project_Labirint_Game/sfml/lib/sfml-network-d.pdb similarity index 100% rename from Labirint Game/sfml/lib/sfml-network-d.pdb rename to Project_Labirint_Game/sfml/lib/sfml-network-d.pdb diff --git a/Labirint Game/sfml/lib/sfml-network-s-d.lib b/Project_Labirint_Game/sfml/lib/sfml-network-s-d.lib similarity index 100% rename from Labirint Game/sfml/lib/sfml-network-s-d.lib rename to Project_Labirint_Game/sfml/lib/sfml-network-s-d.lib diff --git a/Labirint Game/sfml/lib/sfml-network-s-d.pdb b/Project_Labirint_Game/sfml/lib/sfml-network-s-d.pdb similarity index 100% rename from Labirint Game/sfml/lib/sfml-network-s-d.pdb rename to Project_Labirint_Game/sfml/lib/sfml-network-s-d.pdb diff --git a/Labirint Game/sfml/lib/sfml-network-s.lib b/Project_Labirint_Game/sfml/lib/sfml-network-s.lib similarity index 100% rename from Labirint Game/sfml/lib/sfml-network-s.lib rename to Project_Labirint_Game/sfml/lib/sfml-network-s.lib diff --git a/Labirint Game/sfml/lib/sfml-network.lib b/Project_Labirint_Game/sfml/lib/sfml-network.lib similarity index 100% rename from Labirint Game/sfml/lib/sfml-network.lib rename to Project_Labirint_Game/sfml/lib/sfml-network.lib diff --git a/Labirint Game/sfml/lib/sfml-system-d.lib b/Project_Labirint_Game/sfml/lib/sfml-system-d.lib similarity index 100% rename from Labirint Game/sfml/lib/sfml-system-d.lib rename to Project_Labirint_Game/sfml/lib/sfml-system-d.lib diff --git a/Labirint Game/sfml/lib/sfml-system-d.pdb b/Project_Labirint_Game/sfml/lib/sfml-system-d.pdb similarity index 100% rename from Labirint Game/sfml/lib/sfml-system-d.pdb rename to Project_Labirint_Game/sfml/lib/sfml-system-d.pdb diff --git a/Labirint Game/sfml/lib/sfml-system-s-d.lib b/Project_Labirint_Game/sfml/lib/sfml-system-s-d.lib similarity index 100% rename from Labirint Game/sfml/lib/sfml-system-s-d.lib rename to Project_Labirint_Game/sfml/lib/sfml-system-s-d.lib diff --git a/Labirint Game/sfml/lib/sfml-system-s-d.pdb b/Project_Labirint_Game/sfml/lib/sfml-system-s-d.pdb similarity index 100% rename from Labirint Game/sfml/lib/sfml-system-s-d.pdb rename to Project_Labirint_Game/sfml/lib/sfml-system-s-d.pdb diff --git a/Labirint Game/sfml/lib/sfml-system-s.lib b/Project_Labirint_Game/sfml/lib/sfml-system-s.lib similarity index 100% rename from Labirint Game/sfml/lib/sfml-system-s.lib rename to Project_Labirint_Game/sfml/lib/sfml-system-s.lib diff --git a/Labirint Game/sfml/lib/sfml-system.lib b/Project_Labirint_Game/sfml/lib/sfml-system.lib similarity index 100% rename from Labirint Game/sfml/lib/sfml-system.lib rename to Project_Labirint_Game/sfml/lib/sfml-system.lib diff --git a/Labirint Game/sfml/lib/sfml-window-d.lib b/Project_Labirint_Game/sfml/lib/sfml-window-d.lib similarity index 100% rename from Labirint Game/sfml/lib/sfml-window-d.lib rename to Project_Labirint_Game/sfml/lib/sfml-window-d.lib diff --git a/Labirint Game/sfml/lib/sfml-window-d.pdb b/Project_Labirint_Game/sfml/lib/sfml-window-d.pdb similarity index 100% rename from Labirint Game/sfml/lib/sfml-window-d.pdb rename to Project_Labirint_Game/sfml/lib/sfml-window-d.pdb diff --git a/Labirint Game/sfml/lib/sfml-window-s-d.lib b/Project_Labirint_Game/sfml/lib/sfml-window-s-d.lib similarity index 100% rename from Labirint Game/sfml/lib/sfml-window-s-d.lib rename to Project_Labirint_Game/sfml/lib/sfml-window-s-d.lib diff --git a/Labirint Game/sfml/lib/sfml-window-s-d.pdb b/Project_Labirint_Game/sfml/lib/sfml-window-s-d.pdb similarity index 100% rename from Labirint Game/sfml/lib/sfml-window-s-d.pdb rename to Project_Labirint_Game/sfml/lib/sfml-window-s-d.pdb diff --git a/Labirint Game/sfml/lib/sfml-window-s.lib b/Project_Labirint_Game/sfml/lib/sfml-window-s.lib similarity index 100% rename from Labirint Game/sfml/lib/sfml-window-s.lib rename to Project_Labirint_Game/sfml/lib/sfml-window-s.lib diff --git a/Labirint Game/sfml/lib/sfml-window.lib b/Project_Labirint_Game/sfml/lib/sfml-window.lib similarity index 100% rename from Labirint Game/sfml/lib/sfml-window.lib rename to Project_Labirint_Game/sfml/lib/sfml-window.lib diff --git a/Labirint Game/sfml/lib/vorbis.lib b/Project_Labirint_Game/sfml/lib/vorbis.lib similarity index 100% rename from Labirint Game/sfml/lib/vorbis.lib rename to Project_Labirint_Game/sfml/lib/vorbis.lib diff --git a/Labirint Game/sfml/lib/vorbisenc.lib b/Project_Labirint_Game/sfml/lib/vorbisenc.lib similarity index 100% rename from Labirint Game/sfml/lib/vorbisenc.lib rename to Project_Labirint_Game/sfml/lib/vorbisenc.lib diff --git a/Labirint Game/sfml/lib/vorbisfile.lib b/Project_Labirint_Game/sfml/lib/vorbisfile.lib similarity index 100% rename from Labirint Game/sfml/lib/vorbisfile.lib rename to Project_Labirint_Game/sfml/lib/vorbisfile.lib diff --git a/New Year Congratulation/new_year.cpp b/Project_New_Year_Congratulation/new_year.cpp similarity index 100% rename from New Year Congratulation/new_year.cpp rename to Project_New_Year_Congratulation/new_year.cpp diff --git a/New Year Congratulation/only_numbers.cpp b/Project_New_Year_Congratulation/only_numbers.cpp similarity index 100% rename from New Year Congratulation/only_numbers.cpp rename to Project_New_Year_Congratulation/only_numbers.cpp diff --git a/Quiz Game/quiz-game-with-oop.cpp b/Project_Quiz_Game/quiz-game-with-oop.cpp similarity index 100% rename from Quiz Game/quiz-game-with-oop.cpp rename to Project_Quiz_Game/quiz-game-with-oop.cpp diff --git a/Quiz Game/quiz-game.cpp b/Project_Quiz_Game/quiz-game.cpp similarity index 100% rename from Quiz Game/quiz-game.cpp rename to Project_Quiz_Game/quiz-game.cpp diff --git a/Snake Game/snake-game.cpp b/Project_Snake_Game/snake-game.cpp similarity index 100% rename from Snake Game/snake-game.cpp rename to Project_Snake_Game/snake-game.cpp diff --git a/README.md b/README.md index b99bdf1..0a40ab1 100644 --- a/README.md +++ b/README.md @@ -1,136 +1,303 @@ # C++ Programming -``` -Tips for Learning Programming -1. Learn and code every day, consistency is important. -2. Write it out — plan your code before you move to the computer. Take small notes. -3. Learn debugging your code — see line by line how your code works. Try it on Visual Studio. -4. Surround yourself with others who are learning. Teach to each other. -5. Learn asking GOOD questions. - - G: Give context on what you are trying to do, clearly describing the problem. - - O: Outline the things you have already tried to fix the issue. - - O: Offer your best guess as to what the problem might be. This helps the person who is helping you to not only know what you are thinking, but also know that you have done some thinking on your own. - - D: Demo what is happening. Include the code, a traceback error message, and an explanation of the steps you executed that resulted in the error. This way, the person helping does not have to try to recreate the issue. -6. Build something, anything. For example, simple calculator, or program to save and read data from TXT files. -7. Focus on 1 thing! Take small steps, but every day, consistency is very important. -``` -## Contents: +## Contents +- [Tips](#keep-these-tips-in-mind-while-learning-programming) - [Computer Science Basics](#computer-science-basics) - [Learning Resources](#learning-resources) - [Problem Solving](#problem-solving) - [Projects Ideas](#projects-ideas) +## Keep These Tips in Mind While Learning Programming +``` +1. Learn and code every day, consistency is important. +2. Write it down - plan your code before you start coding and understand the input to your program and the output from your code. +3. Learn to debug your code - look at the code line by line to see how it works. +4. Surround yourself with other people who are learning. Teach each other. +5. Learn taking notes. +6. Build something, anything you would enjoy while coding. Be unique. +7. Focus on 1 thing! Take small steps, but every day, consistency is very important again. +8. Learn to ask GOOD questions to others: + - G: Give context on what you are trying to do, clearly describing the problem. + - O: Outline the things you have already tried to fix the issue. + - O: Offer your best guess as to what the problem might be. It helps the person who is helping you not only know what you're thinking but also know that you've thought of something yourself. + - D: Demonstrate what's going on. Include the code, the tracing error message, and an explanation of the steps you followed that resulted in the error. That way, the person helping doesn't have to try to recreate the problem. +``` + ## Computer Science Basics - [Harvard CS50](https://youtube.com/playlist?list=PLhQjrBD2T383f9scHRNYJkior2VvYjpSL) - Scratch, C, Arrays, Algorithms, Memory, Data structures, Python, SQL, HTML, CSS, JavaScript, Flask -- `Optional` [Crash Course Computer Science](https://www.youtube.com/playlist?list=PL8dPuuaLjXtNlUrzyH5r6jN9ulIgZBpdo) +- [Crash Course Computer Science](https://www.youtube.com/playlist?list=PL8dPuuaLjXtNlUrzyH5r6jN9ulIgZBpdo) - [Computer Science for Everyone](https://www.youtube.com/playlist?list=PLrC-HcVNfULbGKkhJSgfqvqmaFAZvfHes) +- [Book "Everything You Need to Ace Computer Science ..."](https://www.amazon.com/Everything-Computer-Science-Coding-Notebook/dp/1523502770) + ## Learning Resources -- EN [C++ for beginners — CodeBeauty](https://www.youtube.com/playlist?list=PL43pGnjiVwgQHLPnuH9ch-LhZdwckM8Tq) -- EN [C++ Programming Tutorial — thenewboston](https://www.youtube.com/playlist?list=PLAE85DE8440AA6B83) -- EN [C++ by The Cherno](https://www.youtube.com/watch?v=18c3MTX0PK0&list=PLlrATfBNZ98dudnM48yfGUldqGD0S4FFb) -- EN [C++ by freeCodeCamp.org](https://www.youtube.com/watch?v=vLnPwxZdW4Y) +- [C++ for beginners — CodeBeauty](https://www.youtube.com/playlist?list=PL43pGnjiVwgQHLPnuH9ch-LhZdwckM8Tq) +- [C++ Programming Tutorial — thenewboston](https://www.youtube.com/playlist?list=PLAE85DE8440AA6B83) +- [C++ by The Cherno](https://www.youtube.com/watch?v=18c3MTX0PK0&list=PLlrATfBNZ98dudnM48yfGUldqGD0S4FFb) +- [C++ by freeCodeCamp.org](https://www.youtube.com/watch?v=vLnPwxZdW4Y) - RU [C++ by Denis Markov](https://www.youtube.com/playlist?list=PLbmlzoDQrXVFC13GjpPrJxl6mzTiX65gs) - RU [C++ Уроки - Гоша Дударь](https://www.youtube.com/watch?v=qSHP98i9mDU&list=PL0lO_mIqDDFXNfqIL9PHQM7Wg_kOtDZsW) - To read: - - [cplusplus.com](https://cplusplus.com/doc/tutorial/) - - [w3schools.com](https://www.w3schools.com/cpp/default.asp) + - [w3schools.com](https://www.w3schools.com/cpp/default.asp) + - [javatpoint.com](https://www.javatpoint.com/cpp-tutorial) - [tutorialspoint.com](https://www.tutorialspoint.com/cplusplus/index.htm) - - [GeegsForGeeks.org](https://www.geeksforgeeks.org/c-plus-plus/): - + - [cplusplus.com](https://cplusplus.com/doc/tutorial/) + - [learncpp.com](https://www.learncpp.com/) + ## Problem Solving -``` -1. C++ Program to print "Hello, World!" -2. C++ Program to Print an Integer (Entered by the User) -3. C++ Program to Add Two Integers -4. C++ Program to Multiply two Floating Point Numbers -5. C++ Program to Find ASCII Value of a Character -6. C++ Program to Compute Quotient and Remainder -7. C++ Program to Find the Size of int, float, double and char -8. C++ Program to Demonstrate the Working of Keyword long -9. C++ Program to Swap Two Numbers -10. C++ Program to Check Whether a Number is Even or Odd -11. C++ Program to Check Whether a Character is Vowel or Consonant -12. C++ Program to Find the Largest Number Among Three Numbers -13. C++ Program to Find all Roots of a Quadratic equation -14. C++ Program to Check Leap Year -15. C++ Program to Check Whether a Number is Positive or Negative -16. C++ Program to Check Whether a Character is an Alphabet or not -17. C++ Program to Calculate the Sum of Natural Numbers -18. C++ Program to Find Factorial of a Number -19. C++ Program to Generate Multiplication Table -20. C++ Program to Display Fibonacci Sequence -21. C++ Program to Find GCD of two Numbers -22. C++ Program to Find LCM of two Numbers -23. C++ Program to Display Characters from A to Z Using Loop -24. C++ Program to Count Number of Digits in an Integer -25. C++ Program to Reverse a Number -26. C++ Program to Calculate the Power of a Number -27. C++ Program to Check Whether a Number is Palindrome or Not -28. C++ Program to Check Whether a Number is Prime or Not -29. C++ Program to Display Prime Numbers Between Two Intervals -30. C++ Program to Check Armstrong Number -31. C++ Program to Display Armstrong Number Between Two Intervals -32. C++ Program to Display Factors of a Number -33. C++ Programming Code To Create Pyramid and Structure -34. C++ Program to Make a Simple Calculator Using switch...case -35. C++ Program to Display Prime Numbers Between Intervals Using Function -36. C++ Program to Check Prime or Armstrong Number Using User-defined Function -37. C++ Program to Check Whether a Number can be Expressed as Sum of Two Prime Numbers -38. C++ Program to Find the Sum of Natural Numbers using Recursion -39. C++ Program to Find Factorial of a Number Using Recursion -40. C++ Program to Find G.C.D Using Recursion -41. C++ Program to Convert Binary Number to Decimal and vice-versa -42. C++ Program to Convert Octal Number to Decimal and vice-versa -43. C++ Program to Convert Binary Number to Octal and vice-versa -44. C++ Program to Reverse a Sentence Using Recursion -45. C++ Program to calculate the power using recursion -46. C++ Program to Calculate Average Using Arrays -47. C++ Program to Find Largest Element of an Array -48. C++ Program to Calculate Standard Deviation -49. C++ Program to Add Two Matrix Using Multi-dimensional Arrays -50. C++ Program to Multiply to Matrix Using Multi-dimensional Arrays -51. C++ Program to Find Transpose of a Matrix -52. C++ Program to Multiply two Matrices by Passing Matrix to a Function -53. C++ Program to Access Elements of an Array Using Pointer -54. C++ Program Swap Numbers in Cyclic Order Using Call by Reference -55. C++ Program to Find Largest Number Using Dynamic Memory Allocation -56. C++ Program to Find the Frequency of Characters in a String -57. C++ Program to count the number of vowels, consonants and so on -58. C++ Program to Remove all Characters in a String Except Alphabet -59. C++ Program to Find the Length of a String -60. C++ Program to Concatenate Two Strings -61. C++ Program to Copy String Without Using strcpy() -62. C++ Program to Sort Elements in Lexicographical Order (Dictionary Order) -63. C++ Program to Store Information(name, roll and marks) of a Student Using Structure -64. C++ Program to Add Two Distances (in inch-feet) System Using Structures -65. C++ Program to Add Two Complex Numbers by Passing Structure to a Function -66. C++ Program to Calculate Difference Between Two Time Periods -67. C++ Program to Store Information of Students Using Structure -68. C++ Program to Store Information Using Structures with Dynamically Memory Allocation -69. C++ Program to Write a Sentence to a File -70. C++ Program to Read a Line From a File and Display it -71. C++ Program to Display its own Source Code as Output -72. C++ Programming Code To Create Pyramid and Pattern -``` +1. C++ Program to print "Hello, World!". +2. C++ Program to print an integer entered by the user. +3. C++ Program to Add/Subtract/Multiply/Divide Two Integers. +4. C++ Program to Add/Subtract/Multiply/Divide Two Integers entered by the user. +5. C++ Program to Add/Subtract/Multiply/Divide two Floating Point Numbers. +6. C++ Program to Compute Quotient and Remainder. +7. C++ Program to Calculate the Area and Circumference of a Circle. +8. C++ Program to Calculate the Area of a Scalene Triangle. +9. C++ Program to Calculate the Area of an Equilateral Triangle. +10. C++ Program to Calculate the Area of Right Angle Triangle. +11. C++ Program to Calculate the Area and Perimeter of a Rectangle. +12. C++ Program to Calculate the Area and Perimeter of a Square. +13. C++ Program to Find ASCII Value of a Character. +14. C++ Program to Find the Size of int, float, double, and char. +15. C++ Program to Swap Two Numbers. +16. C++ program that converts between Celsius and Fahrenheit temperatures based on user input. You can also add conversions for Kelvin. +17. C++ Program to Check Whether a Number is Even or Odd. +18. C++ Program to Check Whether a Number is Positive or Negative. +19. C++ Program to Check Whether a Character is a Vowel or Consonant. +20. C++ Program to find the Largest Number Among Three Numbers. +21. C++ Program to find if the entered year is a leap year or not. +22. C++ program that allows the user to perform basic arithmetic operations (addition, subtraction, multiplication, division) on two numbers. You can also add error handling for division by zero. +23. BMI Calculator: Create a program that calculates a person's Body Mass Index (BMI) based on their weight and height input. Provide a classification of whether the person is underweight, normal weight, overweight, or obese. Use cin, cout. + Formula: bmi = weight / (height * height) + + | bmi < 18.5 | Underweight | + | --- | --- | + | bmi < 24.9 | Normal Weight | + | bmi < 29.9 | Overweight | + | Otherwise | Obese | +24. Nested condition + - Get the `age` and `membership_status` as user input. `membership_status` can be only `Y` or `y`. So, if the age is bigger or equal to 18 and if the user is a member of our shop, we provide a 10% discount, else we charge fully. + - Write a simple chatbot program using nested conditions. +25. Write a program to calculate taxes, with the following conditions: + - If the salary is less than $1500, then there are no taxes + - If the salary is from 1501 to 3000 $ (1501<= salary < 3000) then the tax should be 10% + - If the salary is from 3001 to 5000 $ (3001 <= salary < 5000) then the tax should be 20% + - If the salary is above $5000, then the tax should be 30% + + **Hint: Formula for finding tax (salary * percentage) / 100** + + You must output: + - Tax percentage + - Salary after taxes +26. Switch: + - Program to use `switch` statement. Display Monday to Sunday. + - Program to display arithmetic operator using switch case. +27. C++ Program to Find all Roots of a Quadratic equation. +28. C++ Program to Check Whether a Character is an Alphabet or not. + +28. C++ Program to Calculate the Sum of Natural Numbers. +29. Program to calculate the sum of numbers from m to n. + - Hint: Input two numbers m and n. Find the sum of all numbers from m to n. For example m=3 and n=8 then sum will be 3 + 4 + 5 + 6 + 7 + 8 = 33. +30. Program to print Fibonacci series up to 100. + - Hint: Fibonacci Series is 1, 1, 2, 3, 5, 8, 13, 21, ... +31. C++ program to print Even numbers up to 100. +32. C++ program to Generate a Multiplication Table. +33. C++ program to Calculate the Power of a Number. +34. **Factorial Calculator:** Write a program that calculates the factorial of a given positive integer. Factorial of a number is the product of all positive integers from 1 to that number. +35. **Prime Number Checker:** Create a program that determines whether a given number is prime or not. A prime number is a positive integer greater than 1 that has no positive divisors other than 1 and itself. +36. C++ Program to Display Prime Numbers Between Two Intervals. +37. Program to print stars Sequence1. + + ```cpp + * + ** + *** + **** + ***** + ``` + +38. Program to print stars Sequence2. + + ```cpp + * + ** + *** + **** + ***** + ``` + +39. Program to print star Sequences3. + + ```cpp + * + *** + ***** + ``` + +40. Program to print Sequence4. + + ```cpp + * + ** + *** + **** + ***** + ***** + **** + *** + ** + * + ``` +41. Sum of Numbers: Write a program that prompts the user for an integer n and then calculates the sum of all integers from 1 to n using a for or while loop. Also, calculate the sum of all even and odd numbers. +42. Guess the Number Game: Create a simple game where the program picks a number (int number = 42;), and the user has to guess the number, receiving hints (higher or lower). Use a while loop to handle the game process. If the user guesses the number, stop the program and display the number of attempts made by the user. +43. User Menu Interaction: Create a text menu that provides the user with several options (e.g., "1. Perform action 1", "2. Perform action 2," and so on). Use a while loop to continue the program until the user chooses the exit option (system("exit");). +44. Program to display the series and find the sum of 1 + 3 + 5 + ... + n. +45. Program to display the sum of the series 1 + 1/2 + 1/3 + ... + 1/n. +46. Write a program to add the first seven terms of the following series using a for loop: 1/1! + 2/2! + 3/3! + ... +47. C++ Program to Find GCD of Two Numbers. +48. C++ Program to Find LCM of Two Numbers. +49. C++ Program to Display Characters from A to Z Using Loop. +50. C++ Program to Count Number of Digits in an Integer. +51. C++ Program to Reverse a Number. +52. C++ Program to Calculate the Power of a Number. +54. C++ Program to Check Whether a Number is Palindrome or Not. +54. C++ Program to Check Armstrong Number. +55. C++ Program to Display Armstrong Number Between Two Intervals. +56. C++ Program to Convert Binary Number to Decimal and vice-versa. +57. C++ Program to Convert Octal Number to Decimal and vice-versa. +58. C++ Program to Convert Binary Numbers to Octal and vice-versa. + +59. C++ Program to Reverse a Sentence using recursion function. +50. C++ Program to calculate the power using recursion function. +51. Build a program for calculating the area and perimeter of various geometric shapes (circle, rectangle, triangle, etc.) using separate functions for each shape. +52. Simple Calculator Program: Create a program that acts as a basic calculator, allowing users to perform addition, subtraction, multiplication, and division. Use functions for each operation. +53. Write a program to swap two values using functions. +54. Write a program to convert time to minutes using functions. (input 3 variables namely hours, minutes, and seconds. Convert everything into minutes.) +55. Write a program to sum the Fibonacci series up to n (input n). 1, 1, 2, 3, 5, 8, 13, +56. Function Overloading and Default Arguments: Build a program for calculating the area and perimeter of various geometric shapes (circle, rectangle, triangle, etc.) using separate functions for each shape. Overload functions for shapes with different parameters. +57. Employee Payroll: ****Design a program that calculates employee payroll, including basic salary, overtime pay, and deductions. Use functions to compute each component. +57. Temperature in °C can be converted to °F using this formula: °F = (°C x 9/5) + 32. Write a function which converts °C to °F, convert_celsius_to-fahrenheit. +57. Write a function called check-season, it takes a month parameter and returns the season: Autumn, Winter, Spring or Summer. +58. Write a function called calculate_slope which return the slope of a linear equation. +58. **Student Grade Tracker:** Create a program that allows teachers to enter student grades and calculate averages, find the highest and lowest scores, and display statistics. +59. **Library Management System:** Create a simple library management system where you can store and manage a list of books using arrays. Ask the user to enter the book names. You should have the function display the book names. Create a `void` function. You should have the functionality to update the book name. To do this create another function. And pass index as argument. +60. Write a function to merge two arrays. +61. Write a function to search the value in the array and return its index, if the value is not found print “Item not found”. +62. **Number Sorting:** Write a program that reads a list of numbers into an array and sorts them in ascending or descending order using a sorting algorithm. +63. **Matrix Operations:** Write a program for basic matrix operations, such as addition, subtraction, multiplication, and transposition. +64. In a small company, there are five salesmen. Each salesman is supposed to sell three products. Write a program using a 2D array to print **(Input from user)**. The total sales by each salesman and Total sales of each item. +65. C++ Program to Calculate Standard Deviation. + +67. C++ Program to Access Elements of an Array Using Pointer. +68. Write a program that declares an integer variable, assigns a value to it, and then uses a pointer to print the value. +69. Swap the values of two integer variables using pointers. +70. Write a program that finds the sum of elements in an integer array using a pointer. +71. Create a dynamic integer array and prompt the user for the array size. Fill the array with user input values. + +62. C++ Program to Find Largest Number Using Dynamic Memory Allocation. +63. C++ Program to Find the Frequency of Characters in a String. +64. C++ Program to count the number of vowels, consonants, and so on. +65. C++ Program to Remove all Characters in a String Except Alphabet. +66. C++ Program to Find the Length of a String. +67. C++ Program to Concatenate Two Strings. +68. C++ Program to Copy String Without Using `strcpy()`. +69. C++ Program to Sort Elements in Lexicographical Order (Dictionary Order). +70. C++ Program to Store Information(name, roll, and marks) of a Student Using Structure. +71. C++ Program to Add Two Distances (in inch-feet) System Using Structures. +72. C++ Program to Add Two Complex Numbers by Passing Structure to a Function. +73. C++ Program to Calculate Difference Between Two Time Periods. +74. C++ Program to Store Information of Students Using Structure. +75. C++ Program to Store Information Using Structures with Dynamically Memory Allocation. +76. C++ Program to Write a Sentence to a File. +77. C++ Program to Read a Line From a File and Display it. +78. C++ Program to Display its own Source Code as Output. + +80. [OOP] Define a class called **`Car`** with attributes like **`model`**, and **`year`**. Create an object of the **`Car`** class and set its attributes. Then, print out the car's details. +81. [OOP] Redo the same program above using `this->` +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 in different flights for different destinations all over the world, cancellation of tickets, clear display of cancellation amount, refund of 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 amount charged.) -3. Taxi/cab sharing -4. University education portal (providing all information about under-graduate, post graduate and doctoral programs offered, facilities available, location & map, fee structure in all the universities) -5. Online exam management system (with total security of identifying the students during exam, monitoring the students’ 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) +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 builtin security +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) +15. Online shopping and delivery system (like Amazon) 16. Online car shopping 17. Tourism portal 18. World tourism portal @@ -146,19 +313,34 @@ Tips for Learning Programming 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 +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 +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 +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 country) +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) +