1. Write a Maple loop which, beginning with a 2 b 3, computes a new value of a g
ID: 3723190 • Letter: 1
Question
1. Write a Maple loop which, beginning with a 2 b 3, computes a new value of a given by a'b, a new valuc of b given by a + b hoth asing the old valaes) umtil cither a or b exceeds 1000. After the loop terminates, display the final values of a, b. 2. Given a variable T which has been assigned a value, write a branching statement which assigns the variable message the va "Too hot today!" when T is greater than or equal to 90 "Warm, but OK" for T in the range 170, 90) Pleasant" for T in the range [50, 70) "Getting 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.