Change Contents of the Bubble
Welcome to CS1315. Click on the python to add comments.

Looking for the book? They have it at the Engineer's Bookstore at 748 Marietta St NW. Here is there website: http://www.engrbookstore.com/ - Monica

Hotspots: Slides and CodeTA CornerComments?AnnouncementsFAQStatic Webspace
View this PageEdit this Page (locked)Uploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

new HW4

Consider the following MySQL table in a database called `classes`

Table name: `grades`
+----------+--------+--------+--------+-------+
|   Name   | Test 1 | Test 2 | Test 3 | Final |
+----------+--------+--------+--------+-------+
|  Gallant |  100   |  88    |  91    |  97   |
+----------+--------+--------+--------+-------+
|  Goofus  |  63    |  20    |   38   |  0    |
+----------+--------+--------+--------+-------+
|                  and so on                  |
|                                             |
|                       .                     |
|                       .                     |
|                       .                     |
|                                             |
+----------+--------+--------+--------+-------+


Write a function makeGraph() that takes no inputs in a file called hw4.py which will connect to this database and generate a bar graph representation of the grades.

Use the addText function to write the students names down the left side of the picture and addRectFilled function to create the bar graph with the length corresponding to that student's overall grade. To compute the final grade, each test is worth 20% and and the final is worth 40%.

The students must be sorted in some way, either by name or grade, increasing or decreasing.

To connect to the database, add the following function to your hw4.py
def con():
	#it's all you, Blair!



To connect to the database use:
connection = con()

and to receive query results, use:
results = connection.query("put SQL query here") #need to double check this


Extra credit opportunities (3 points each):



Link to this Page