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
Four-pair UTP uses ________ connectors a)snap b)ST or SC c)None of these
Oliga [24]

Explanation & answer:

Four pair UTP (unshielded twisted pair) cables are common cables with RJ45 connectors.  Most RJ45 connectors have a snap to lock the male connector in place.

ST and SC connectors are for fibre-optics.

4 0
3 years ago
Choose the correct term to complete the sentence.
Alex

Answer:

the answer to your question is obviously "rational"

3 0
3 years ago
In best practice, should you use all lowercase, all uppercase or a mixture of cases in HTML tag names?
mixas84 [53]
B considering it’s proper english, we went through this about a week ago
7 0
2 years ago
A table cell contains _______ piece(s) of data.
Karolina [17]
A table cell contains one piece of data
3 0
3 years ago
Please answer this please solve it
natulia [17]

Answer:

If you still can't figure it out look this up

nvcc cafe problem

Explanation:

4 0
3 years ago
Other questions:
  • Operating systems are designed to work with specific hardware. Which operating system works with Apple computers?
    8·2 answers
  • The collection of all possible vulnerabilities that could provide unauthorized access to computer resources is called the:
    12·1 answer
  • What is the difference between a key and a superkey?
    10·1 answer
  • Which page format would you likely use for a photograph of a standing tree? AND why would you use that format?
    11·1 answer
  • Write a program that simulates flipping a coin to make decisions. The input is how many decisions are needed, and the output is
    14·1 answer
  • How can i get google assistant on my lava iris 820 smartphone easily???? ​
    10·1 answer
  • How to print wireless from laptop to samsung printer?
    6·2 answers
  • Explain what led to the invention of lasers
    7·1 answer
  • Easy way of communication with people is one disadvantage of a network. *<br><br> 1.True<br> 2.False
    9·2 answers
  • Write a loop that continually asks the user what pets the user has until the user enters rock in which case the loop ends. It sh
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!