I try to help my children in their subjects, I built a small code so that it has as output questions regarding the equation of the line, but I have not been able to modify it so that the result comes out randomly a) parallel b) perpendicular and the other thing I get the minus sign to come out randomly but when it is +, I don't know how to write it and it comes out + -, would you be so kind to help me improve the code and maybe the numbered exercises come out Thanks in advance
a := RandomInteger[{1, 10}];
b := RandomInteger[{1, 10}];
c := RandomInteger[{1, 10}];
(*ax+by+c=0*)
(*dx+ ey+f=0*)
d := RandomInteger[{1, 10}];
e := RandomInteger[{1, 10}];
f := RandomInteger[{1, 10}];
g := RandomInteger[{0, 1}];
Table [Print [" Find 'k' so that the line " , (-1)^(g + 1)*a,
"x+", (-1)^(g + 1)*b, "y+" , (-1)^(g + 1)*c ,
"=0 be perpendicular/parallel to the line" , (-1)^(g + 1)*d,
"x+(", ((-1)^(g + 1)*e), "+k)y+" , (-1)^(g + 1)*f , "=0 " ], {i, 1,
20}]
x+
in there and the random number sometimes comes negative with-
in it already. So you need to add an extra check to only use+
when the random number is positive and not negative so not to get the double sign. I can add this later. Just need to make some coffee now first. $\endgroup$