Use while-end, i f -end, break commands to solve the numerical problem Write a script file named
Fantastic news! We've Found the answer you've been seeking!
Question:
Use while-end, i f -end, break commands to solve the numerical problem
Write a script file named PBTask3pS.m that sums a sequence of random numbers (use rancin) until the sum is greater than 10. If the random number generated is greater than 3, exit the loop immediately without doing the sum.
Display the sum of the random numbers and the last random number generated in command window when the program terminates. The display format may like this:
>> PBTask3p5
The sum of the random numbers is: 10.571232
The last random number generated is: 1.618112
Related Book For
College Mathematics for Business Economics Life Sciences and Social Sciences
ISBN: 978-0321614001
12th edition
Authors: Raymond A. Barnett, Michael R. Ziegler, Karl E. Byleen
Posted Date: