Question: PYTHON LANGUAGE ONLY A auto sales processing system adds a 4 digit code to a file (autoSales.dat) as soon as an auto is sold. The

PYTHON LANGUAGE ONLY

PYTHON LANGUAGE ONLY A auto sales processing system adds a 4 digitcode to a file (autoSales.dat) as soon as an auto is sold.

A auto sales processing system adds a 4 digit code to a file (autoSales.dat) as soon as an auto is sold. The first 2 digits of the code represent the sales location and the next 2 digits represent the auto model sold. For example the file containing these codes will look like this... 0402020100050109. The first 2 digit's range is 00-04 and the second 2 digit's range is 00-09 meaning there are 5 sales locations and 10 auto models. The 5 sales locations and the 10 auto models (with their prices) are as follows. Write a python script to read the given file (autoSales.dat - note that this file is very large), split and decode each code in the file and then produce a report as shown in figure 2 in page 2. When you read each code from the file, the first two digits (sales location code) is a row value of a 2-D array and the second two digits(auto model code) is the column value of the 2-D array. So when you read a code, say 0001, means the [0][1] location. So you increase the [0][1] location of the 2-D array by 1 . Similarly say code 0309 , you increase the [3][9] location of the 2-D array by 1 . So at the end of file read, you will get a 5X10 2-D array with each cell representing the number of auto models sold at each sales location. Use the example given in Class-TimeHands-On-Quiz-05-PYTH. and is :es Criteria: rigure

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!