Python Programming: An Introduction to Computer Science, 3rd Ed.
Python Programming: An Introduction to Computer Science, 3rd Ed.
3rd Edition
ISBN: 9781590282755
Author: John Zelle
Publisher: Franklin, Beedle & Associates
bartleby

Concept explainers

bartleby

Videos

Question
Book Icon
Chapter 5, Problem 15PE
Program Plan Intro

Horizontal bar graph

Program plan:

  • Define the main method
    • Get the file name from the user
    • Read the number of students and assign to “numStud” variable
    • Read the names, grades from the file and store it in the variables
    • Read the names from the file line by line
      • Split the line
      • Strip the numbers
      • Append the student names and grades
    • Display the student name and grade
    • Set graph win size
    • Set the coords of the graph
    • Iterate “i” till it reaches “numStud”
      • Set the name
      • Set the text
    • Iterate “i” till it reaches “numStud”
      • Draw a rectangle box
      • Draw the line
    • Close the file
  • Call the function “main()”.

Blurred answer
Students have asked these similar questions
A python function opens file data.csv, reads the data from the file and spits the data into three columns, x, y and z. The data is then printed out. Function: f = open("data.csv ", "r") print('x\ty\tz'.format()) for row in f:     temp = row.split(',')     for cell in temp:         print(cell,end='\t')     print()   data.csv contains: 1.2,2.1,1.1 2.3,3.2,0.6 0.7,1.9,0.1 1.8,2.5,0.3 4.6,2.7,0.9
pic for input and output    pic link: fname = "https://runestone.academy/runestone/static/instructorguide/_static/arch.jpg
In Python Write a program that reads movie data from a CSV (comma separated values) file and output the data in a formatted table. The program first reads the name of the CSV file from the user. The program then reads the CSV file and outputs the contents according to the following requirements: Each row contains the title, rating, and all showtimes of a unique movie. A space is placed before and after each vertical separator ('|') in each row. Column 1 displays the movie titles and is left justified with a minimum of 44 characters. If the movie title has more than 44 characters, output the first 44 characters only. Column 2 displays the movie ratings and is right justified with a minimum of 5 characters. Column 3 displays all the showtimes of the same movie, separated by a space. Each row of the CSV file contains the showtime, title, and rating of a movie. Assume data of the same movie are grouped in consecutive rows. Ex: If the input of the program is: movies.csv and the contents…
Knowledge Booster
Background pattern image
Computer Science
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
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Constants, Variables, Data types, Keywords in C Programming Language Tutorial; Author: LearningLad;https://www.youtube.com/watch?v=d7tdL-ZEWdE;License: Standard YouTube License, CC-BY