
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
First picture is assignment I need help with, second picture is my code from assignment 17. Using python
![This image contains a Python script using the `turtle` graphics library. The script appears to draw a bar chart representing the number of first-language speakers for five major languages. Here's a breakdown of the code:
```python
import turtle
heights = [856, 420, 360, 260, 205]
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)
# Draws a filled rectangle with bottom left corner (x, y)
# With height h and width w, colorPen color, and colorFill color
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_fill()
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()
```
### Explanation:
- **Imports and Variables**: The script imports the `turtle` module and sets the `heights` list, representing the number of speakers in millions](https://content.bartleby.com/qna-images/question/63588563-b3b2-4480-9fdb-3701254cc374/95ea5064-49eb-4515-b7fc-60af3212a873/wu168g_thumbnail.jpeg)
Transcribed Image Text:This image contains a Python script using the `turtle` graphics library. The script appears to draw a bar chart representing the number of first-language speakers for five major languages. Here's a breakdown of the code:
```python
import turtle
heights = [856, 420, 360, 260, 205]
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)
# Draws a filled rectangle with bottom left corner (x, y)
# With height h and width w, colorPen color, and colorFill color
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_fill()
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()
```
### Explanation:
- **Imports and Variables**: The script imports the `turtle` module and sets the `heights` list, representing the number of speakers in millions

Transcribed Image Text:**Assignment Description for Educational Website**
---
**Title: Language and PC Vendor Data Visualization**
---
**Introduction:**
In this assignment, you will refine your skills in data visualization using Python. Building on the concepts learned in Assignment #17, you will create a program to generate specific graphs accurately.
**Graph 1: Principal Languages of the World**
- **Description:** This graph displays the number of first-language speakers (in millions) for five of the world's principal languages.
- **Languages and Values:**
- **Mandarin:** 856 million
- **Spanish:** 420 million
- **English:** 360 million
- **Hindi:** 260 million
- **Bengali:** 205 million
**Graph 2: Worldwide PC Vendor Unit Shipment Estimates for Q4 2018**
- **Description:** This bar graph illustrates the estimated number of units shipped (in thousands) by various PC vendors during the fourth quarter of 2018.
- **Vendors and Values:**
- **Lenovo:** 16,628 thousand units
- **HP Inc.:** 15,380 thousand units
- **Dell:** 10,915 thousand units
- **Apple:** 4,920 thousand units
- **ASUS:** 4,211 thousand units
- **Acer Group:** 3,861 thousand units
- **Others:** 12,710 thousand units
**Instructions:**
- Create a new Python program based on the guidelines of Assignment #17.
- Modify your code to generate a graph that matches the "Worldwide PC Vendor Unit Shipment Estimates" chart exactly.
- Ensure your program includes comments at the top with your name and other descriptive information.
- Double-check that the visual alignment, colors, and text details are precise.
---
**End of Assignment**
**Note:** Pay careful attention to graph styling and data accuracy for the best results.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 1 images

Knowledge Booster
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
- For this homework assignment you are not allowed to use::MOVSB, MOVSW, MOVSD, CMPSB,CMPSW,CMPD,SCASB, SCASW, SCASD,STOSB, STOSW, STOSD, LODSB, LODSW, and LODSD. It is required that for each question write only one procedure that does the requested job. Only write the assembly part and avoid using directives. DO NOT USE IRVINE'S LIBRARY. Write a general-purpose program (only assembly code and no procedure call) that inserts a source string to the beginning of a target string. Sufficient space must exist in the target string to accommodate the new characters. Here is a sample call:.datatargetStr BYTE "Stanford",30 DUP(0)sourceStr BYTE "Kamran ",0.codearrow_forwardIn Python Initially, you will prompt the user for the names of two files: one will contain Customer information, and the other will contain Product information, as described below. Sample files are attached (below) to this project so you can download and review them. Some test cases may use other files, which you will not be able to see, so it is important that your program ask the user for the file names, and be able to open and read any file. The Customer Information file will be a csv file, with no header row, in which each line has the following fields, which are separated by commas. Customer_Number Customer_Name Customer_Balance Customer_Password For example, the sample file named customers.csv has several lines, and the first two are: 24155,"Carey, Drew Allison",838.41,Bo7&J 24426,"Butler, Geoffrey Barbara",722.93,Ep5& The Product Information file will be a csv file, with no header row, in which each line has the following fields, which are separated by commas:…arrow_forwardSolve In Python Provide Screenshots of input and output You have been asked by the Olympic committee to write a program for scoring the Olympic diving events. In an Olympic diving event, each dive has a degree of difficulty (DD). The dives are evaluated by a panel of 7 judges who can award 0 to 10 points. To determine an athlete's final score for a dive, the highest and lowest judges scores are discarded and then the average of the rest of the scores are calculated. The average is then multiplied by the DD, resulting in the final score for the dive. Write a program that will read in the attached data file that contains the event information. Each tab separated line will contain in order: -A diver name -The DD -7 scores for the dive Your program should parse this file and output the divers name, the dive DD, and the score for that dive. REMEMBER to submit your source code, and a screenshot of your output. The input file should be attached to this dropboxarrow_forward
- Look over Python assignment and answer one question. Hi, I have attached both the assignment directions and a copy of my work so far. I wanted to make sure I was properly explaining the results. I also don't understand why the last print statement, print(2//3) has a result of zero instead of 8. Thanks so much.arrow_forwardI need some help with project 5 in program logicarrow_forwardPlease explain what you mean by "execution flow."arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

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)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education