CE 392D - Dynamic Traffic AssignmentFall 2024Homework 1Due on Canvas at 11:59 PM, Friday, September 6. Submit two files: a PDF containing your solutions to the textbook problems, and a ZIP file containing your code for the Python problems. More details below on how to submit the Python code. Textbook questionsMake sure you are using the version of the book posted on Canvas. Chapter 9: Exercises 2, 3, 6, 11, 16, 18 Python questionsQuestion 1: MultiplicationDownload and unzip these files to a convenient directory. You will be editing three files in this
assignment: At a command prompt, type Running multiplication test: tests/q1/1-regular.test......not yet attempted Running multiplication test: tests/q1/2-negative.test......not yet attempted Running multiplication test: tests/q1/3-zero.test......not yet attempted Running multiplication test: tests/q1/4-float.test......not yet attempted Running data structures test: tests/q2/1-3students.test......not yet attempted Running data structures test: tests/q2/2-6students.test......not yet attempted Running classes test: tests/q3/1-3students.test......not yet attempted Running classes test: tests/q3/2-6students.test......not yet attempted SCORES: Q1: Multiplication 0/4 Q2: Data structures 0/6 Q3: Classes 0/2 ---------- TOTAL: 0/12 This is an unofficial score, please submit code on Canvas for final scoring. The score is reported as 0, since you have not yet attempted any of the questions. Open def calculate_product(factor1, factor2): # *** YOUR CODE HERE *** # Replace the following statement with your code for calculating and returning the product of factor1 and factor2 raise utils.NotYetAttemptedException Delete the line Running multiplication test: tests/q1/1-regular.test......pass Running multiplication test: tests/q1/2-negative.test......pass Running multiplication test: tests/q1/3-zero.test......pass Running multiplication test: tests/q1/4-float.test......pass Running data structures test: tests/q2/1-3students.test......not yet attempted Running data structures test: tests/q2/2-6students.test......not yet attempted Running classes test: tests/q3/1-3students.test......not yet attempted Running classes test: tests/q3/2-6students.test......not yet attempted SCORES: Q1: Multiplication 4/4 Q2: Data structures 0/6 Q3: Classes 0/2 ---------- TOTAL: 4/12 This is an unofficial score, please submit code on Canvas for final scoring. Your code passed all of the tests for the multiplication question, so you have a score of 4/4 for the first question. You can examine
the test instances used in the In each test folder, there is a file called Question 2: Built-in data structuresIn the online Python tutorial, you should have learned about lists, tuples, and dictionaries. These are very useful built-in data structures in Python that we will be using throughout the course. Question 2 involves lists and tuples, and can be solved only using these. If you are not comfortable with dictionaries, you will find it instructive to solve the problem a second time, converting the tuples into a dictionary and operating with the grade records as a dictionary. If done correctly, both implementations will pass the autograding script with a perfect score. Open The Question 3: Python classesIn the online Python tutorial, you should have learned the basics of how Python classes operate. The Open At the bottom of this file is the Submission instructionsYour answers to the textbook questions should be placed in a single PDF file and uploaded to Canvas. Please verify that your file uploaded correctly, that the pages are in the right order, etc. For the Python questions, submit a single ZIP file and upload to Canvas. Please follow these instructions:
unzip hw1.zip diff -bur master/ hw1/ # master is the original version; this shows me your changes cd hw1 cat README.txt python3 grader.py cd .. rm -r hw1 hw1.zip |