Build me a small C++ object oriented program

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

Taidot: C++ -ohjelmointi, Tietojärjestelmäarkkitehtuuri

Näytä lisää: calgary courses object oriented program design, object oriented bank application java program client open account account balance, writting atm object oriented program java, best c++ tutorial, advanced object oriented programming c++, learn c++ fast, c++ tutorial for beginners, learn c++, object oriented programming c++ projects, object oriented programming c++ examples, object oriented programming c++ lecture notes pdf, object oriented java program mortgage payment, small project using object oriented, small project object oriented, object oriented program, introduction to object oriented programming using c++, object oriented programming in c++, the waite groups object oriented programming in c++, www java as object oriented program com, beginning c# object-oriented programming

Tietoa työnantajasta:
( 7 arvostelua ) Karlskrona, Sweden

Projektin tunnus: #18229978

Myönnetty käyttäjälle:


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 Lisää

$30 USD 1 päivässä
(327 Arvostelua)

2 freelanceria on tarjonnut keskimäärin $40 tähän työhön


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 Lisää

$50 USD 1 päivässä
(107 arvostelua)