程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

A Fund Trading System Based on Python

編輯:Python

1. Requirements Analysis

This experiment I implemented is a fund trading system.

This system is not actually operated by users, but by administrators.This system needs to implement several functions.First, you need to be able to view the information of all funds in the current market, including serial numbers, fund names, and stock prices.Second, it is necessary to generate fund transaction records, which include transaction numbers, transaction users, transaction funds, and the number of shares purchased.In addition to generating new transactions, the system should also be able to delete transactions, modify old transactions, and find transactions.Third, you need to be able to view all transaction record information.

2. Database Design

The database ER diagram is as follows:

The relational database consists of two tables.

The first table records fund information. There are three attributes, including fund number, fund name, and fund single share price.The primary key is the fund number.Each property has a non-null limit, and all are string variables.

The second table records transaction information. There are four attributes, including transaction number, transaction user name, transaction fund number, and the number of shares traded.The primary key is the transaction number.Each property has a non-null limit, where the transaction number is an auto-incrementing primary key, which is an Int type, and the rest are string variables.

The relational database is shown below

Table 1:

Table 2:

Relational database generation code:

CREATE DATABASE 'test1';CREATE TABLE `test1`.`foundation` (`foundationid` INT NOT NULL,`foundation` VARCHAR(20) NOT NULL,`price` DOUBLE NOT NULL,PRIMARY KEY (`foundationid`));CREATE TABLE `test1`.`people` (`id` INT NOT NULL AUTO_INCREMENT,`name` VARCHAR(10) NOT NULL,`foundationid` VARCHAR(10) NOT NULL,`shares` VARCHAR(10) NOT NULL,PRIMARY KEY (`id`));

3. System Display

The main interface of the system is as follows:

Click on the fund market to display the information of all funds in the current market, including fund number, fund name, and fund single share price.

Clicking on the transaction record will display all the transaction information currently recorded, including the transaction number, the name of the transaction user, the fund number of the transaction, and the number of shares traded.

Click the transaction button to display the transaction window, and you can change the transaction information, including adding, deleting, modifying, and searching for transactions.

Adding the trade will require input of the user's name, fund number and number of shares purchased.After entering the information and clicking Confirm, a transaction record will be added.For example, we add a piece of transaction information, the user name is zhou, to buy the No. 3 fund and buy 400 shares.

A popup will pop up after confirmation

Go to the transaction record window to view the currently recorded transaction information and add success

Modifying a transaction is similar to adding, for example, changing the number of shares in the transaction just now to 500

Click to confirm, check the transaction record, the modification is successful

Only need to enter the user name and the purchased fund number for the deletion operation.For example, delete the transaction of user zhou's purchase of Fund No. 3:


Search by username or fund number

For example, for the following transaction records:

If you search for zhou by name, the results are as follows:

If you search for 4 by fund number, the results are as follows:


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved