Assignment No 2
Assignment No 2
// SAP ID : 70110717
TASK NO 1:
//#include <iostream>
//class Circle {
//private:
// double x;
// double y;
// double radius;
//
//public:
//
//
//
// this->x = x;
// this->y = y;
// }
//
// }
//
// return x;
// }
//
// return y;
// }
//
// return radius;
// }
//
// }
//
// }
//
// ~Circle() {
// std::cout << "Circle with center at (" << x << "," << y << ") radius=" << radius << " is destroyed" <<
std::endl;
// }
//};
//
//int main() {
// Circle circle1;
//
// circle2.SetCenter(5, 6);
// circle3.SetRadius(10);
//
// std::cout << "Area of circle1: " << circle1.GetArea() << ", Circumference: " <<
circle1.GetCircumference() << std::endl;
// std::cout << "Area of circle2: " << circle2.GetArea() << ", Circumference: " <<
circle2.GetCircumference() << std::endl;
// std::cout << "Area of circle3: " << circle3.GetArea() << ", Circumference: " <<
circle3.GetCircumference() << std::endl;
//
// return 0;
//}
TASK NO 2:
//#include <iostream>
//
//class Vehicle {
//protected:
// string manufacturer;
// int cylinders;
// string owner;
//
//public:
//
//};
//
//private:
// float loadCapacity;
// int towingCapacity;
//
//public:
// Truck(string manufacturer, int cylinders, string owner, float loadCapacity, int towingCapacity)
//
//};
//
//int main() {
//
// cout << "Truck 1: manufacturer=" << truck1.getManufacturer() << ", cylinders=" <<
truck1.getCylinders()
// << ", owner=" << truck1.getOwner() << ", load capacity=" << truck1.getLoadCapacity()
//
// cout << "Truck 2: manufacturer=" << truck2.getManufacturer() << ", cylinders=" <<
truck2.getCylinders()
// << ", owner=" << truck2.getOwner() << ", load capacity=" << truck2.getLoadCapacity()
//
// return 0;
//}
TASK NO 3:
//#include <iostream>
//class Vehicle {
//protected:
// string manufacturer;
// int cylinders;
// string owner;
//public:
//};
// int numberOfDoors;
// bool isConvertible;
//public:
// Car(string manufacturer, int cylinders, string owner, int numberOfDoors, bool isConvertible)
//};
//
//private:
// int horsepower;
// int topSpeed;
//
//public:
// SportsCar(string manufacturer, int cylinders, string owner, int numberOfDoors, bool isConvertible, int
horsepower, int topSpeed)
//
//};
//
//int main() {
//
// cout << "SportsCar 1: manufacturer=" << sportsCar1.getManufacturer() << ", cylinders=" <<
sportsCar1.getCylinders()
// << ", owner=" << sportsCar1.getOwner() << ", number of doors=" <<
sportsCar1.getNumberOfDoors()
//
// cout << "SportsCar 2: manufacturer=" << sportsCar2.getManufacturer() << ", cylinders=" <<
sportsCar2.getCylinders()
// << ", owner=" << sportsCar2.getOwner() << ", number of doors=" <<
sportsCar2.getNumberOfDoors()
//
// return 0;
//}