Question

Using the Python program be able to identify or discuss the following: A good test plan...

Using the Python program be able to identify or discuss the following:

  1. A good test plan – how would you determine that it is working?
  2. Limitations of the program – what would you do to enhance it?
  3. Output improvement – what would you add to improve output?
  4. Examples of local variables – name, types, and scope
  5. Reason why global variables are not recommended
  6. Examples of constants
  7. Use of Boolean variable
  8. Use of floating point variable
  9. Use of integer variable
  10. Math operators
  11. Use of string variable
  12. Conversion from string to numeric
  13. Conversion from numeric to string
  14. Slicing strings
  15. Functions
  16. Parameters
  17. Return values
  18. Driver function
  19. Function calls
  20. Built in functions
  21. Exception handler
  22. Validation with if statements
  23. While and For loops
  24. Number of iterations and stopping conditions
  25. Nested loops
  26. Lists
  27. Subscripts
  28. Iterating through a list’s indices or through a list’s values
  29. List of lists (tables)
  30. File reading and writing
  31. Expected program documentation
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Python program code-

mobile_model_id=526

mobile_model_name="guru"

print(mobile_model_id, mobile_model_name)

inp1=input("Guess mobile model id ")

inp2=input("Guess mobile model name ")

id1=int(inp1)

if id1==mobile_model_id and inp2==mobile_model_name:

    print("you guessed it right")

else:

    print("sorry try again!")

s = 'HelloWorld'

# slicing syntax str_object[start_pos:end_pos:step]

first_five_chars = s[:5]

print(first_five_chars)

#reverse using slicing

reverse_str = s[::-1]

print(reverse_str)

# list to a list of lists

  

def fun1(lst):

    res = []

    for el in lst:

        sub = el.split(', ')

        res.append(sub)

      

    return(res)

                  

# Driver

lst = ['Ram', 'Sam', 'John']

print(fun1(lst))

#while loop

c = ["yellow", "green", "blue", "pink"]

i = 0

while i < len(c):

    print(c[i])

    i += 1


#for loop

for x in range (10,20):

        if (x == 15): break

        if (x % 2 == 0) : continue          #print odd numbers

        print(x)

# Function which returns x/y

def divi(x , y):

    try:

        c = x/y                    # / division operator

    except ZeroDivisionError:

        print ("x/y result in 0 division error")

    else:

        print (c)

divi(8.0, 2.0)

divi(2.0, 0)

#subscript

SUB = str.maketrans("0123456789", "₀₁₂₃₄₅₆₇₈₉")

"H2SO4".translate(SUB)

'H₂SO₄'

#file reading writing

f= open("abc.txt","w+")

for i in range(10):

    f.write(" %d\n" % (i+1))

f.close()

    #read the contents

f = open("abc.txt", "r")

if f.mode == 'r':

    contents = f.read()

    print (contents)




Ans 1. If the given program is compiled successfully than it does not contain errors however to check correctness output of program we need to design sample test cases.

Ans 2.Python is an object oriented programming language so can enhance program by using Objects and Classes.

Ans 3. Output can be improved by labelling output properly.

Ans 4. Global variables have pros and cons depends on how it is being used.For smaller applications, global variables helps your code to easily pass and access data from other classes and methods but for larger applications, It will make application hard to maintain and read.Encapsulation can't be achieved

Add a comment
Know the answer?
Add Answer to:
Using the Python program be able to identify or discuss the following: A good test plan...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Using python, create a program using nested loops to write a function called substring(s,b) that returns...

    Using python, create a program using nested loops to write a function called substring(s,b) that returns True or False depending on whether or not b is a substring of s. For example: String: "Diamond" Substring: "mond" The code will then state that this is true and "mond" is a substring of "Diamond". Example of what the program should output: Enter string: Tree Enter substring: Tre Yes, 'Tre' is a substring of 'Tree' Limitation: This program cannot use "find()" and "in"...

  • Python code: using only len(), range(), append(), and del keyword when needed as the directions state?...

    Python code: using only len(), range(), append(), and del keyword when needed as the directions state? No list comprehension, slicing, or importing modules. Please and thank you. def diagonal_matrix(mat) Converts a square matrix mat into a lower diagonal matrix https://en.wikipedia.org/wiki/Triangular_matrix After the conversion the values on the diagonal will be the sum of the deleted elements in the respective row Return value is None. Variable mat is directly modi ed in memory mat is a nested list (e.g. [[1,2,3], [4,5,6],...

  • This C++ Programs should be written in Visual studio 2017 PROGRAM 1: Comparing Using Arrays to...

    This C++ Programs should be written in Visual studio 2017 PROGRAM 1: Comparing Using Arrays to Using Individual Variables One of the main advantages of using arrays instead of individual variables to store values is that the program code becomes much smaller. Write two versions of a program, one using arrays to hold the input values, and one using individual variables to hold the input values. The programs should ask the user to enter 10 integer values, and then it...

  • Write a driver C++ program that will test the following functions in the same order they...

    Write a driver C++ program that will test the following functions in the same order they are written next. You can test your program by reading the following values: n1= 10 and n2= 20 from the user: The main program sends the values of the variables n1 and n2 to the function. The function calculates the average and sends it back to main program through the parameter list as call by reference parameter and will not use the return statement.

  • This Python program will need to include the following items listed below. You are to customize your program and create the sequence in any order of your choice. Must include Python comments for each...

    This Python program will need to include the following items listed below. You are to customize your program and create the sequence in any order of your choice. Must include Python comments for each of the items shown below. Calculate a Percentage. For example, the discount percentage on a sale item. Use of 3 Constants. To be used for values that will not change throughout the life of the program. A Turtle Graphic Logo. This logo will be used to...

  • This Python program will need to include the following items listed below. You are to customize...

    This Python program will need to include the following items listed below. You are to customize your program and create the sequence in any order of your choice. Write in simple code. Must include Python comments for each of the items show below. Calculate a Percentage. For example, the discount percentage on a sale item. Use of 3 Constants. To be used for values that will not change throughout the life of the program. A Turtle Graphic Logo. This logo...

  • Python Programming 18- Calling Functions 2 K First < Back #18.1) A Dashing Name (2/5 completed)...

    Python Programming 18- Calling Functions 2 K First < Back #18.1) A Dashing Name (2/5 completed) Next > Last BlockPy: #18.1) A Dashing Name While organizing your MP3 collection, you discovered that all of the spaces in the filenames were replaced with "-". Using the String functions reference page, use the replace function to fix and then print the string value stored in the variable filename below. Console: View Trace Feedback: Algorithm Error Unused Variable The variable filename was given...

  • IN PYTHON Develop the program that will allow you to obtain an ordered list of whole...

    IN PYTHON Develop the program that will allow you to obtain an ordered list of whole numbers from least to greatest from two lists of whole numbers. The individual values ​​of the input lists are captured by the user one by one and then both lists will be joined and then sorted in ascending order (from lowest to highest value). Your program should allow the capture of the entire values ​​of the lists without making use of messages (legends) to...

  • Python 2.7.14 Programming Assignment Shape Drawing With Notepad++(PLEASE READ AND FOLLOW THESE INSTRUCTIONS THOROUGLY AS THIS...

    Python 2.7.14 Programming Assignment Shape Drawing With Notepad++(PLEASE READ AND FOLLOW THESE INSTRUCTIONS THOROUGLY AS THIS ASSIGNMENT IS FOR PYTHON 2.7.14. ONLY AND I REALLY NEED THIS TO WORK!!! ALSO PLEASE HAVE THE CODE PROPERLY INDENTED, WITH WHATEVER VARIABLES DEFINED, WHATEVER IT TAKES TO WORK FOR PYTHON 2.7.14. I feel like nothing I do is working and I'm trying everything I can think of. ): In this assignment, the student will create a Python script that implements a series of...

  • In this program, you will be using C++ programming constructs, such as overloaded functions. Write a...

    In this program, you will be using C++ programming constructs, such as overloaded functions. Write a program that requests 3 integers from the user and displays the largest one entered. Your program will then request 3 characters from the user and display the largest character entered. If the user enters a non-alphabetic character, your program will display an error message. You must fill in the body of main() to prompt the user for input, and call the overloaded function showBiggest()...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
Active Questions
ADVERTISEMENT