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
Click to visit W3Schools.com
KonstantinChe [14]

Is this self advertising because its not a question so i have no answer for you and if i missed something on the website that was a question let me know

3 0
3 years ago
Read 2 more answers
All websites with medical information should be considered credible.
larisa [96]
No, this is not true. WebMD is a great example asking you of simple symptoms that you may be facing and your results could present an apparent fatal disease. This constantly scares the population of netizens whenever they would want a quick diagnosis online through these medical information sites. The best solution to your symptoms is to visit your family doctor or a licensed physician who will give you proper diagnosis checking your vital signs and other related information. Do not always trust the internet and the information it gives you as a user you must take the information with discretion before reacting inappropriately. 
3 0
2 years ago
Read 2 more answers
Speed is how fast an object moves a certain distance within a length of time. How is speed calculated?
Butoxors [25]

I believe the answer to be A) because distance with the time it took to to reach the distance would determine how speed is to be calculated.

4 0
3 years ago
Read 2 more answers
Given the following code, what will be the value of finalAmount when it is displayed? public class Order { private int orderNum;
kkurt [141]

Answer:

522

Explanation:

5 0
3 years ago
What is the importance of using the proper markup language?
Klio2033 [76]

the answer is D. without the right tags the content wont be accurately indexed

3 0
3 years ago
Read 2 more answers
Other questions:
  • Jason is an aspiring filmmaker. He manages finance and makes sure that everyone is involved in the project. Which role is Jason
    12·1 answer
  • Which of the following is a malicious program that can replicate and spread from computer to computer?
    13·2 answers
  • Refer to the following code segment. You may assume that array arr1 contains elements arr1[0],arr[1],...,arr[N-1], where N = arr
    8·1 answer
  • How many worksheets display in the Excel window when you create a new blank workbook?
    10·2 answers
  • You are creating a presentation and you have come to the last slide. You still have more information to add. What should you do?
    7·1 answer
  • Which of the following is the correct financial function that returns the periodic payment for a loan?
    10·1 answer
  • The force required to slide an object is equal to _____.
    13·1 answer
  • While developing a network application, a programmer adds functionally that allows her to access the running program without aut
    14·1 answer
  • An analogue sensor has a bandwidth which extends from very low frequencies up to a maximum of 14.5 kHz. Using the Sampling Theor
    9·2 answers
  • Find 10 real world challenges and their corresponding solutions
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!