For this assignment, create a new program that will be similar to Assignment #17. Make modifications so that your new program produces the following graph. It should match this graph exactly: by YOUR NAME GOES HERE 16628 15380 12710 10915 4920 4211 3861 Lenovo HP Inc. Dell Apple ASUS Acer Group Others Worldwide PC Vendor Unit Shipment Estimates for 4Q18 (in thousands of units shipped) Be sure to include comments at the top of your Python program with your name and other descriptive information

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter10: Classes And Data Abstraction
Section: Chapter Questions
Problem 23PE
icon
Related questions
Question
First picture is assignment I need help with, second picture is my code from assignment 17. Using python
import turtle
heights = [856, 420, 360, 260, 2051|
def main () :
t=turtle.Turtle ()
t.hideturtle ()
for i in range (5) :
drawFilledRectangle (t, -200+i*75, 0, 75, heights[i]/4, "black", "light blue")
displayText (t).
#Draw a filled rectangle with bottom left corner (x, y)
#With height h and width w, colorP-pen color, colorF=Fill color, t is a turtle object
def drawFilledRectangle (t, x, y, w, h, colorP, colorF):
t.pencolor (colorP)
t.fillcolor (colorF)
t.up ()
t.goto (x, Y)
t.down ()
t.begin fill()
t. goto (x+w,y)
t.goto (x+w,y+h)
t.goto (x, y+h)
t.goto (x, Y)
t.end fil1()
def displayText (t):
languages=["Mandarin", "Spanish", "English", "Hindi", "Bengali"]
t.pencolor ("Blue")
t.up ()
for i in range (5) :
#display numbers for each rectangle
t.goto (-200+38+ (75*i), heights[i]/4)
t.write (str (heights[i]),align=' center', font=("Arial",10,'normal'))
#Display languages for each rectangle
t.goto (-200+38+ (75*i), 5)
t.write (languages [i],align='center', font=("Arial",10,'normal'))
#display title below chart
t.goto (-200,-25)
t.write ("Principal Languages of the World",align='left', font=("Arial",10, 'normal'))
t.goto (-200,-40)
t.write (" (in millions of \"first language\" speakers) ",align='left', font= ("Arial",10,'normal'))
main ()
Ln: 3 Col: 4
Transcribed Image Text:import turtle heights = [856, 420, 360, 260, 2051| def main () : t=turtle.Turtle () t.hideturtle () for i in range (5) : drawFilledRectangle (t, -200+i*75, 0, 75, heights[i]/4, "black", "light blue") displayText (t). #Draw a filled rectangle with bottom left corner (x, y) #With height h and width w, colorP-pen color, colorF=Fill color, t is a turtle object def drawFilledRectangle (t, x, y, w, h, colorP, colorF): t.pencolor (colorP) t.fillcolor (colorF) t.up () t.goto (x, Y) t.down () t.begin fill() t. goto (x+w,y) t.goto (x+w,y+h) t.goto (x, y+h) t.goto (x, Y) t.end fil1() def displayText (t): languages=["Mandarin", "Spanish", "English", "Hindi", "Bengali"] t.pencolor ("Blue") t.up () for i in range (5) : #display numbers for each rectangle t.goto (-200+38+ (75*i), heights[i]/4) t.write (str (heights[i]),align=' center', font=("Arial",10,'normal')) #Display languages for each rectangle t.goto (-200+38+ (75*i), 5) t.write (languages [i],align='center', font=("Arial",10,'normal')) #display title below chart t.goto (-200,-25) t.write ("Principal Languages of the World",align='left', font=("Arial",10, 'normal')) t.goto (-200,-40) t.write (" (in millions of \"first language\" speakers) ",align='left', font= ("Arial",10,'normal')) main () Ln: 3 Col: 4
In Assignment #17, you created a program to generate the following graph:
856
420
360
260
205
Mandarin
Spanish
English
Hindi
Bengali
Principal Languages of the World
(in millions of "first language" speakers)
For this assignment, create a new program that will be similar to Assignment
#17. Make modifications so that your new program produces the following
graph. It should match this graph exactly:
by YOUR NAME GOES HERE
16628
15380
12710
10915
4920
4211
3861
Lenovo
HP Inc.
Dell
Аpple
ASUS
Acer Group
Others
Worldwide PC Vendor Unit Shipment Estimates for 4Q18
(in thousands of units shipped)
Be sure to include comments at the top of your Python program with your
name and other descriptive information
Transcribed Image Text:In Assignment #17, you created a program to generate the following graph: 856 420 360 260 205 Mandarin Spanish English Hindi Bengali Principal Languages of the World (in millions of "first language" speakers) For this assignment, create a new program that will be similar to Assignment #17. Make modifications so that your new program produces the following graph. It should match this graph exactly: by YOUR NAME GOES HERE 16628 15380 12710 10915 4920 4211 3861 Lenovo HP Inc. Dell Аpple ASUS Acer Group Others Worldwide PC Vendor Unit Shipment Estimates for 4Q18 (in thousands of units shipped) Be sure to include comments at the top of your Python program with your name and other descriptive information
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Graphical User Interface
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning