PythonByteSize
  • Home
  • Video Index
    • 1. The Basics
    • 2. Python Program Structures
    • 3. Python Operators
    • 4. Python Functions
    • 5. Introduction to Classes and Objects
    • 6. Python Strings
    • 7. User Defined Functions
    • 8. Classes and Objects
    • 9. Python Dictionaries
    • 10. Python tkinter
    • 11. Python Lists
    • 12. Python Namespaces
    • 13. Turtle Graphics
    • 14. Python Tips
    • 15. Complex Numbers
  • 1-Minute Videos
  • Exercise Index
    • 1. The Basics Exercises
    • 2. Python Program Structures Exercises
    • 3. Python Operators Exercises
    • 4. Python Functions Exercises
  • Donate
  • Computing Topics
  • Mathematics
  • Educators
  • Contact
  • About

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.

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?
  1. Structured English Design
  2. The program

10. What are the three fundamental program structures (HINT: one is sequence). 

END  Next Exercise >>

Please consider donating to help with the costs incurred in developing this website.             Donate >>