Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

TASK 1 Your boss has asked you to help identify problems with a program he has made. # This program gets two numbers from the

TASK 1

Your boss has asked you to help identify problems with a program he has made.

# This program gets two numbers from the user and adds all even numbers between them # e.g. 10 (inclusive) and 18 (exclusive) = 10 + 12 + 14 + 16 (18 is skipped/excluded) rangeLow =int(input("What is the lowest number you'd like to add? (inclusive) ")) rangeLow =int(input("What is the highest number you'd like to add? (exclusive) ")) rangeSum =0 while(rangeLow <0): print("My minimum is 0 - please try again.") rangeLow int(input("What is the lowest number you'd like to add? (inclusive) ")) while(rangeHigh <=1000): print("My maximum is 1000 - please try again.") rangeHigh =int(input("What is the highest number you'd like to add? (exclusive) ")) if(rangeLow >= rangeHigh): print("The High number must be larger than Low number. I'll swap these for you.") temp = rangeHigh rangeHigh = rangeLow rangeLow = temp foriin loop(rangeLow, rangeHigh): # Even numbers have 0 remainder when divided by 2 - add these numbers, throw away the odds. The % operator gives us the remainder. if(i %2==0): print(" Adding "+str(i) +" to the sum.") rangeSum = rangeSum + i if(i > rangeHigh): print("My loop has gone past the High number! This shouldn't happen!") print("The sum of the even numbers from ["+str(rangeLow) +"] to ["+str(rangeHigh) +"] is: "+str(rangeSum))

  1. Identify a section of dead code and briefly describe why it/they will never be run.

  1. Identify at least one syntax error.

  1. Identify at least one logical/semantic error.

  1. Write 1-2 paragraphs of user-level and technical-level documentation.

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

Step: 3

blur-text-image

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions