Question: Internet Programming, Python. Based on the Classic Models examples used to demonstrate the features of BIRT. We will use the database from this example for

Internet Programming, Python.

Based on the Classic Models examples used to demonstrate the features of BIRT. We will use the database from this example for the purposes of this assignment.

The database schema is in this image:

ClassicModelsDBSchema.jpg.

The database file for SQLite is classic_models.sqlite

(http://ksuweb.kennesaw.edu/~bsetzer/4720sp16/extra/examples/classic_models.sqlite)

There are two parts to this assignment:

part 1

part 2

**************

Part 1

Create two Python scripts that will print out information from the Classic Models database.

Script 1

Write a Python script that will create a list of all products in the database, providing the following information for each product:

Product Code

Product Name

Product Line

Product Scale

Product Vendor

Quantity in stock

Buy price

Manufacturers suggested retail price

Note, the product description is omitted since it can be very long.

The table should align the fields into columns. The table will probably be very wide. Print a row of headers for the columns first.

When tested, the script will be run with the file classic_models.sqlite in the script directory.

Script 2

Write a Python script that will accept a single command line parameter: the name of a product line. The script will list all the products in that product line. Display the information as in the previous script, omitting the Product Line column. Omit the production description column as well. Before the table, the script should print the product line, suitably labeled.

When tested, the script will be run with the file classic_models.sqlite in the script directory.

*********************

Part 2

Create two Python scripts that will print out information from the Classic Models database

(http://ksuweb.kennesaw.edu/~bsetzer/4720sp16/extra/examples/classic_models.sqlite)

The first script will list all customers with the following information:

Customer number

Customer name

Total of payments made

Total value of all orders made

Credit limit

Amount of available credit (credit limit plus the total payments made minus the total value of all orders made)

The list should be in a tabular format with data lined up in columns.

The second script will list the same information but will just list those customers who have exceeded their credit limit. That is, list customers for whom the total of the credit limit and the total payments made is less than the total value of orders made.

When tested, the script will be run with the file classic_models.sqlite in the script directory.

The page customer-list.html(http://ksuweb.kennesaw.edu/~bsetzer/4720sp16anoc/output/assignments/birt-sample/customer-list.html)

displays the information. NOTE! you will be creating a table in pure text. The web page was just the most convenient way to provide some data you could compare against.

Resources

classic_models.sqlite

http://ksuweb.kennesaw.edu/~bsetzer/4720sp16/extra/examples/classic_models.sqlite

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!