Lab 3

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Lab 3: IPO - Debugging, Flowcharts, Pseudocode

Before you begin, you will need to download the two files provided on Canvas. Click on the icon
to the right of each file and choose Download.

Create a new folder named Lab3 and move the files downloaded from Canvas into this folder.
Later, you will compress (zip) this folder to submit your work.

Once you are ready, follow the instructions for each part to complete this lab.

Part 1: Correcting Code


1. In IDLE, open the file named lab3Part1.py. Add your name as Author and include the
current Date.
2. This program uses the turtle to draw a square in the center of the screen.
3. There are two syntax errors and one logic error in the code. When you identify an error,
add an in-line comment to the file explaining the error, and then correct it.
4. The program is corrected when the output matches the image below.
5. Once you are done, rename this file as lab3yourlastnamePart1.py (ex.,
lab3DavisonPart1.py), and move to Part 2.
Part 2: Create a Program
1. In IDLE, open the file named lab3Part2.py. Add your name as Author and include the
current Date.
2. This program gathers a subtotal from the user, calculates the sales tax, and then
displays the subtotal, sales tax, and total.
3. Start by getting the subtotal from the user. You will need to convert this value to a float.
4. Assume the overall sales tax rate is 7 percent. Set a new variable for sales tax that is the
subtotal times the sales tax rate. Hint: Remember that 7 percent would be a decimal
value of 0.07.
5. Set a new variable for the sale total that is the subtotal plus the sales tax.
6. Display the subtotal, sales tax, and total values to the user. Use the output image below
as a reference. Hint: You will need to format the output using f-strings to display
currency format, comma separators, and tab characters.
7. Once you are done, rename this file as lab3yourlastnamePart2.py (ex.,
lab3DavisonPart2.py), and move to Part 3.

Part 3: Flowchart and Pseudocode


1. Go to diagrams.net and click Start. Create a new diagram from the Blank Diagram
template and click Create. Note: The Blank Diagram template is the default option.
2. Include a textbox from the General group of shapes, third option. Add your name and
the current date to the textbox. Resize this appropriately and move it to the top left of
your page.
3. Use the instructions and program from Part 2 to create a flowchart that matches the
expected flow of events.
4. When you are finished creating your flowchart, click File -> Export as -> PNG. This will
download the file to your default same location. Rename this file to
lab3yourlastnamePart3_Flow.png (ex., lab3DavisonPart3_Flow.png).
5. Open the text editing application of your choice (Example: Notepad, Notepad++, or
TextEdit). Using the flowchart you created, write the pseudocode for the program.
6. When you are finished writing your pseudocode, save the file as
lab3yourlastnamePart3_Pseudo.txt (ex., lab3DavisonPart3_Pseudo.txt).
7. Once you are done, close all files. Compress (zip) the Lab3 folder and upload it to
Canvas.

You might also like