In Progress

Easy Uni assignment

This is a University assignment, we do need to do the following exercise at C++

There are 6 types of shapes with 4 sides:

Square, rectangle, trapezoid, closed shape, parallelogram and undefined.

Define struct to a single point (x,y) and on this struct basis define struct to a shape’s side.

Now define a new struct with four sides called StShape that will contain besides the sides a string that will contain the shape’s name (out of the six).

Read from the file c: [url removed, login to view] the all shapes data (untill 10 shapes).

In each line there are 16 integer numbers which every 4 numbers define one side.

(every 2 numbers are the points).

Define an array of struct StShape and fill it with the shapes data.

You need to do these functions:

1. function that receives array of 4 sides and reveals which type of shape they represent. The function need to give back struct of StShape with the sides data and the shape name.

2. function that receives array of StShape and it’s size and sort the shapes with bubble sort according to their type by this order: closed shape , parallelogram, rectangle, Square, trapezoid and undefined in the end. (use strcmp).

3. function that receives StShape and prints it’s data. With this function you need to show the array after the bubble sort.


-2 -2 -2 1 2 1 2 4 -2 1 2 4 -2 -2 2 1 -------- parallelogram

2 -2 5 1 -4 -1 1 4 1 4 5 1 2 -2 -4 –1 --------- trapezoid


1. if one shape is defined for more than one shape than define it by whats coming first in the bubble order.

2. cannot assume the sides are parallel to the x and y lines.

3. if two sides are connecting, it is the point of the shape.

Skills: C Programming

See more: sort function c, sort bubble, sort array c, rectangle lines, rectangle line, numbers function, line rectangle, function numbers, c sort function, trapezoid assignment, shape file, rectangle, prints, easy c, easy 2, coordinates , C easy, bubble, assignment c, size function, read lines, string integer, string contain, string array, coordinates use

About the Employer:
( 0 reviews ) Houston, United States

Project ID: #212874

Awarded to:


Hi! I have a lot of experience in this type of problems. I can provide you a fully commented code in less than 1 day after you choose me. Regards, Cloe

$40 USD in 1 day
(8 Reviews)

4 freelancers are bidding on average $66 for this job


i can do it. but need escrow.

$100 USD in 1 day
(5 Reviews)

will be deliver within a quick time. let me know if you are interested.

$85 USD in 3 days
(24 Reviews)

Hi. Please check PM.

$40 USD in 0 days
(0 Reviews)