Mahmoud - as this is a homework assignment, we can only give hints on how to proceed. In this case, break the star down into its components which are the five lines. How would you plot each line? You know the (x,y) coordinate for the start and the end point for each line so you can determine its slope. From that you can determine the equation for the line which you can then plot.
All lines will have the same set of points along the x-axis so we can initialize this set as
(In the above, x will be an array of 50 elements that are linearly spaced between 2 and 4.)
Now, if we consider the horizontal line which starts at (2,4) and ends at (4,4), then the equation for this line (as an anonymous function) is
which we can then plot as
You can refer to plot to see how you may adjust the plot so that it appears as a red dashed line.