You are on page 1of 26

INFORMATICS PRACTICES

INVESTIGATORY
PROJECT
ON
E-AUTOMOBILE
SHOPPING

Prepared By:- Prayas Kumar Behera


Class:- XII Sc.
Roll No:-
Guided By:- Shri. Jashobanta Sahoo(PGT
COMP SC.)
Bio data
Name:- Prayas Kumar Behera

Father’s Name:- Chandrakanta Behera


Date of Birth:- 18-11-1998

Class:- XII Sc.

Gender:- Male
School:- J.N.V. Mundali, Cuttack
Examination:- A.I.S.S.E.

Session:- 2014-15

Roll No.:-
Certificate

This is to certify that Prayas Kumar Behera of


class XII ‘Sc’ bearing Roll no:
---------- of class XII sc. of JNV Mundali, Cuttack
undertaken the project entitled “E-automobile
shopping” and had successfully completed in
the laboratory of Vidyalaya under my guidance.

Sign. of Teacher Sign. of


Principal

Sign. of Examiner
ACKNOWLEDGEMENT

I extend my sincere thanks to my school J.N.V


MUNDALI, CUTTACK which provided me with the
opportunity to fulfill my wish and achieve my goal.
I would like to express deep debt to Shri. Jashobanta
Sahoo(P.G.T. Comp Sc.) project guide for his vital
suggestions, meticulous guidance and constant
motivation which went a long way in the successful
completion of this project.
I cannot move on without thank beloved principal Shri.
M. Mariappan for creating the required academic
environment which made my task appreciable.
On a moral personal note, my deepest appreciation
and gratitude to my beloved parents, who have been
an inspiration and have provided me with unrelenting
encouragement and support.

Sign. of Student
CONTENTS

1. Introduction
1.1 Purpose
1.2 Scope
1.3 Hardware & Software Requirements

2. Overall Description
2.1 Goals of Proposed System
2.2 Background
2.3 User Characteristics
2.4 Constraints
3. Entity Relationship Diagram
4. Database Design
5. Snapshots & Programming Code
6. Conclusion
7. Bibliography
1. Introduction
1.1) Purpose
• The Software is for the online shopping of automobiles.

• The Software includes:-


 Maintaining customer deatils.

 Various vendors and products.

 Keeps billing record of purchase.

1.2) Scope
This software can be downloaded by anyone for to sit
in their homes and get the automobile of their choice
through the internet.
1.3 ) Hardware & Software Requirements
Hardware Requirements
Processor- P4 or more

RAM – 256 MB or more

HDD – 40GB or more

Software Requirements
OS – Windows Xp or more/Linux

JDK 1.5 or more

NetBeans 5 or more

MySQL Server
2. Overall Description
2.1) Goals of proposed system
1. Planned approach towards working: -
The data will be stored properly in data stores, which will help in retrieval of
information as well as its storage.

2. Accuracy: -
The level of accuracy in the software will be higher.

3. Reliability: -
The reliability of the proposed application will be high due to the above stated
reasons. The reason for the increased reliability of the software is that now there
would be proper storage of information.

4. No Redundancy: -
In the proposed software utmost care would be that no information is repeated
anywhere, in storage or otherwise. This would assure economic use of storage
space and consistency in the data stored.

5. Easy to Operate: -
The software should be easy to operate and should be such that user would feel
comfortablewith the software.

2.2) Background
E-automobile shopping is software where use can get the products of their through
internet sitting at their homes. Software provides Facilities like:-

 Authentication of user by user id and password.

 Facility for home delivery through the address given by the user.

 Various vendors and their products.

 Recording information about the products that are purchased by the user.

 Generating payment bills.

These are the various jobs that need to be done before purchasing an
automobile by the customer.
All these works are done on by going to the showroom and filling purchase
application on paper.

2.3) User Characteristics


Every user should be:
• Comfortable of working with computer.

• He must also have basic knowledge of English too.

2.4) Constraints
• GUI is only in English.

• Login and password is used for identification of user.

E-R Diagram

Represents Entity or Table Name

Represents Attribute or column name

EID
AMOUNT

NAME
PRODUCT
Customer
MAIL ADDRESS

PHONE PASSWORD
Database Design
customer Table:
LOGIN PAGE SNAPSHOT

