Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Computer Based Quiz Complete this with 1 other person from your section Create a

ID: 3669350 • Letter: C

Question


Computer Based Quiz Complete this with 1 other person from your section Create a single script (,m) file to complete all requirements there. After you complete everything copy and paste the script and the results into a word document. Submit the WORD DOCUMENT through BlackBoard (under just 1 person's account) Turn in this sheet Create a program using a for loop that allows the user to determine the start, increment, and stopping values that control the loop. Count the number of loops that are executed and display the number of times the loop repeated in a nicely formatted display statement.

Explanation / Answer

cont=1;
while cont==1
   i = input('loop starting value');
   j = input('loop increment value');
   k = input('loop stop value');
  
   if (k<i && k<1 || i< 1 || j < 1)
       cont=1;
   else
       cont=0;
   endif
endwhile
count =0;
for x=i:j:k
   count=count+1;
end

outputString = sprintf('Based on given value the loop repeated %d times',count);
disp(outputString);

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote