Exercise 3.8. (Pythons Logical and Operator)
1. Ensure you have viewed the video (associated with this exercise) at this link >>
2. The video looked at a program that implemented the following specification.
Specification
A bank will offer a customer a loan if they are 18 or over and have an annual income of at least £15000. Write a program that will, based on a customers age and income, produce a decision on whether they will be offered a loan.
The program, shown in the video, that implemented this specification is shown below (Exercise 3.8 Example 1).
For this program produce a simple test plan based on boundary tests then copy and paste the program into your Python editor and test the program against the test plan.
Specification
A bank will offer a customer a loan if they are 18 or over and have an annual income of at least £15000. Write a program that will, based on a customers age and income, produce a decision on whether they will be offered a loan.
The program, shown in the video, that implemented this specification is shown below (Exercise 3.8 Example 1).
For this program produce a simple test plan based on boundary tests then copy and paste the program into your Python editor and test the program against the test plan.
Exercise 3.8 Example 1
3. For the following specification write a program and produce a test plan. Type your program into your Python editor and test its runtime against the test plan.
Specification
To enrol on an online course a prospective student has to be at least 21 and have passed their qualifying examination. The user will be asked the following questions:
How old are you?
Have you passed your qualifying examination (Y/N)?
In response to the questions the program will display one of the strings shown below:.
You can enrole on the course.
You cannot enrole on the course.
Specification
To enrol on an online course a prospective student has to be at least 21 and have passed their qualifying examination. The user will be asked the following questions:
How old are you?
Have you passed your qualifying examination (Y/N)?
In response to the questions the program will display one of the strings shown below:.
You can enrole on the course.
You cannot enrole on the course.
END Next Exercise >>