diff --git a/lesson_3/Debug/lesson_3 b/lesson_3/Debug/lesson_3 deleted file mode 100755 index 85c73ed..0000000 Binary files a/lesson_3/Debug/lesson_3 and /dev/null differ diff --git a/lesson_3/Debug/main.d b/lesson_3/Debug/main.d deleted file mode 100644 index 32d5ad1..0000000 --- a/lesson_3/Debug/main.d +++ /dev/null @@ -1,6 +0,0 @@ -main.o: ../main.cpp ../exercise_1.hpp ../exercise_2.hpp ../exercise_3.hpp \ - ../exercise_4.hpp -../exercise_1.hpp: -../exercise_2.hpp: -../exercise_3.hpp: -../exercise_4.hpp: diff --git a/lesson_3/Debug/main.o b/lesson_3/Debug/main.o deleted file mode 100644 index 877cfb0..0000000 Binary files a/lesson_3/Debug/main.o and /dev/null differ diff --git a/lesson_3/Debug/makefile b/lesson_3/Debug/makefile deleted file mode 100644 index 4ee7c15..0000000 --- a/lesson_3/Debug/makefile +++ /dev/null @@ -1,57 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - --include ../makefile.init - -RM := rm -rf - -# All of the sources participating in the build are defined here --include sources.mk --include subdir.mk --include objects.mk - -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(strip $(CC_DEPS)),) --include $(CC_DEPS) -endif -ifneq ($(strip $(C++_DEPS)),) --include $(C++_DEPS) -endif -ifneq ($(strip $(C_UPPER_DEPS)),) --include $(C_UPPER_DEPS) -endif -ifneq ($(strip $(CXX_DEPS)),) --include $(CXX_DEPS) -endif -ifneq ($(strip $(CPP_DEPS)),) --include $(CPP_DEPS) -endif -ifneq ($(strip $(C_DEPS)),) --include $(C_DEPS) -endif -endif - --include ../makefile.defs - -# Add inputs and outputs from these tool invocations to the build variables - -# All Target -all: lesson_3 - -# Tool invocations -lesson_3: $(OBJS) $(USER_OBJS) - @echo 'Building target: $@' - @echo 'Invoking: GCC C++ Linker' - g++ -o "lesson_3" $(OBJS) $(USER_OBJS) $(LIBS) - @echo 'Finished building target: $@' - @echo ' ' - -# Other Targets -clean: - -$(RM) $(CC_DEPS)$(C++_DEPS)$(EXECUTABLES)$(C_UPPER_DEPS)$(CXX_DEPS)$(OBJS)$(CPP_DEPS)$(C_DEPS) lesson_3 - -@echo ' ' - -.PHONY: all clean dependents - --include ../makefile.targets diff --git a/lesson_3/Debug/objects.mk b/lesson_3/Debug/objects.mk deleted file mode 100644 index 742c2da..0000000 --- a/lesson_3/Debug/objects.mk +++ /dev/null @@ -1,8 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -USER_OBJS := - -LIBS := - diff --git a/lesson_3/Debug/sources.mk b/lesson_3/Debug/sources.mk deleted file mode 100644 index a7f166f..0000000 --- a/lesson_3/Debug/sources.mk +++ /dev/null @@ -1,27 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -C_UPPER_SRCS := -CXX_SRCS := -C++_SRCS := -OBJ_SRCS := -CC_SRCS := -ASM_SRCS := -CPP_SRCS := -C_SRCS := -O_SRCS := -S_UPPER_SRCS := -CC_DEPS := -C++_DEPS := -EXECUTABLES := -C_UPPER_DEPS := -CXX_DEPS := -OBJS := -CPP_DEPS := -C_DEPS := - -# Every subdirectory with source files must be described here -SUBDIRS := \ -. \ - diff --git a/lesson_3/Debug/subdir.mk b/lesson_3/Debug/subdir.mk deleted file mode 100644 index c456c4a..0000000 --- a/lesson_3/Debug/subdir.mk +++ /dev/null @@ -1,24 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -# Add inputs and outputs from these tool invocations to the build variables -CPP_SRCS += \ -../main.cpp - -OBJS += \ -./main.o - -CPP_DEPS += \ -./main.d - - -# Each subdirectory must supply rules for building sources it contributes -%.o: ../%.cpp - @echo 'Building file: $<' - @echo 'Invoking: GCC C++ Compiler' - g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<" - @echo 'Finished building: $<' - @echo ' ' - - diff --git a/lesson_3/exercise_1.hpp b/lesson_3/exercise_1.hpp index 252dd91..a3b6dac 100644 --- a/lesson_3/exercise_1.hpp +++ b/lesson_3/exercise_1.hpp @@ -19,7 +19,7 @@ class Figure { public: virtual float area() = 0; - virtual ~Figure() = 0; + virtual ~Figure() { }; }; class Parallelogram : public Figure @@ -54,7 +54,19 @@ public: class Circle : public Figure { +private: + float m_radius; +public: + Circle(float radius) : m_radius(radius) { } + float area() + { + float area = PI * pow(m_radius, 2); + + std::cout << "Площадь круга равна " << area << std::endl; + + return area; + } }; class Rectangle : public Parallelogram diff --git a/lesson_3/main.cpp b/lesson_3/main.cpp index a3019d9..40a5fd6 100644 --- a/lesson_3/main.cpp +++ b/lesson_3/main.cpp @@ -1,4 +1,5 @@ #include +#include #include "exercise_1.hpp" #include "exercise_2.hpp" #include "exercise_3.hpp" @@ -8,5 +9,11 @@ using namespace std; int main() { + // Exercise 1 + Parallelogram A(15, 9); + +// Figure* figures[5]; + + return 0; }