This lab accompanies Chapter 7 of Starting Out with Programming Logic & Design.
Name: Devin Hill, Matt March, and John Meno
Lab 8.1 – Input Validation
The goal of this lab is to identify potential errors with algorithms and programs.
Step 1: Imagine a program that calls for the user to enter a password of at least 8 alphanumeric characters. Identify at least two potential input errors.
-Password contains a symbol
-Password has less than 8 charecters
Step 2: Imagine a program that calls for the user to enter patients’ blood pressure. Blood pressure ranges are between 50 and 230. Identify at least two potential input errors.
-Blood pressure isn’t a number
-Blood pressure is below 50, or above 230
Step 3: Open either your Lab 5-3.rap flowchart or your Lab 5-4.py Python code. This program allowed the user to enter in 7 days worth of bottle returns and then calculated the average. Examine the program and identify at least two potential input errors.
-Input not a number
-Input is negative
Step 4: Open either your Lab 6-4.rap flowchart or your Lab 6-4.py Python code. This program allowed a teacher to enter any number of test scores and then calculated the average score. Examine the program and identify at least two potential input errors.
-Input is not a number
-Input is negative
Lab 8.2 – Input Validation and Pseudocode
The goal of this lab is to write input validation pseudocode.
Step 1: Examine the following main module from Lab 5.2. Notice that if the user enters a capital ‘Y’ the program will end since the while loop only checks for a lower case ‘y’.
Module main () //Step 1: Declare variables below Declare Integer totalBottles = 0 Declare Integer counter = 1 Declare Integer todayBottles = 0 Declare Real totalPayout Declare String keepGoing = ‘y’ //Step 3: Loop to run program again While keepGoing == ‘y’ //Step 2: Call functions getBottles(totalBottles, todayBottles, counter)