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 is the QOS model?
Andre45 [30]

Answer:

Quality Of Service

Explanation:

Technology that manages data traffic to reduce packet loss, latency and jitter on the network. QoS controls and manages network resources by setting priorities for specific types of data on the network.

5 0
2 years ago
Which item is used for formatting in responsive web design?
trapecia [35]

Answer:

4. Removing horizontal scroll

Explanation:

Horizontal scroll can be super annoying when you're trying to view someone's web page. It can cut off part of your view and ruin the whole experience. It's best to eliminate horizontal scroll completely wherever you can.

5 0
2 years ago
Design a 16K x 8 memory using the following ICs:
Montano1993 [528]

Answer:

Required memory size is 16k x 8

16k = 24 x 210 = 214

Hence, No. of address lines = 14

No. of data lines = 8

a) Size of IC 1024 x 1

Total number of ICs required = 16k x 8 / 1024 x 1 = 16 x 8 = 128

b) Size of IC 2k x 4

Total number of ICs required = 16k x 8 / 2k x 4 = 8 x 2 = 16

c) Size of IC 1k x 8

Total number of ICs required = 16k x 8 / 1k x 8 = 16 x 1 = 16

Explanation:

For a, 10 address lines from A0 to A9 are used to select any one of the memory location out of 1024 memory locations present in a IC.

For b, 11 address lines from A0 to A10 are used to select any one of the memory location out of 2k=2048 memory locations present in a IC.

For c, 10 address lines from A0 to A9 are used to select any one of the memory location out of 1k=1024 memory locations present in a IC.

3 0
3 years ago
To add a pattern to a page, navigate to the _____ feature.
vfiekz [6]

Answer:

Pattern adding feature

7 0
3 years ago
Which of the following statements is/are true by definition.
Rudik [331]

Answer:2. electrical equipment shall be considered readily accessible to those to whom ready access is requisite when it is capable of being reached quickly for operation by using a portable ladder.

Explanation:

3 0
3 years ago
Other questions:
  • Only the _________ can add users with passwords and limit user access to selected areas.
    5·1 answer
  • What would I need to make the perfect music video
    10·1 answer
  • Why might location be important when searching for a job?
    10·2 answers
  • How might writing an online journal be different than writing in a paper one ​
    15·2 answers
  • What is out put.what is data. what is microprocessor
    14·1 answer
  • What is an identified component of a software program that might allow a hacker or other intruder to gain entry and control of a
    10·2 answers
  • Columns are labeled with letters and Rows are labeled with numbers.
    5·1 answer
  • Based on the code you created in this Unit, propose a way to re-use most of the code (with different information in the variable
    14·1 answer
  • I want to start a debate about something
    9·2 answers
  • Prior to the 1996 NEC, ____ receptacles and cords were permitted. However, now it is mandatory that a separate equipment groundi
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!