Thursday, September 27, 2018

First Python

First console

Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> print("Hello")
Hello
>>> name = 'Steve'
>>> print("hello, ",name)
hello,  Steve
>>> name=input("Enter your name: ")
Enter your name: Bob
>>> print ("Hello,",name)
Hello, Bob
>>> 

Hello Bob Program

#This program takes a name as input
#and outputs a greeting
#steve C 9/27/2018

#input
#process (algorithm) --
#def of algorithm--steps needed to accomplish a task
# in the order that they need to be taken
# take inputs and turn them into outputs
#output

def main():
    #get the input
    name = input('Enter your name: ')
    # print the text and variable
    print('Hello,',name)

#call main
main()

Cube program

# user enter an integer
# output a cube of that integer
# When using numbers use eval or number type int float
def main():
    number = float(input("Enter an integer: "))
    cube=number * number * number
    print("The cube is",cube)

main()

Chaos program with additional input for user to determine number of loops

# chaos program (page 13)

def main():
    print('This program illustrates a chaotic function')
    x=float(input('Enter a number between 0 and 1: '))
    y=int(input('Enter the number of loops '))
    for i in range(y):
        x=3.9 * x *(1-x)
        print(i,x)

    

main()
            

Wednesday, September 26, 2018

Afternoon Notes

Process--Organized-- out growing current system

Figure out the scope of the database:

The database will manage business transactions to make sure they are profitable. The Database will track inventory. The database will track point of sale. The database will track customers who are willing to enter data. (loyality awards). Manage requests. Manage purchases. Security. (Query or reports, profit and loss)

Gather information:

look at documents: spiral notebooks, receipts, Forms and Reports. Procedures and manuals.

Talk interview stakeholders

Job Shadowing: exceptions

Analysis: forming requirements:

Data requirements--what data has to be in the database

Reporting requirements--kinds of reports the database must produce

security requirements--Who has access to what

Inventory: Title, Year, genre, condition, rating, artist, purchase price, purchase date, Section (location), purchased from, Description, sellprice, Album version

Point of sale: employee, Date, time, album, customer (optional), discount, type of discount, taxpercent,

--don't store calculations

Customer: (frequency) name, email, phone, dateentered, birthday

Purchase: Date, Seller info, items purchased(title, condition) price paid for each

Requests: customer info, What album or artist, Condition, Year, album versions

Business Rules--

  • Only vince can purchase albums
  • If a customer purchase 5 albums they get a 15% discount on the next album
  • Only vince can do overrides
  • Customers are encouraged to register but not required
  • Sellers are required to provide contact info
  • Default sale price is 150% of purchase price.

Classroom Notes Morning

Process: Identifying the need

--lot of transaction, secure, better track of transactions--track inventory, point of sale autonomize

Setup statement of scope

The database will track inventory, and manage point of sale, track purchasing, expenses, manage profitability. The database will track customers and sellers. track requests.

Talking to primary stakeholders

2. Gathering information

Documents Notebooks used to track sales. receipts, pricing guides, purchasing Forms and Reports Manuals, procedures,

Talk stakeholders: Vince, employees, possibly customers.

Job shadowing: exceptions

3. useful and not : Requirements

inventory : accurate, updatable, album name, price purchased, purchase date every album will as unique, conditions, press date, labels, album year, artist where purchased, genres, store location, trends--queries, reports

Point of sale: customer, method(type of payment), saleprice, discount, kind of discount, saledate, vinyl, time, gross profit/ net (generally don't store calculated fields), employee, number of items

Customer : name, contact (email), zip, phone, date entered (discount for x number of purchases)

Sellers: name, contact (email), zip, phone, date entered, id

Requests: customer, album requested, date, artist, condition, date pressed, Notes<.p>

Business Rules--

  • Default sale price is 150% of the purchase price
  • Vince can always give discounts
  • Only Vince can purchase
  • Employees can only discount with Vince's permission
  • Customers are encouraged to register but not required
  • A registered customer who makes 5 purchases gets a disount on the 6th
  • Customers must be registered to get discounts
  • A customer must register to make a request
  • Sellers must register