Question
1.Describe three of the four characteristics of a well-designed algorithm discussed in class and provide a one sentence explanation of each characteristic. 2.Which is not
1.Describe three of the four characteristics of a well-designed algorithm discussed in class and provide a one sentence explanation of each characteristic.
2.Which is not an example of the application of an algorithm: furniture assembly instructions, a textbook index, a recipe, or pseudocode. Explain why not ?
3.Review the following python code.
# This is function outputs greeting
def greeting():
name = input("what is your name?" )
loops = int(input("how many times should I run?" ))
for i in range(0, loops):
print ("HELLO" + name)
return
print ("Program has started")
print ("Now, I'll run some code to show you a greeting")
greeting()
print ("Hope you are enjoyed the greeting")
identify all the line
number(s) that contain each of these Python scripting language techniques, and explain
why they are examples of each one.
1. A variable assignment
2. A function declaration
3. An iteration statement
4. A function call
4.Python has a selection statement that allows a decision to be made for code to be performed if the decision is true and for code to be performed if the decision is false.
Write the general syntax for the selection statement in python in below
Wite an example selection statement which tests is a use's age is 18 or over. If this is true, print out the message "You can enter the night club". Otherwise, print out the message "You are too young to enter the night club".
5.Describe the purpose of unit tests in programming, e.g. for debugging functions. In you ans, explain how unit tests help the programmer find bugs in a function. Is it always possible to exhaustively and completely unit test a function? Explain why/why not.
6.Name the IDE tool that you used in this unit. Describe the features in this tool that you can to debug a written python program. How does each feature help you debug a program, find and correct errors?
7.Wrie a Python function called onlydigits(). It receives a single string as its argument and returns a single string. The job of the function is to copy all the digits (i.e. '0' to '9'characters) in the input string into the output string, removing all other characters.
In your ans, include comments in your code that describe what you are doing and why, but not how you are doing it.
After your function, write two Python tests. Each test calls the function with anargument, and checks that the function returns the correct value. If the function does not return the correct value, the code must print an error message
8. Which of the following members of a programming team would be involved in API documentation?
a) Only the software developers on the team
b) Only the people writing unit tests
c) Both the software developers and the people writing unit tests
d) Nobody on the team will d this. The customer will d this
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started