1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Artemon [7]
3 years ago
15

a) Before writing any code, you should go through a design process. Try to do so carefully – either follow a top-down approach,

a full bottom-up approach, or some combination. But, in any case, you should come up with a list of functions you plan to implement, each with its own clear purpose. a. Create a document that outlines all the functions you will create, including a purpose for each, stating what the function does, and any parameters it has. The purpose for each function can become its docstring b) After you have written a description of your program, including the planned functions, go ahead and write code for each function. Be sure to create a docstring for each function. Turn in your program and the design document you created beforehand. Challenge: See if you can create a program so that the lines are drawn
Computers and Technology
1 answer:
olga55 [171]3 years ago
3 0

Answer:

See Explaination

Explanation:

import turtle

def drawLine(x,y,height):

'''

method to draw a vertical line from x,y with given height

'''

turtle.up()

turtle.goto(x,y)

turtle.down()

turtle.goto(x,y-height)

def drawSet(x,y,height):

'''

method to draw a full set of tally marks

'''

temp = x

#drawing 5 vertical lines

for j in range(4):

drawLine(temp,y,height)

temp+=20

#drawing a line crossing all previous lines

turtle.up()

turtle.goto(x-5,y-height/2)

turtle.down()

turtle.goto(temp-15,y-height/4)

def drawPartialSet(x,y,height,count):

'''

method to draw an incomplete set (less than 5 tally marks)

'''

temp = x

for j in range(count):

drawLine(temp,y,height)

temp+=20

#getting number

num=int(input('Enter the number: '))

#finding number of complete sets

sets=num//5

#finding number of incomplete sets

extra=num%5

#setting up turtle

turtle.setup(width=500,height=500)

turtle.pensize(5)

turtle.speed(0) #max speed

#starting x, y coordinates

x=-240

y=250

line_height=80 #height of one tally line

#drawing all complete sets

for i in range(1,sets+1):

drawSet(x,y,line_height)

x+=line_height

if i%5==0:

#moving to next line after every 5 sets

x=-240

y-=line_height+50

#drawing extra sets if exist

if extra>0:

drawPartialSet(x,y,line_height,extra)

turtle.ht() #hide turtle

turtle.done() #finish drawing

You might be interested in
What acronym is used to reference the data link sublayer that identifies the network layer protocol encapsulated in the frame?
juin [17]

Logical Link Control is the data link sublayer that identifies the network layer protocol encapsulated in the frame. The acronym of Logical Link Control is LLC.

Therefore, the answer is LLC.

7 0
3 years ago
_______________creates new markets separate to the mainstream; markets that are unknowable at the time of the technology's conce
elena-s [515]

Answer: a)Disruptive innovation

Explanation: Disruptive innovation is the innovation technique indulges in market through new market strategy and value network. This techniques damages the existing market market and its values .The displacement of the current product extincts from the market through this technique.

Other options are incorrect because paradigm shift is influence losing in the market and sustaining innovation is used for the improving the product's marketing and value .Thus, the correct option is option(a).

3 0
3 years ago
Choose the word that best completes this sentence. ________ can only grow and multiply within the cells of another living thing,
melomori [17]
The correct answer that would best complete the given statement above would be the word VIRUSES. Here is the complete statement. Viruses can only grow and multiply within the cells of another living thing, but they can remain active on a surface for several hours or days.
4 0
2 years ago
Which of the following statements is false?
mart [117]

Answer:

3 is true others are false

3 0
2 years ago
Read 2 more answers
1) what are two functions of a pick or count condition?
anastassius [24]
1. The answer is C. Pick an object at random, and keep track of how many copies of an object are left in a game.

2. The answer is D. Clockwise and counter clockwise.

3. The answer is B. To play an object's animation.

I hope you find this helpful.
5 0
2 years ago
Other questions:
  • The first step in the five-step process for problem solving is to ____. evaluate take action understand the task or need complet
    10·2 answers
  • What method of malware infection installs malware through use of a separate browser window that opens uninvited from a Web page?
    7·2 answers
  • Jason is computer professional who has access to sensitive information. He shares this information with another organization in
    8·1 answer
  • Sarah, a computer user, tells James, a computer technician, that the network she is connected to is running too slowly. Which of
    5·1 answer
  • You would like to know how many cells contain data. Which function should you use?
    11·1 answer
  • On which of the following pointing devices can you control the pointer by sliding your fingertip?
    11·1 answer
  • Translation of a file into a coded Format that occupies less space than the original file is called
    6·1 answer
  • The remove() method in the Queue interface ________. Group of answer choices retrieves, but does not remove, the head of this qu
    14·1 answer
  • g 'write a function that takes as input a list and outs a new list containing all elements from the input
    5·1 answer
  • For quantitative data (e.g. the number of milligrams of a drug) coding your data involves?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!