Skip to content

Commit 508627c

Browse files
Update
1 parent f791f7f commit 508627c

File tree

152 files changed

+79
-82
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+79
-82
lines changed

.DS_Store

2 KB
Binary file not shown.

.vscode/settings.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"files.associations": {
3+
"ostream": "cpp"
4+
}
5+
}

Algorithms/.DS_Store

2 KB
Binary file not shown.
0 Bytes
Binary file not shown.

Algorithms/BinarySearch/.DS_Store

0 Bytes
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

OOP/ Lab3 /Weekdays.cpp

-44
This file was deleted.

OOP/ Lab3 /mn.cpp

-25
This file was deleted.

OOP/ Lab3/README.md

-13
This file was deleted.

OOP/.DS_Store

8 KB
Binary file not shown.
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#include <iostream>
2+
3+
class Shape {
4+
public:
5+
virtual double area() const {
6+
return 0.0;
7+
}
8+
};
9+
10+
class Circle : public Shape {
11+
private:
12+
double radius;
13+
public:
14+
Circle(double r) : radius(r) {}
15+
double area() const override {
16+
return 3.14 * radius * radius;
17+
}
18+
};
19+
20+
class Rectangle : public Shape {
21+
private:
22+
double length;
23+
double width;
24+
public:
25+
Rectangle(double l, double w) : length(l), width(w) {}
26+
double area() const override {
27+
return length * width;
28+
}
29+
};
30+
31+
int main() {
32+
Circle circle(5.0);
33+
Rectangle rectangle(4.0, 6.0);
34+
std::cout << "Area of the circle: " << circle.area() << std::endl;
35+
std::cout << "Area of the rectangle: " << rectangle.area() << std::endl;
36+
return 0;
37+
}

OOP/Labs/.DS_Store

6 KB
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

OOP/typesofinheritance 2.cpp

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#include <iostream>
2+
3+
class Shape {
4+
public:
5+
virtual double area() const {
6+
return 0.0;
7+
}
8+
};
9+
10+
class Circle : public Shape {
11+
private:
12+
double radius;
13+
public:
14+
Circle(double r) : radius(r) {}
15+
double area() const override {
16+
return 3.14 * radius * radius;
17+
}
18+
};
19+
20+
class Rectangle : public Shape {
21+
private:
22+
double length;
23+
double width;
24+
public:
25+
Rectangle(double l, double w) : length(l), width(w) {}
26+
double area() const override {
27+
return length * width;
28+
}
29+
};
30+
31+
int main() {
32+
Circle circle(5.0);
33+
Rectangle rectangle(4.0, 6.0);
34+
std::cout << "Area of the circle: " << circle.area() << std::endl;
35+
std::cout << "Area of the rectangle: " << rectangle.area() << std::endl;
36+
return 0;
37+
}

0 commit comments

Comments
 (0)