1 describe the difference between a for and a while loop


1) Describe the difference between a "for" and a "while" loop.

When can you use which type of loop?

When can you not use a "for" loop?

2) Chapra - Chapter 12 - Problem 12.1(a)

The code MsgBox displays the variable following MsgBox in a message box (you do not need to use a MsgBox). Work through the problem by hand and then you may check your work using a computer. To demonstrate that you understand loops, rewrite the program using a "while" loop as presented in the VBA handout. Draw a flow chart of your program. Be sure to comment / annotate the lines of
your code so that TA's can award credit for your work.

3) Chapra - Chapter 12 - Problem 12.7 in VBA.

You may use either a recursive function or subroutine to accomplish the problem. Draw a flow chart for your program. Be sure to comment / annotate the lines of your code so that TA's can award credit for your work.

4) Create a program that prompts the user to enter a scalar value for the outside air temperature. If the temperature is equal to or above 80°F, send a message to the command window telling the user to wear shorts. If the temperature is between 60°F and 80°F send a message to the command window telling the user that it is a beautiful day. If the temperature is equal to or below 60°F, send a message to the command window telling the user to wear a jacket or coat. (Adapted from Problem 8.12 of Moore, H., MATLAB for Engineers, 2nd Edition, Prentice Hall, 2009). Create this program in both VBA using "if" and "case" structures in each. When should each structure ("if" and "case") be used?

Solution Preview :

Prepared by a verified Expert
Computer Engineering: 1 describe the difference between a for and a while loop
Reference No:- TGS01153216

Now Priced at $60 (50% Discount)

Recommended (94%)

Rated (4.6/5)

A

Anonymous user

5/13/2016 7:54:43 AM

For the assignment illustrated above regarding programing problem, the tutors of the relevant subject provide a comprehensive solution; providing the codes and snapshots of the result. After taking their assistance, I must say that they are very proficient in their work. For all students I must say that you can take their assistance without any hesitation.