1. Write a Maple loop which beginning with a 2 b 3 computes a new value of. give
ID: 3723188 • Letter: 1
Question
1. Write a Maple loop which beginning with a 2 b 3 computes a new value of. given by a.b, a new valae of b gnen bv exceeds 1000. After the loop terminates, display the final values of a, b ·· ng the old values) until either a or 2. Given a variable T which has been assigned a value, write a branching statement which assigns the variable message the valuc "Too hot today!" when T is grealer than or equal to 940 "Warm, but OK" for T in the range 170, 90) Pleasant" for T in the range 150, 70) Cictting Cool" when T is less than 50Explanation / Answer
1)
a := 2:
b := 3:
k := b:
j := a:
while (a>1000 or b>1000) do
a:= k*j;
b:= k+j;
k:=b;
j:=a;
end do;
printf("a value is %a . ",a);
printf("b value is %a . ",b);
2)
T := 55:
if T >= 90 then
printf("Too hot today!");
elif (T >= 70 and T < 90) then
printf("Warm, but OK");
elif (T >= 50 and T < 70) then
printf("Pleasant");
else
printf("Getting Cool");
end if;
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.