please include a copy code thanks 21 Pick a number Write a p

please include a copy code thanks


21. Pick a number. Write a program pickaNumber that implements the following game. mall whole number n, but not report it. The 6: a, b,c,d, and e (don\'t disclose them The program asks the user to mentally pick a s program randomly picks 5 integers between 2 and to the user yet). The program then asks the user to do the following steps. 1. Multiply the number n by a. 2. Add b to the result. 3. Multiply the result by c. 4. Add d to the result.

Solution

X = [\'multiply number n with\' ,num2str(a)];

disp(X)

fr = n * a;

Y =[\'Add\' ,num2str(b) ,\'to the result\']

disp(Y)

fs = fr +b;

Z=[\'multiply the result by\', num2str(c) ]

disp(Z)

fq = fs *c

A=[\'Add\' , num2str(d), \'to the result\' ]

disp(A)

ft = fq + d

V= [\'multiply the result by\' , numstr2(e) ]

disp(V)

fu = ft * e

g = fu / e;

j = g - d;

y = j / c;

pre = y-b;

final = pre - a;

M = [\'The number you thought was\' , final ]

endl;

please include a copy code thanks 21. Pick a number. Write a program pickaNumber that implements the following game. mall whole number n, but not report it. The

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site