math1403

10 Reputation

2 Badges

12 years, 199 days

MaplePrimes Activity


These are replies submitted by math1403

 The question was this:
Write a Maple procedure to find the four positive numbers (a, b, c, d)
 with two decimal digits (e.g. 1.23) such that their sum and product is 
equal to 7.11.  i.e.

a + b + c + d = a*b*c*d = 7.11
 
so far i have 
equal:=proc();

local a,b,c,d,i,j,k,sum;
#a,b,c,d - four positive numbers with two decimal digits
#i,j,k - counting variables
#sum - the sum of four numbers

for i by 0.00 to 7.11 do
a:=i;
for j by 0.00 to 7.11 do
b=j;
for k by 0.00 to 7.11 do
c:=k;
d:=7.11-a-b-c;

sum:=a+b+c+d;
if a+b+c+d=a*b*c*d and sum=7.11 then
print(`When a=`,a,`b=`,b,`c=`,c,`and d=`,d);
print(`a+b+c+d=a*b*c*d=7.11`)
else


end if;
end do;
end do;
end do;
end proc;
Page 1 of 1