Exercise 2.1 (The Sequence Construct)
1. Ensure you have viewed the video (associated with this exercise) at this link >>
2. In your own words describe a computer program that exhibits a sequential structure. As part of your description include the statement ‘unconditionally executes the next program statement.’
3. In your own words describe your understanding of a user friendly prompt.
For all programs you are asked to write in this exercise ensure that they have user friendly prompts and variables with sensible and meaningful names.
4. Write a program that will prompt the user for two numbers and then display their product (i.e. the number you get when you multiply the two numbers together).
5. Write a program that will prompt the user for two numbers and then display their sum (i.e. the number you get when you add the two numbers together).
6. Write a program that will prompt the user for two numbers and then display their sum and product.
7. For the following specification produce a Structured English design, a Data Table and Test Plan.
Specification
Ask the user to enter how many Pounds Sterling (£) they wish to convert to Dollars ($) also have the user enter the current exchange rate. Output both the pounds entered by the user and the equivalent amount of dollars based on the exchange rate.
Specification
Ask the user to enter how many Pounds Sterling (£) they wish to convert to Dollars ($) also have the user enter the current exchange rate. Output both the pounds entered by the user and the equivalent amount of dollars based on the exchange rate.
8. Convert the Structured English design you developed in 7 above to a Python program. Enter the program and test it against your test plan.
9. After reading a specification a programmer would typically produce which of the following first?
- Structured English Design
- The program
10. What are the three fundamental program structures (HINT: one is sequence).
END Next Exercise >>