I need some help with some code. Here is the text:
Plot the progress of the rider on the road. With the symbol * draw the number of percents by which a rider has finished the track, then write "." character for unfinished part of the track. Write the percentage of distance traveled.
Then draw a rectangle progress in multi-line (line graph) for 5 riders on the same route.Enter a value of N, which is the same for all rectangles. Use the local variables, pass them into functions.
So if someone can help me to solve this problem ..
Here is my code[doesn't work] :
I assume that the "drawPath" function doesn't have to draw it that complicatedly. You can make the whole thing out of 10 and check the percentage. Round the percentage. Up to the percentage have * and afterwards put ".". For the place where the rider stopped, put the percentage.
For example, if they went 56% of the way, you'll round to 60 (just for the drawing part). The first 5 characters will be "*" followed by "56%" and then 4 "."
^If your professor or whatever didn't specify how to do it, this is a pleasant and easy to way to do it.
As for the line graph, I'm not sure how they expect it. You can't really draw lines from point to point on the console. A bar graph would be easier to replicate. However, I'm not too sure by your description what the graph should even be graphing.