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]
4 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]4 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
Why do organizations create multiple databases?
igomit [66]
Just in case one database gets hacked or crashes they have another to run on
5 0
4 years ago
Create a Word document or text file named Part3 that contains answers to the following:
Gnoma [55]

Answer:

11111

Explanation:

4 0
3 years ago
Lola wants to install an add-in in Excel.She has to unblock the add-in to allow Excel to open the add-in file automatically.To d
ololo11 [35]

Answer:

The correct answer is:

Properties (D)

Explanation:

First of all, option D (Properties) is the option that makes the most sense in this scenario, because the other options: Copy, Delete, and Rename are unrelated commands to what is to be achieved.

Secondly and more practically, an add-in file may not load in excel, and most of the time it is blocked by default and has to be unblocked. The following steps are used:

1. close Excel if it is open

2. open the folder where the add-in file is located, right-click on the add-in file, and select "properties"

3. a display tray will appear, having the attributes: Read-only, Hidden, Advanced, and unblock. Click the checkbox against "unblock" and make sure it is checked.

4. click Apply and Click Ok

Voila, your add-in file is unblocked.

<em>N:B The Images are for steps 2 and 3</em>

5 0
3 years ago
The steps for moving data from one cell to another are _____.
swat32
The steps for moving data from one cell to another are : 
Select the cell by pointing on the cell clicking it, and dragging it to the new cell. <span>To move a cell or range of cells, point to the border of the selection. When the pointer becomes a move pointer , drag the cell or range of cells to another location.</span>
3 0
3 years ago
A professional development plan allows an employee to
drek231 [11]
Answer: (B) evaluate current skill level and determine what skills are necessary to advance

Explanation: A professional development plan is used to assess your current skills and see what’s needed to further advance within the field.
7 0
3 years ago
Other questions:
  • Most common level of education for a programmer or software developer
    9·1 answer
  • What can be done to improve the security of business uses of the Internet? Give several examples of ecurity measures and technol
    9·1 answer
  • A developer has made a change to an Automation Anywhere TaskBot using the Enterprise Client interface. When running the bot from
    10·1 answer
  • // GetData() method accepts order number and quantity // that are used in the Main() method // Price is $3.99 each using System;
    14·1 answer
  • Gary lives in an area that receives a lot of rain throughout the year. which device would be useful to him to maintain his compu
    8·1 answer
  • Briefly tell me what a PUT request does
    11·1 answer
  • There are types of templates​
    5·1 answer
  • Complete the AscendingAndDescending application so that it asks a user to enter three integers. Display them in ascending and de
    7·1 answer
  • Listening to the audience refers to what in the context of slide presentations
    7·2 answers
  • If an algorithm created to help make hiring decisions is based on previous unfair decisions, then the algorithm may be
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!