Could you help me with this question please? For each of the following, decide w
ID: 1843614 • Letter: C
Question
Could you help me with this question please?
For each of the following, decide whether you would use a for loop, a while loop, a nested loop (and if so what kind, e.g., a for loop insider of another for while loop inside of a for loop. etc.), or no loop at all. DO NOT WRITE THE ACTUAL CODE. sum the integers 1 through 50: add 3 to all numbers in a vector: prompt the user for a string and keep doing this until the string that the enters is a keyword in MATLAB: find the minimum in every column of a matrix: prompt the user for 5 numbers and find their sum: prompt the user for 10 numbers, find the average and also find how many of the numbers were greater than the average: generate a random integer n in the range from 10 to 20. Prompt the user for n positive numbers, error-checking to make sure you get n positive numbers (and just echo print each one): prompt the user for positive numbers until the user enters a negative number. Calculate and print the average of the positive numbers, or an error message if none are entered:Explanation / Answer
1) For loop
2) For loop
3) While loop
4) Nested - For inside while
5) Nested While inside For
6) Nested- While inside For
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.