Take out a piece of paper and put your name on the upper right corner.
Answer the following questions:
Briefly explain how subroutines can be useful in the top-down design of programs.
A subroutine is said to have a contract. What is meant by the contract of a subroutine? When you want to use a subroutine, why is it important to understand its contract? The contract has both “syntactic” and “semantic” aspects. What is the syntactic aspect? What is the semantic aspect?
What are the values of a, b, and c after the following code runs?
double a = (30 + (20 / 5)) * 2 - 2;
int b = 30 + 20 / 5 % 2 - 2;
int c = (int) a + b * 2;
Finish your answers before the timer runs out.