Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

5_1.py file #***************************************************************************** # Name: # User name: # Homework No: Lab 5 # Date Due: 5:05pm Tue, March 5, 2019 # # Description: #

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
5_1.py file
#*****************************************************************************
# Name:
# User name:
# Homework No: Lab 5
# Date Due: 5:05pm Tue, March 5, 2019
#
# Description:
# A brief but complete description of what the program does
#
# Bug Report:
# A description of the known bugs in the program you could not fix.
# If you did not implement specific functionality, that should be reported
# in this section as well
#*****************************************************************************
a = float(input("a:"))
b = float(input("b:"))
if a 12:
print(a)
if b == 15:
print(b)
elif b
print(b)
else:
print(b)
elif a == 10 and b == 12:
print(a)
print(b)
else:
print(a)
print(b)
5_2.py file
#*****************************************************************************
# Name:
# User name:
# Homework No: Lab 5
# Date Due: 5:05pm Tue, March 5, 2019
#
# Description:
# A brief but complete description of what the program does
#
# Bug Report:
# A description of the known bugs in the program you could not fix.
# If you did not implement specific functionality, that should be reported
# in this section as well
#*****************************************************************************
a = float(input("a:"))
b = float(input("b:"))
if a 12:
if b == 15:
print(a)
print(b)
elif b
print(b)
else:
print(b)
elif a == 10 and b == 12:
print(a)
print(b)
else:
print(a)
print(b)
5_3.py file
#*****************************************************************************
# Name:
# User name:
# Homework No: Lab 5
# Date Due: 5:05pm Tue, March 5, 2019
#
# Description:
# A brief but complete description of what the program does
#
# Bug Report:
# A description of the known bugs in the program you could not fix.
# If you did not implement specific functionality, that should be reported
# in this section as well
#*****************************************************************************
a = float(input("a:"))
b = float(input("b:"))
if a
if b > 6:
print(a - b)
elif b == 6:
print(b)
else:
print(a + b)
else:
print(a)
5-1 optimized py file
#*****************************************************************************
# Name:
# User name:
# Homework No: Lab 5
# Date Due: 5:05pm Tue, March 5, 2019
#
# Description:
# A brief but complete description of what the program does
#
# Bug Report:
# A description of the known bugs in the program you could not fix.
# If you did not implement specific functionality, that should be reported
# in this section as well
#*****************************************************************************
a = float(input("a:"))
b = float(input("b:"))
print(a)
print(b)
5-2 optimized py file
#*****************************************************************************
# Name:
# User name:
# Homework No: Lab 5
# Date Due: 5:05pm Tue, March 5, 2019
#
# Description:
# A brief but complete description of what the program does
#
# Bug Report:
# A description of the known bugs in the program you could not fix.
# If you did not implement specific functionality, that should be reported
# in this section as well
#*****************************************************************************
a = float(input("a:"))
b = float(input("b:"))
if a 12:
if b == 15:
print(a)
else:
print(a)
print(b)
5-3optimized py file
#*****************************************************************************
# Name:
# User name:
# Homework No: Lab 5
# Date Due: 5:05pm Tue, March 5, 2019
#
# Description:
# A brief but complete description of what the program does
#
# Bug Report:
# A description of the known bugs in the program you could not fix.
# If you did not implement specific functionality, that should be reported
# in this section as well
#*****************************************************************************
a = float(input("a:"))
b = float(input("b:"))
if a
if b > 6:
print(a - b)
elif b == 6:
print(b)
else:
print(a + b)
print(a)
1. Create a new PyDev Project in Eclipse 2. Copy the following files into that project: 1. 5_1.py 2. 5_1_optimized.py 3. 5_2.py 4. 5 2_optimized.py 5. 5_3.py 6. 5 3_optimized.py 3. In Eclipse, open 51.py and 5_1_optimized.py 4. Download and then open Lab05.xlsx 1. Go to the "5-1" worksheet 2. Using 5_1.py source code, fill in the three trace tables Named "Original 1/3", "Original 2/3", and "Original 3/3". You supply three different sets of values for a, b 3. Using 5_1_optimized.py source code Fill in the three trace tables Named "Optimized 1/3", "Optimized 2/3", and "Optimized 3/3". Use the same values as you did with the 5_1.py trace tables so you can directly compare the results using the same numbers 4. In theory, 5_1_optimized.py is an optimized version of 5 1.py 1. Compare the trace table output results between the 5 1.py and 5_1_optimized.py 2. Do the two versions produce the same output in all cases? If so, place an X in the Yes column 3. Otherwise, place an X in the No column 5. Do the same thing for 5_ 2.py and 5_2_optimized.py 6. Do the same thing for 5-3.py and 5-3-optimized. py 5. Submit Lab05.xlsx via Isidore Are S 1 py and S 1 optimized py equivalent? Original Code (Ren 1/3) Optimized Code (Run 1/3) Statement Notes Step Statement Original Code (Run 2/3) Optimized Code (Run 2/3) Statement Notes Step Notes Original Code (Ren 3/3 Optimsized Code (Run 3/3 Step Notes Statement Notes Are 52py Original Code (Ran L/3) Optimized" Code (Run 13) Statement Notes Step Statement 10 10 Original Code (Ran 2/3) Optimized" Code (Run 2/3) ep Statement Notes ep Statement Notes 10 10 Original Code (Ren Optimized Code (RunMa) Statement Notes Statement Notes 10 10 Are 5 3.py and 5 3 optimized.py "Optimized" Code (Run 13) Original Code (Run 1/3) Notes Step Statement Notes Step "Optimized" Code (Run 2/3) Original Code (Run 2/3) Notes Step Notes Step "Optinsiaed" Code (Run 3) Origisal Code (Run 3 Notes Step Statement Notes Step Statement

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions