You are on page 1of 20

VNR Vignana Jyothi Institute of Engineering and Technology (Affiliated to

J.N.T.U, Hyderabad)
Bachupally(v), Hyderabad, Telangana, India.

MARS TRADING PLATFORM

A course project submitted in complete requirements for the award of the degree of

BACHELOR OF TECHNOLOGY

IN

COMPUTER SCIENCE AND ENGINEERING

Submitted by

ANURAAG CHILAKAMARRI (20071A0505)


BELIGINI SHIVA TEJA (20071A0508)
BENDUKURI RISHAB (20071A0509)
GANGISHETTY MANIDEEP (20071A0518)
GUMMADI MAHESH GANDHI CHOWDARY (20071A0521)
KONDAM SAI SRUTHIN REDDY (20071A0534)

Under the guidance of


Mrs. Swapna Shetty
Assistant Professor
Dept. of Computer Science and Engineering
VNR Vignana Jyothi Institute of Engineering and Technology (Affiliated
to J.N.T.U, Hyderabad)
Bachupally(v), Hyderabad, Telangana, India.

CERTIFICATE

This is to certify that C.Anuraag (20071A0505) , B.Shiva Teja (20071A0508),


B.Rishab (20071A0509), G.Manideep (20071A0518) , G.Mahesh Gandhi
(20071A0521) and K.Sai Sruthin Reddy (20071A0534) have completed their
course based project work ( OOPS using C++ ) at CSE Department of VNR
VJIET, Hyderabad entitled “MARS TRADING PLATFORM” in partial
fulfilment of the requirements for the award of B.Tech degree during the
academic year 2021-2022. This work is carried out under my supervision and
has not been submitted to any other University/Institute for award of any
degree/diploma.

Mrs. Swapna Shetty Nagini Sabbineni

Assistant Professor Professor and Head

CSE Department CSE Department

VNRVJIET VNRVJIET
DECLARATION

This is to certify that our project report titled “MARS TRADING


PLATFORM" submitted to Vallurupalli Nageswara Rao Institute of
Engineering and Technology in complete fulfilment of requirement for the
award of Bachelor of Technology in Computer Science and Engineering is a
bona fide report to the work carried out by us under the guidance and
supervision of Mrs. Swapna Shetty , Assistant Professor, Department of
Computer Science and Engineering, Vallurupalli Nageswara Rao Institute of
Engineering and Technology. To the best of our knowledge, this has not been
submitted in any form to other university or institution for the award of any
degree or diploma.

C. Anuraag B.Shiva Teja B.Rishab


20071A0505 20071A0508 20071A0509
CSE-1 CSE-1 CSE-1

G.Manideep G.Mahesh Gandhi K.Sai Sruthin Reddy


20071A0518 20071A0521 20071A0534
CSE-1 CSE-1 CSE-1
ACKNOWLEDGEMENT

I would like to express my gratitude and appreciation to all those who gave me
the possibility to complete this report. Special thanks is due to our Professor,
Mrs. Swapna Shetty whose help, stimulating suggestions and encouragement
helped us in all time of fabrication process and in writing this report. I also
sincerely thank for the time spent proofreading and correcting our mistakes.

Behind every achievement lies an unfathomable sea of gratitude to those who


activated it, without which it would ever never have come into existence. To
them I lay the words of gratitude imprinting within us.

VNRVJIET has helped us transform ourselves from mere amateurs in the field
of Computer Science into skilled engineers capable of handling any given
situation in real time. I am are highly indebted to the institute for everything
that it has given us.

We would like to express our gratitude towards the principal of our institute,
Dr. Challa Dhanunjaya Naidu and the Head of the Computer Science &
Engineering Department, Nagini Sabbineni for their kind co- operation and
encouragement which helped us complete the project in the stipulated time.
ABSTRACT

 The basic dematerialized account of a stock market trader can be


maintained and controlled and some standard operations can be
performed on it by using classes and template inbuilt in C++
 Also by using classes in C++ it makes sure that the details of the Demat
account of a particular user cannot be accessed by anyone else without
the credentials and makes sure the operations on the data is not performed
on accident.

 The basic data of the dematerialized account of a stock broker as well as


the current info of the stocks is stored in the back-end by using DBMS
implemented by using SQL+.
 The data can be altered when the command is given from the front end by
using the DML commands.
 New stocks can be implemented by using the DDL commands.
 Overall consistency and integrity of the data is maintained using DBMS.
INDEX

1. Introduction....................................................................................................7

2. Literature Survey...........................................................................................7

3. Requirements...................................................................................................8

4. Implementation................................................................................................9

5. Applications……………………………………………………14

6. Conclusion......................................................................................................14
1. Introduction
The stock market broadly refers to the collection of exchanges and other
venues where the buying, selling, and issuance of shares of publicly held
companies take place. This app allows investing funds from smartphone to
companies. Helps to become a shareholder of a company.
2. Literature Survey
A stock market, equity market, or share market is the aggregation of
buyers and sellers of stocks (also called shares), which represent ownership
claims on businesses; these may include securities listed on a public stock
exchange, as well as stock that is only traded privately, such as shares of
private companies which are sold to investors through equity crowdfunding
platforms. Investment in the stock market is most often done via
stockbrokerages and electronic trading platforms. Investment is usually made
with an investment strategy in mind.
A Stock market app allows Investing funds from smartphone to companies.
Helps to become a shareholder of a company. Some of the features of
application:
User account is a panel in application where users can enter their personal data,
adapt the application settings for themselves.
Balance and reporting panel display the real-time data about the user’s balance,
about the companies whose shares he or she owns, about the value of the
purchased assets, etc.
Tools for assets sale and purchase - Here you should provide for the display of
charts with the value of assets at a certain time interval, which are updated in
real time.
Anyone who have access to database can change the cost of items and add new
items in the database. Each and every user will have dedicated account for him,
in which he will have his application valet and stocks that he hold.

7
3. Requirements

 XAMPP:
XAMPP is a free and open-source cross-platform web server solution stack
package developed by Apache Friends,[2] consisting mainly of the Apache
HTTP Server, MariaDB database, and interpreters for scripts written in the
PHP and Perl programming languages. Since most actual web server
deployments use the same components as XAMPP, it makes transitioning from
a local test server to a live server possible.
 DEV CPP:

Dev-C++ is a free full-featured integrated development environment (IDE)


distributed under the GNU General Public License for programming in C and
C++. It was originally developed by Colin Laplace and first released in 1998. It
is written in Delphi.
It is bundled with, and uses, the MinGW or TDM-GCC 64bit port of the GCC
as its compiler. Dev-C++ can also be used in combination with Cygwin or any
other GCC-based compiler
 CODEBLOCKS:

Code::Blocks is a free, open-source cross-platform IDE that supports multiple


compilers including GCC, Clang and Visual C++. It is developed in C++ using
wxWidgets as the GUI toolkit. Using a plugin architecture, its capabilities and
features are defined by the provided plugins. Currently, Code::Blocks is
oriented towards C, C++, and Fortran. It has a custom build system and
optional Make support.
Code::Blocks is being developed for Windows and Linux and has been ported
to FreeBSD,[2] OpenBSD[3] and Solaris.[4] The latest binary provided for
macOS version is 13.12 released on 2013/12/26 (compatible with Mac OS X
10.6 and later), but more recent versions can be compiled and MacPorts
supplies version 17.12.
 MYSQL Header files:
Mysql headers are not available by default in GCC provided by Code::Blocks.
So we need to put all Sql header files in include folder of Mingw64 provided
by Dev-C++ and link with path in code::Blocks.
 MYSQL library
We have to set path of libmysql.a file in linker settings to use sql libraries.

8
4.Code Snippets
Data base connection class:
class db{
const char* hostname="localhost";
const char* username="root";
const char* password="";
const char* database="mars";
unsigned int port =3306;
const char* unixsocket=NULL;
unsigned clientflag=0;

public:
MYSQL* connecteddatabase(){
MYSQL* conn;
conn = mysql_init(0);
conn =
mysql_real_connect(conn,hostname,username,password,database,port,unixsoc
ket,clientflag);
if(conn){
cout<<"Connected"<<" "<<conn<<endl;
system("pause");
return conn;
}
else{
cout<<"Not Connected"<<" "<<conn<<endl;
system("pause");
return conn;
}
}
};
Signup function:
void createuser(MYSQL* conn){
int qstate;
string s,p,cp,phno;
label:
stringstream ss,usercheck;
system("cls");
SetConsoleTextAttribute(h,2);
cout<<"Enter username: "<<endl;
SetConsoleTextAttribute(h,6);
cin>>s;
if(testusername(conn,s)){
cout<<"Username already exists! \nTry a different username"<<endl;
9
system("pause");
system("cls");
createuser(conn);
}
else{
SetConsoleTextAttribute(h,2);
cout<<"Enter Password: "<<endl;
SetConsoleTextAttribute(h,6);
cin>>p;
SetConsoleTextAttribute(h,2);
cout<<"Confirm Password: "<<endl;
SetConsoleTextAttribute(h,6);
cin>>cp;
SetConsoleTextAttribute(h,2);
cout<<"Phone number: "<<endl;
SetConsoleTextAttribute(h,6);
cin>>phno;
if(p==cp){
ss<<"INSERT INTO users(username,password,phno) VALUES
('"+s+"','"+p+"','"+phno+"')";
string query=ss.str();
const char* q=query.c_str();
qstate=mysql_query(conn,q);
if(qstate==0){
SetConsoleTextAttribute(h,12);
cout<<"Created!\nYou have received 100/- Welcome bonus"<<endl;
//user=s;
u.putuser(s);
//pass=p;
u.putpass(p);
stringstream ss1;
ss1<<"INSERT INTO
stocks(username,item1,item2,item3,item4,item5,item6,item7,item8,item9,item
10,password,balance) VALUES ('"+s+"',0,0,0,0,0,0,0,0,0,0,'"+p+"',100)";
string query=ss1.str();
const char* q=query.c_str();
mysql_query(conn,q);
system("pause");
// return true;
}
}
else{
cout<<"Passwords doesnt match!"<<endl;
system("pause");
10
goto label;
}
// return false;
}
}
Login function:
bool getuser(MYSQL* conn){
string user,pass;
system("cls");
SetConsoleTextAttribute(h,2);
cout<<"Type username:"<<endl;
SetConsoleTextAttribute(h,6);
cin>>user;
SetConsoleTextAttribute(h,2);
cout<<"Enter Password: "<<endl;
SetConsoleTextAttribute(h,6);
cin>>pass;
if(!checkup(conn,user,pass)){
cout<<"User name or password doesn't match!"<<endl;
system("pause");
return false;
}
u.putuser(user);
u.putpass(pass);
return true;
}
Invest function:
void invest(MYSQL* conn){
int c,n;
string user=u.getusern();
string pass=u.getpass();
cout<<"Stocks Available: "<<endl;
cout<<"-----------------"<<endl;
displaystocks(conn);
cout<<"User's Stocks: "<<endl;
cout<<"-------------"<<endl;
displayuserinfo(conn);
cout<<"Type on which item to invest: "<<endl;
cin>>c;
cout<<"Type quantity: "<<endl;
cin>>n;
stringstream ss;
ss<<"SELECT balance FROM stocks WHERE username='"+user+"' AND
11
password='"+pass+"' ";
string query=ss.str();
const char* q=query.c_str();
MYSQL_ROW row;
MYSQL_RES* res;
mysql_query(conn,q);
res=mysql_store_result(conn);
row=mysql_fetch_row(res);
int balance=atoi(row[0]);

stringstream ss1;
ss1<<"SELECT cost FROM cost WHERE itemname='item"+itos(c)+"' ";
query=ss1.str();
q=query.c_str();
// cout<<q<<endl;
mysql_query(conn,q);
res=mysql_store_result(conn);
row=mysql_fetch_row(res);
int cost=n*atoi(row[0]);
// cout<<row[0];

if(balance-cost>=0){
stringstream ss1;
int newbalance=balance-cost;
ss1<<"UPDATE stocks SET item"+itos(c)+"=item"+itos(c)+"+"+itos(n)
+", balance="+itos(newbalance)+" WHERE username='"+user+"' AND
password='"+pass+"' ";
string query=ss1.str();
q=query.c_str();
// cout<<q<<endl;
int querystatus=mysql_query(conn,q);
if(!querystatus){
cout<<"Transaction Successful!"<<endl;
system("pause");
system("cls");
}
}
else{
cout<<"Insufficient balance!"<<endl;
system("pause");
system("cls");
}
}
Deposit function:
12
void deposit(MYSQL* conn){
int i;
string user=u.getusern();
string pass=u.getpass();
cout<<"Type amount to be deposited: "<<endl;
cin>>i;
stringstream ss;
ss<<"SELECT balance FROM stocks WHERE username='"+user+"' AND
password='"+pass+"' ";
string query=ss.str();
const char* q=query.c_str();
MYSQL_ROW row;
MYSQL_RES* res;
mysql_query(conn,q);
res=mysql_store_result(conn);
row=mysql_fetch_row(res);
int newbalance=atoi(row[0])+i;
stringstream ss2;
ss2<<"UPDATE stocks SET balance="+itos(newbalance)+" WHERE
username='"+user+"' AND password='"+pass+"' ";
query=ss2.str();
q=query.c_str();
mysql_query(conn,q);
cout<<"Transaction Successful!"<<endl;
system("pause");
}
Display users shares function:
void displayuserinfo(MYSQL* conn){
stringstream ss;
string user=u.getusern();
string pass=u.getpass();
ss<<"SELECT
item1,item2,item3,item4,item5,item6,item7,item8,item9,item10,balance
FROM stocks WHERE username='"+user+"' AND password='"+pass+"' ";
string query=ss.str();
const char* q=query.c_str();
MYSQL_ROW row;
MYSQL_RES* res;
int qstate=mysql_query(conn,q);
if(!qstate){
res=mysql_store_result(conn);
row=mysql_fetch_row(res);
cout<<"Item\t\t\tNo.\n";
13
cout<<"----------------------------------------"<<endl;
for(int i=0;i<10;i++){
cout<<"item"<<i+1<<"\t:\t\t"<<row[i]<<endl;
}
cout<<"Balance: "<<row[10]<<endl;
cout<<"----------------------------------------\n"<<endl;
}
else{
cout<<"Error printing user stocks"<<endl;
}
}

14
5. MODEL IMPLEMENTATION

Home page:

15
Login page:

16
Signup page:

17
User’s page:

Invest:

18
Sell

Deposit

19
User A/C

6. Applications
 Allows Investing funds from smartphone to companies.
 Helps to become a shareholder of a company.

7. Conclusion

Our Stock market trading app helps users invest on some shares and become
shareholders. Investing in stocks are a way to build wealth. They are an
investment that means you own a share in the company that issued the stock.
Stocks are how ordinary people invest in some of the most successful companies
in the world.

-------X-------

20

You might also like