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
Pls help.
melisa1 [442]

Answer:

First one would be work ethic.

Second one would be communication.

Third one would be adaptability.

Fourth one would be creativity.

(These are all guesses tho, so i'm not 100% sure !!)

Explanation:

6 0
3 years ago
Read 2 more answers
The Linux operating system is widely used in industry, especially for servers. Why do you believe this is the case?
Anit [1.1K]

Answer:

Asking why Linux is used as a server operating system? It has many advantages

Explanation:

1. Linux has very small kernel footprints

It can be on a USB, embedded system and the like.

2. Requires very little hardware resource to run.

Building on the first point, Linux dos not need much jard ware resource to run implying it can be run on outdated CPUs, a low RAM size, small disk space and it would be possible - doesn't matter with Linux - bar the effect on performance.

3. Linux runs 80% of the Internet today

4. It's free

...... and so much more.

- Reference: Andrew Holcomb, Quorate

How Linux compares with other OS - like Windows or Mac?

May Help:

https://www.quora.com/What-are-the-advantages-of-Linux-as-a-server-operating-system

Recommendation: Jason Montoya and Glen Becker, BI Analyst, SAS Expert

6 0
3 years ago
_________ Code that you write is called primary code, and code that the compiler produces after processing the primary code is c
Kazeer [188]

Answer:

The correct answer for the given question is  "source code"

Explanation:

When you writing a code in any programming language that code is known as  source code.The source code is also known as primary code, when source code is compiles it produce runtime code.

The source code is created by the compiler it can be easily understood by the human being.

for example in c language we write a source code after compilation it produces object code .

5 0
4 years ago
Does someone know what type of usb is that one called?
Doss [256]
It is USB 2.0 mini b 5 pin

3 0
3 years ago
Read 2 more answers
2.3 Code Practice: Question 2
V125BC [204]

<u>Answer:</u>

<em>feetFab1 = int(input(""Enter the value in feet for the 1st  piece of fabric: ""))</em>

<em>inchFab1 = int(input(""Enter the value in inches for the 1st  piece of fabric: ""))</em>

<em />

<em>feetFab2 = int(input(""Enter the value in feet for the 2nd  piece of fabric: ""))</em>

<em>inchFab2 = int(input(""Enter the value in inches for the 2nd  piece of fabric: ""))</em>

<em />

<em>feetSum = (feetFab1 + feetFab2)</em>

<em>inchSum = (inchFab1 + inchFab2)</em>

<em />

<em>totalFeet = ((inchSum % 12) + feetSum)</em>

<em>totalInch = (feetSum % 12)</em>

<em>print (""Feet: "" + str(totalFeet) + "". Inches: "" + str(totalInch))</em>

7 0
3 years ago
Other questions:
  • Create an enumeration named Month that holds values for the months of the year. With JANUARY equal to 1, FEBRUARY equal to 2, an
    13·1 answer
  • If you were optimizing for performance and wanted to support potentially adding many new elements to an adt, then:
    12·1 answer
  • A(n) ____ web site structure connects web pages in a treelike structure.
    6·1 answer
  • Me2540 week 5 assignment<br> what do i want to know?
    9·1 answer
  • Which statement best illustrates the relationship between three different
    12·1 answer
  • A methods and measurements analyst for Digital Devices needs to develop a time standard for the task of assembling a computer mo
    15·1 answer
  • A palindrome is a word or a phrase that is the same when read both forward and backward. Examples are: "bob," "sees," or "never
    7·1 answer
  • Which of the following statements is FALSE?
    5·1 answer
  • Consider some of the widespread global issues that we face here on Earth and briefly describe them. Then, choose one of the spac
    8·1 answer
  • Compare the strengths and limitations of modern computer programming <br> languages.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!