I will create a loop to iterate throw all the points increasing in epsilon (e), the x (x+=e;) this can add fine granularity to the x, lets said that you choose e=0.01 then you can get distances 0.0, 0.01, 0.02.. and so on, obtaining the V(x). Then the values of the plot will be more realistic. The input must be standard (by the keyboard) and the output will be standard too (the screen) the user could redirect that input and output to obtain a file.
I will do a generic program for two charge and any three dimensions and it will be run for 2D and one electrical charge, letting be q1=0 on the part 1 b) equation.
Then for more than two charges I will use the superposition of fields to calculate the electrical potential for every single charge.