1.Draw a flowchart representing the structure expressed by the following for statement.
for (int x = 2; x <>
2.Translate the following while statement into an equivalent program segment using the
Python for statement. Initialization: x = 1
while ( x! = 100) { x = x + 1 }
3.If you are familiar with written music, analyse musical notation as a programming
language. What are the control structures? What is the syntax for inserting program comments? What music notation has semantics similar to the for statement?
4.Rewrite the following program segment using
a while loop instead of a for loop.
for (i = 0; i<100;>
if (i % 2 == 0)
{
print(i)
}
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here