The question is asking me to apply “user input”(Ask for a horizontal multiplier, a vertical multiplier, and a constant from the user) Could you please upload the correct code? Thanks!

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
icon
Concept explainers
Question
I attached the code. The question is asking me to apply “user input”(Ask for a horizontal multiplier, a vertical multiplier, and a constant from the user) Could you please upload the correct code? Thanks!
Small monster scientists do a great deal of work to analyze small monster migratory and feeding patterns. You have
been asked to draw a map of a simulation of how small monsters are distributed in a small area of the Knightrola
Region.
This assignment will require you to apply turtle graphics, nested for loops, user input, and simple mathematical
calculations all at once.
Ask for a horizontal multiplier, a vertical multiplier, and a constant from the user (as floats, or real numbers).
For every cell in a 10x8 grid:
Move the turtle to position (25 × horiz cell, -25 × vert cell).
Draw a circle with radius (horiz mult x horiz cell + vert mult × vert cell + constant).
Transcribed Image Text:Small monster scientists do a great deal of work to analyze small monster migratory and feeding patterns. You have been asked to draw a map of a simulation of how small monsters are distributed in a small area of the Knightrola Region. This assignment will require you to apply turtle graphics, nested for loops, user input, and simple mathematical calculations all at once. Ask for a horizontal multiplier, a vertical multiplier, and a constant from the user (as floats, or real numbers). For every cell in a 10x8 grid: Move the turtle to position (25 × horiz cell, -25 × vert cell). Draw a circle with radius (horiz mult x horiz cell + vert mult × vert cell + constant).
Code and Sample Output Screenshot:-
1 # your code starts here
2 # function to draw the 10X8 grid
3 def drawGrid(horiz_mult, vert_mult, constant):
4
# importing the turtle module
5
import turtle
6
# creating object
t = turtle.Turtle()
# setting the fillcolor to yellow
t.fillcolor ("yellow")
# looping for no. of rows
for i in range (10):
# looping for no. of columns
for j in range (8) :|
7
8
9
10
1
12
13
14
15
16
17
+ setting the position using goto method
t.goto(25 * i, -25 * j)
# set pendown
t.pendown ()
18
set to begin fill
19
t.begin_fil1()
# drawing the cirle with calculated radius
t.circle((horiz_mult * i) + (vert_mult * j) + constant)
# ending the fill
t.end_fill()
# set pen up
t.penup()
23
24
25
26
27 # call to function drawGrid
28 drawGrid(-1, 0.5 ,5)
29 # code ends here
30
A
Transcribed Image Text:Code and Sample Output Screenshot:- 1 # your code starts here 2 # function to draw the 10X8 grid 3 def drawGrid(horiz_mult, vert_mult, constant): 4 # importing the turtle module 5 import turtle 6 # creating object t = turtle.Turtle() # setting the fillcolor to yellow t.fillcolor ("yellow") # looping for no. of rows for i in range (10): # looping for no. of columns for j in range (8) :| 7 8 9 10 1 12 13 14 15 16 17 + setting the position using goto method t.goto(25 * i, -25 * j) # set pendown t.pendown () 18 set to begin fill 19 t.begin_fil1() # drawing the cirle with calculated radius t.circle((horiz_mult * i) + (vert_mult * j) + constant) # ending the fill t.end_fill() # set pen up t.penup() 23 24 25 26 27 # call to function drawGrid 28 drawGrid(-1, 0.5 ,5) 29 # code ends here 30 A
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Operators
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education