Starting from:

$29.99

CS104 Homework 06 Solution


1.  Please implement a Python program that takes generates the file system tree, creates the text files and fills them in as shown in the diagram. Note that circles represent directories and rectangles represent files.

2.  Please check the file called “students.dat”. In this file, there are 6 columns representing number, name, surname, birth place, department and GPAs of students.
Please read the data from the file and put them into a dictionary. Additionally implement, five functions which take number as input and print the necessary information. For example, when you say print_birth_place(81709043) , it shall print “Detroit”.
• print_name(student_number)
• print_surname(student_number)
• print_birth_place(student_number)
• print_department(student_number)
• print_gpa(student_number)
4. (25 pts) Please check the “shapes.csv” file. This file holds data about some geometric shapes (rectangles, trapezoids, and circles). The data entries are separated by commas and the lines that are comments, start with “#” as the first non-whitespace character
(lines 1, 2, 3, 9, 10, 11 etc.)

Please implement a program that reads this file in and computes the necessary areas and then creates three output files that are “rectangles.csv”, “trapezoids.csv”, “circles.csv”. This files shall include the input values as the initial columns and as the final column the computed areas. For example

More products