CODE FOR LOGIN BUTTON


import java.sql.*;
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
homepage hom=new homepage();
String name=jTextField1.getText();
String pass=new String(jPasswordField1.getPassword());
String pwd="",nm="";
try{
Class.forName("java.sql.Driver");
Connection con =
DriverManager.getConnection("jdbc:mysql://localhost:3306/mydb","root","system");
Statement st= con.createStatement();
ResultSet rs= st.executeQuery("select name,password from customer where
name='"+name+"';");

while (rs.next())
{ nm=rs.getString("name");
pwd=rs.getString("password");
}
if(pass.equals(pwd) && name.equals(nm))
{
hom.setVisible(true);
this.setVisible(false);
}
else { jOptionPane1.showMessageDialog(null,"wrong user id or password","Message",1);
}}
catch(Exception e)
{ e.printStackTrace(); }
}
IF PASSWORD OR NAME INCORRECT MESSAGE WILL APPEAR

CODE FOR SIGN UP BUTTON


private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
signup sgnup= new signup();
sgnup.setVisible(true);
this.setVisible(false);
}
SIGNUP PAGE SNAPSHOT

CODE FOR SUBMIT BUTTON


import java.sql.*;
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
login log=new login();
log.setVisible(true);
this.setVisible(false);
int id=Integer.parseInt(jTextField4.getText());
String name= jTextField1.getText();
String mail= jTextField2.getText();
long ph=Long.parseLong(jTextField3.getText());
String pass=new String(jPasswordField1.getPassword());
String add= jTextArea1.getText();
double amt=0;
String prod="";
try{
Class.forName("java.sql.Driver");
Connection con =
DriverManager.getConnection("jdbc:mysql://localhost:3306/mydb","root","system");
Statement st= con.createStatement();

int x=st.executeUpdate("insert into customer values


("+id+",'"+name+"','"+mail+"',"+ph+",'"+pass+"','"+add+"','"+prod+"',"+amt+");");
if (x!=0)
jOptionPane1.showMessageDialog(null,"sign up complete","Message",1);
}
catch(Exception e)
{ e.printStackTrace();

} }

IF SIGNUP CORRECTLY DONE MESSAGE WILL APPEAR


HOME PAGE SNAPSHOT

CODE FOR LAMBORGHINI BUTTON


private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
lamborghini lam=new lamborghini();
lam.setVisible(true);
this.setVisible(false); }
CODE FOR FERRARI BUTTON
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
ferrari fer=new ferrari();
fer.setVisible(true);
this.setVisible(false); }
CODE FOR AUDI BUTTON
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
audi aud=new audi();
aud.setVisible(true);
this.setVisible(false);}
CODE FOR BMW BUTTON
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
bmw bm=new bmw();
bm.setVisible(true);
this.setVisible(false);}
CODE FOR DUCATI BUTTON
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {
ducati duc=new ducati();
duc.setVisible(true);
this.setVisible(false);}
CODE FOR YAMAHA BUTTON
private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {
yamaha yam=new yamaha();
yam.setVisible(true);
this.setVisible(false); }
CODE FOR HONDA BUTTON
private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {
honda hon=new honda();
hon.setVisible(true);
this.setVisible(false); }
CODE FOR KTM BUTTON
private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {
ktm km=new ktm();
km.setVisible(true);
this.setVisible(false);}

CODE FOR BACK BUTTON


private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
homepage hom=new homepage();
hom.setVisible(true);
this.setVisible(false);
}
CODE FOR CHECKOUT BUTTON
import java.sql.*;
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
String prod="";
double amount=0.0;
int id=Integer.parseInt(jTextField1.getText());
if (jCheckBox1.isSelected())
{
amount=amount+50000000;
prod=prod.concat("LAMBORGHINI EGOISTA") ;
}
if (jCheckBox2.isSelected()){
amount=amount+35000000;
prod=prod.concat("\n LAMBORGHINI VENENO");
}
if (jCheckBox3.isSelected()){
amount=amount+25000000;
prod=prod.concat("\n LAMBORGHINI AVENTADOR"); }
if (jCheckBox4.isSelected()){
amount=amount+30000000;
prod=prod.concat("\n LAMBORGHINI MURCIELAGO"); }

try{
Class.forName("java.sql.Driver");
Connection con =
DriverManager.getConnection("jdbc:mysql://localhost:3306/mydb","root","system");
Statement st= con.createStatement();
int x=st.executeUpdate("update customer set amount="+amount+",product='"+prod+"'
where eid="+id+";");
if (x!=0){System.out.println("data updated");}
else{System.out.println("data updating failed");}}
catch(Exception e)
{
e.printStackTrace();
}
checkout chk=new checkout();
chk.setVisible(true);
this.setVisible(false);}

CODE FOR BACK BUTTON


private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
homepage hom=new homepage();
hom.setVisible(true);
this.setVisible(false);
}

CODE FOR CHECKOUT BUTTON


private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
String prod="";
double amount=0.0;

int id=Integer.parseInt(jTextField1.getText());
if (jCheckBox1.isSelected())
{
amount=amount+3000000;
prod=prod.concat("FERRARI ENZO") ;
}
if (jCheckBox2.isSelected()){
amount=amount+4500000;
prod=prod.concat("\n FERRARI RC7");
}
if (jCheckBox3.isSelected()){
amount=amount+20000000;
prod=prod.concat("\n FERRARI GT"); }
if (jCheckBox4.isSelected()){
amount=amount+5500000;
prod=prod.concat("\n FERRARI SPYDAR"); }

try{
Class.forName("java.sql.Driver");
Connection con =
DriverManager.getConnection("jdbc:mysql://localhost:3306/mydb","root","system");
Statement st= con.createStatement();
int x=st.executeUpdate("update customer set amount="+amount+",product='"+prod+"'
where eid="+id+";");
if (x!=0){System.out.println("data updated");}
else{System.out.println("data updating failed");}}
catch(Exception e)
{
e.printStackTrace();
}
checkout chk=new checkout();
chk.setVisible(true);
this.setVisible(false);
}

CODE FOR BACK BUTTON


private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
homepage hom=new homepage();
hom.setVisible(true);
this.setVisible(false);
}
CODE FOR CHECKOUT BUTTON
import java.sql.*;
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
String prod="";
double amount=0.0;
int id=Integer.parseInt(jTextField1.getText());
if (jCheckBox1.isSelected())
{
amount=amount+2000000;
prod=prod.concat("AUDI A4") ;
}
if (jCheckBox2.isSelected()){
amount=amount+2050000;
prod=prod.concat("\n AUDI GTI");
}
if (jCheckBox3.isSelected()){
amount=amount+450000;
prod=prod.concat("\n AUDI X5"); }
if (jCheckBox4.isSelected()){
amount=amount+4500000;
prod=prod.concat("\n AUDIR8"); }
try{
Class.forName("java.sql.Driver");
Connection con =
DriverManager.getConnection("jdbc:mysql://localhost:3306/mydb","root","system");
Statement st= con.createStatement();
int x=st.executeUpdate("update customer set amount="+amount+",product='"+prod+"'
where eid="+id+";");
if (x!=0){System.out.println("data updated");}
else{System.out.println("data updating failed");}}
catch(Exception e)
{
e.printStackTrace();
}
checkout chk=new checkout();
chk.setVisible(true);
this.setVisible(false);
}

CODE FOR BACK BUTTON


private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
homepage hom=new homepage();
hom.setVisible(true);
this.setVisible(false);
}
CODE FOR CHECKOUT BUTTON
import java.sql.*;
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
String prod="";
double amount=0.0;

int id=Integer.parseInt(jTextField1.getText());
if (jCheckBox1.isSelected())
{
amount=amount+20000000;
prod=prod.concat("BMW R8") ;
}
if (jCheckBox2.isSelected()){
amount=amount+3500000;
prod=prod.concat("\n BMW I3");
}
if (jCheckBox3.isSelected()){
amount=amount+4000000;
prod=prod.concat("\n BMW M4 "); }
if (jCheckBox4.isSelected()){
amount=amount+15000000;
prod=prod.concat("\n BMW ITALIA"); }

try{
Class.forName("java.sql.Driver");
Connection con =
DriverManager.getConnection("jdbc:mysql://localhost:3306/mydb","root","system");
Statement st= con.createStatement();
int x=st.executeUpdate("update customer set amount="+amount+",product='"+prod+"'
where eid="+id+";");
if (x!=0){System.out.println("data updated");}
else{System.out.println("data updating failed");}}
catch(Exception e)
{
e.printStackTrace();
}
checkout chk=new checkout();
chk.setVisible(true);
this.setVisible(false);
// TODO add your handling code here:
}

CODE FOR BACK BUTTON


private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
homepage hom=new homepage();
hom.setVisible(true);
this.setVisible(false);
}
CODE FOR CHECKOUT BUTTON
import java.sql.*;
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
String prod="";
double amount=0.0;
int id=Integer.parseInt(jTextField1.getText());
if (jCheckBox1.isSelected())
{
amount=amount+500000;
prod=prod.concat("YAMAHA R15") ;
}
if (jCheckBox2.isSelected()){
amount=amount+700000;
prod=prod.concat("\n YAMAHA R6");
}
if (jCheckBox3.isSelected()){
amount=amount+250000;
prod=prod.concat("\n YAMAHA FAZOR"); }
if (jCheckBox4.isSelected()){
amount=amount+280000;
prod=prod.concat("\n YAMAHA FZ"); }

try{
Class.forName("java.sql.Driver");
Connection con =
DriverManager.getConnection("jdbc:mysql://localhost:3306/mydb","root","system");
Statement st= con.createStatement();
int x=st.executeUpdate("update customer set amount="+amount+",product='"+prod+"'
where eid="+id+";");
if (x!=0){System.out.println("data updated");}
else{System.out.println("data updating failed");}}
catch(Exception e)
{
e.printStackTrace();
}
checkout chk=new checkout();
chk.setVisible(true);
this.setVisible(false); }

CODE FOR BACK BUTTON


private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
homepage hom=new homepage();
hom.setVisible(true);
this.setVisible(false);
}
CODE FOR CHECKOUT BUTTON
import java.sql.*;
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
String prod="";
double amount=0.0;
int id=Integer.parseInt(jTextField1.getText());
if (jCheckBox1.isSelected()){
amount=amount+200000;
prod=prod.concat("KTM DUKE") ; }
if (jCheckBox2.isSelected()){
amount=amount+380000;
prod=prod.concat("\n KTM SUPERDUKE");}
if (jCheckBox3.isSelected()){
amount=amount+4500000;
prod=prod.concat("\n KTM RC8"); }
if (jCheckBox4.isSelected()){
amount=amount+2700000;
prod=prod.concat("\n KTM 380"); }
try{
Class.forName("java.sql.Driver");
Connection con =
DriverManager.getConnection("jdbc:mysql://localhost:3306/mydb","root","system");
Statement st= con.createStatement();
int x=st.executeUpdate("update customer set amount="+amount+",product='"+prod+"'
where eid="+id+";");
if (x!=0){System.out.println("data updated");}
else{System.out.println("data updating failed");}}
catch(Exception e)
{
e.printStackTrace();
}
checkout chk=new checkout();
chk.setVisible(true);
this.setVisible(false); }

CODE FOR BACK BUTTON


private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
homepage hom=new homepage();
hom.setVisible(true);
this.setVisible(false);
}
CODE FOR CHECKOUT BUTTON
import java.sql.*;
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
String prod="";
double amount=0.0;
int id=Integer.parseInt(jTextField1.getText());
if (jCheckBox1.isSelected())
{
amount=amount+4000000;
prod=prod.concat("DUCATI STREET FIGHTER") ;
}
if (jCheckBox2.isSelected()){
amount=amount+3500000;
prod=prod.concat("\n DUCATI DIAVEL");
}
if (jCheckBox3.isSelected()){
amount=amount+2700000;
prod=prod.concat("\n DUCATI GROM"); }
if (jCheckBox4.isSelected()){
amount=amount+40000000;
prod=prod.concat("\n DUCATI MONSTER"); }

try{
Class.forName("java.sql.Driver");
Connection con =
DriverManager.getConnection("jdbc:mysql://localhost:3306/mydb","root","system");
Statement st= con.createStatement();
int x=st.executeUpdate("update customer set amount="+amount+",product='"+prod+"'
where eid="+id+";");
if (x!=0){System.out.println("data updated");}
else{System.out.println("data updating failed");}}
catch(Exception e)
{
e.printStackTrace();
}
checkout chk=new checkout();
chk.setVisible(true);
this.setVisible(false);
}

