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
Which of the following electronic collaboration techniques is the best
muminat

Answer:

D. project management software

6 0
3 years ago
Read 2 more answers
Can we change the format of a field (e.g. Number to Dollars).
mixer [17]

I think the answer is

3 - Usually, but we may need to convert the data types (date to text)

Because we can change the format, but depends of the original format type and in what type you need to format.

I think this can help.

3 0
3 years ago
.Why are protocols important for networking?
NNADVOKAT [17]

Answer: Networking protocols are important as they define a set of rules to be used for exchanging information between computer nodes.

Explanation:

in terms of networking it is required for the source and the destination to have a set of predefined rules which enables the router to send and receive information across the network in such as way that both the ends are able to receive the messages.

The information exchange takes place first by the client by introducing itself to the remote server. the remote server upon receiving the information uses some form of handshaking and acknowledges the client of the receipt of the message.

besides this there are many routing protocols which tells us about the way how packets are sent from the client to the source. There are two types of routing protocols:

1. static routing protocols

2. dynamic routing protocols.

6 0
3 years ago
Uses computer resources from multiple locations to solve a common problem.
Lynna [10]

Answer:

Distributed Computing is used to solve common problem from multiple locations at different locations.

Explanation:

It is the architecture of processor, that is used to combine the different resources of computer from different domain to solve the common problem.

It allows us resource sharing such as hardware and software that are connected to the computer.

Examples

Following are the examples of Distributed computing.

  1. Telecommunication Network
  2. sensor network
  3. banking network

8 0
3 years ago
A example of an <br> "ITERATIVE STATMENT"
timama [110]

Answer:

for(let i = 0: i <=5; i++) {

console.log(I)

}

Explanation:

An iterative statement repeats a body of code until the condition is not true. Here we declare an integer (i) and make it 0. Then the loop checks if the second part is true (i is less than or equal to 5), and if it is true, it executes the code inside the loop body, which logs i, and finally runs the last past, which increments i by one. When the second part becomes false, the loop exits.

7 0
2 years ago
Other questions:
  • Write a function called calculate() that accepts three integer Numbers as arguments, compute these values : Sum and Product and
    7·1 answer
  • Write a program with total change amount as an integer input that outputs the change using the fewest coins, one coin type per l
    7·1 answer
  • TLO 06 Active Directory Domain and Trusts tool is used to move servers between site in an AD Infrastructure.a. Trueb. False
    14·1 answer
  • The default color scheme is called ____.
    7·1 answer
  • Which of the following is a command shell with a built-in scripting language?1. The Server Manager’s Roles and Features wizard2.
    11·2 answers
  • Which font style is said to be slightly above the other line of text?
    8·2 answers
  • How do you implement instruction level parallelism
    11·1 answer
  • Why are object-oriented languages very popular?
    11·2 answers
  • When right-clicking an object, a ____ menu appears, which contains frequently used commands related to the object.
    7·1 answer
  • Kevin would like to ensure that his software runs on a platform that is able to expand and contract as needs change. Which one o
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!