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
When importing data using the Get External Data tools on the Data tab, what wizard is automatically
Dvinal [7]

Answer: text import wizard

Explanation:

6 0
2 years ago
the term elastic in ec2 refers to the fact that you can easily increase or decrease the number of servers you run to support an
Dvinal [7]

The phrase "elastic" refers to the ability of a user to construct, launch, and terminate server instances as needed while paying per second for active servers.

By giving users control over the physical location of instances, EC2 enables users to reduce latency and increase redundancy. the capacity to acquire resources as needed and to release resources as required. You want to carry out this task automatically in the cloud. Even if an instance becomes ill or based on criteria you specify, Amazon EC2 Auto Scaling will automatically adjust the number of instances in the group to maintain a fixed number of instances.

Learn more about server here-

brainly.com/question/14307521

#SPJ4

6 0
1 year ago
It's the same drop-down answers for both.
tia_tia [17]

Answer:

First, medium: can see all the subject but maintain the focus in him

Second, close-up: To se the facial expressions and emotions

5 0
3 years ago
Which of the following describes a Trojan horse?
HACTEHA [7]

Answer:

the answer is

c. Trojan horses enter a secure space, while an infected file proceeds to be downloaded and run.

7 0
3 years ago
Computer programming
Svet_ta [14]
Sjanqknjwolq esjkalqlkd
5 0
2 years ago
Other questions:
  • Use ________ resolution when recording human speech in an audio file.
    14·1 answer
  • SOMEONE PLEASE HELP ASAP!!
    14·2 answers
  • In order to plan George’s birthday, his father gave him a list of people who attended his birthday for the last five years. What
    8·2 answers
  • A computer processor can become extremely hot and must be cooled. A heat sink is placed on top of the processor to extract its h
    13·1 answer
  • All web page urls begin with the letters ____.
    6·1 answer
  • Which of these best represents a call to action?
    7·2 answers
  • Where can you find the sizing handles for a graphic, shape, or text box? Check all that apply.
    10·2 answers
  • Please help I will mark brainliest
    5·1 answer
  • In java I need help on this specific code for this lab.
    5·1 answer
  • Kim is writing a sql query that will pull a list of customers with outstanding orders and the sales rep for each order. What sho
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!