CODE FOR BACK BUTTON


private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
homepage hom=new homepage();
hom.setVisible(true);
this.setVisible(false);
}
CODE FOR CHECKOUT BUTTON
import java.sql.*;
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
String prod="";
double amount=0.0;

int id=Integer.parseInt(jTextField1.getText());
if (jCheckBox1.isSelected())
{
amount=amount+8700000;
prod=prod.concat("HONDA CBR") ;
}
if (jCheckBox2.isSelected()){
amount=amount+6800000;
prod=prod.concat("\n HONDA YR8");
}
if (jCheckBox3.isSelected()){
amount=amount+4500000;
prod=prod.concat("\n HONDA CX1"); }
if (jCheckBox4.isSelected()){
amount=amount+30000000;
prod=prod.concat("\n REPSOL HONDA"); }

try{
Class.forName("java.sql.Driver");
Connection con =
DriverManager.getConnection("jdbc:mysql://localhost:3306/mydb","root","system");
Statement st= con.createStatement();
int x=st.executeUpdate("update customer set amount="+amount+",product='"+prod+"'
where eid="+id+";");
if (x!=0){System.out.println("data updated");}
else{System.out.println("data updating failed");}}
catch(Exception e)
{
e.printStackTrace();
}
checkout chk=new checkout();
chk.setVisible(true);
this.setVisible(false);

}
CHECKOUT PAGE SNAPSHOT

CODE FOR PAY BUTTON


import java.sql.*;
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
homepage hom=new homepage();
double amt=0;
int id=Integer.parseInt(tfid.getText());
double pay=Double.parseDouble(jTextField1.getText());
try{
Class.forName("java.sql.Driver");
Connection con =
DriverManager.getConnection("jdbc:mysql://localhost:3306/mydb","root","system");
Statement st= con.createStatement();
ResultSet rs= st.executeQuery("select amount from customer where eid="+id+";");
while (rs.next())
{ amt=rs.getDouble("amount");}
if (pay==amt)
{ jOptionPane1.showMessageDialog(null,"ENJOY YOUR RIDE","message",1);
hom.setVisible(true);
this.setVisible(false);
}
else { jOptionPane1.showMessageDialog(null,"PLEASE PAY EXACT PRICE","message",1);
}}
catch(Exception e)
{ e.printStackTrace(); }
}
TEXT FIELD FOCUS LOST EVENT
private void tfidFocusLost(java.awt.event.FocusEvent evt) {
int id=Integer.parseInt(tfid.getText());
String nam="";
String prod="";
double amt=0;
try{
Class.forName("java.sql.Driver");
Connection con =
DriverManager.getConnection("jdbc:mysql://localhost:3306/mydb","root","system");
Statement st= con.createStatement();
ResultSet rs= st.executeQuery("select name,product,amount from customer where
eid="+id+";");
while (rs.next())
{ nam=rs.getString("name");
prod=rs.getString("product");
amt=rs.getDouble("amount");
}
jLabel2.setText(""+nam);
jTextArea1.append(""+prod);
jLabel5.setText(""+amt);
}
catch(Exception e)
{ e.printStackTrace();}
}

IF YOU DID NOT PAY EXACT PRICE MESSAGE WILL APPEAR

IF YOU PAY EXACT PRICE MESSAGE WILL APPEAR


CONCLUSION

The project entitled “E-Automobile


Shopping” is effective for online purchase
and selling of automobiles through the
internet. The software provides various
vendors and products for variety purchase.
The software takes care of all the
requirements of e-shopping and is capable
to provide easy and effective use for the
customer.
It also provides billing facility on the basis
of customer’s purchase.
The software also provides authentication
of user by providing a user id and
password.
This project is executing successfully as per
Design and also it is very cost effective and
less requirement.

Bibliography

 www.icbse.com
 www.w3schools.com
 www.stackoverflow.com
 Complete reference of SQL
 Informatics Practices of class XII (By Sumita
Arora)
 Online shopping sites like:-
Amazon,jabong,flipkart,etc.

You might also like