Your program should use text files as the only input. No keyboard input is permitted. The path to the input file should be the first parameter to the program.
Format output exactly as specified/exemplified in the descriptions
Follow good code writing practices:
Do not use global variables
Divide classes into .cpp and .h files
All parameters that are constants should be declared as such
All variable and class names should be in English, self-explanatory, and must use camelCase.
All code that is not used should be removed
Use code comments when the reasoning behind the solution is not obvious
Always check that that all allocated memory is released and avoid memory leaks
You should not use any external libraries other than cmath, iostream, fstream, and strings. If you wish to use another library please check with the lab assistants first.
The program should be robust against wrong input data. If there is an error with input file the program should gracefully terminate with a non zero exit code.
Real numbers should be printed with the precision of 3 decimal digits.
Implement an abstract class Shape with methods:
getType() returns a string denoting the type of a shape (point, line, polygon, triangle)
area() returns area of the object, or -1 if the shape is concave, intersecting, or does not have an area
circumference() returns circumference of the object
position() returns center coordinates of the object, or the center of the bounding box if the shape is not convex.
isConvex() returns true if shape is convex
distance(Shape s) returns distance to the center of another shape
Extend the Object classes into Point, Line, Triangle, and Polygon. Overload the inherited methods. Constructors of these classes take vertices coordinates as an input.
The program should load a shape from a file and output its surface area. The input file contains a series of real numbers indicating coordinates of vertices. Example:
1 2 3 4 5 6.43 // Denotes a triangle with vertices at (1, 2) (3, 4) (5, 6.43)
There should not be a limitation of how many points the program can load.
Input: 1 1 1 2 2 2 Output: 0.5
Input: 1 3.4 3 3 13.13 3 Output: 2.026
Input: 1 1 1 2 2 2 3 1 2 0 Output: 2.5
Input: 0 -10 Output: -1
Hello Sir/ Ma’am We are a group of Software Engineers having 10+ years of experience. Expert in JAVA, C, C++ , C# , Python, ANDROID, MATLAB. Done 550+ projects here on FREELANCER.COM. Please check our profile for ref Daha Fazla
Bu iş için 6 freelancer ortalamada $48 teklif veriyor
Hi Nice to meet you. I'm senior c++/c# expert. I have plenty experience of multithreading, opencv, REST api, and entityframework. I checked your job description and no problem. Also I can write comment as well. J Daha Fazla
Hi I have read your project description very carefully so I am confidence to complete your project I have finished lots of such projects successfully. I am an experienced and skillful web full stack. I have full Daha Fazla
Thanks for your job posting! I am a C++ Developer and your project is very interesting for me. Good relationship with client is more important than money for me. But I will work with low price for our long-term rela Daha Fazla