Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Internet Programming, Python. Based on the Classic Models examples used to demon

ID: 3677293 • Letter: I

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 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

Manufacturer’s 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/4720sp16/nanoc/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

Explanation / Answer

print ProductCode
print ( Name )
print ( Line )
print ( Scale )
print ( Vendor )
print ( QuantityInStock )
print ( BuyPrice )
print (SuggestedRetailPrice)

print ProductCode
print ( Name )
print ( Line )
print ( Scale )
print ( Vendor )
print ( QuantityInStock )
print ( BuyPrice )
print (SuggestedRetailPrice)


# read the name of product line
mesg = 'Please Input the name of product line'
input ([mesg])
# or
input('Please Input the name of product line')
print("product lines")
print("Cosmetics")

print("Food Items")


print ("Pet Line")


print("Clothings")


print("Dress Materials")


print("Diary Products")

print("Frozen Meat")

print("Freh garden produce")

print("Fresh fruits and vegetables")

print("processed food packets")


print("Poultry")

print("Fish Tuna King Prawn Baby Prawn")


print("Eggs")


print ("Chocolates")

print("Bread")


print ("Biscuits")

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote