NAME: Tejas Srivastava Class: Xi - A Roll No.: SUBJECT: Computer Project 2019
NAME: Tejas Srivastava Class: Xi - A Roll No.: SUBJECT: Computer Project 2019
NAME: Tejas Srivastava Class: Xi - A Roll No.: SUBJECT: Computer Project 2019
2019
T e j a s S r i v a s t a v a ( X I - A ) 1 | 12
COMPUTER PROJECT -2019
ACKNOWLEDGEMENT
In the completion of this project, there were numerous helping hands without
which, I might not have completed it, and whom I want to thank.
First of all, I would like to thank the Almighty for showering His blessings upon all of
us .
Secondly, I would like to thank my Computer teacher, mentor, and guide : Mr. C.K.
Mishra for his ever constant support and guidance throughout the completion of this
project.
Next, I would like to thank my family and friends who also have played a key role in
helping me with their utmost support whenever needed.
Last, but not the least, I would like to thank the reader for contributing his precious
time in reading this project.
PREFACE
T e j a s S r i v a s t a v a ( X I - A ) 2 | 12
COMPUTER PROJECT -2019
Vivid use of variables with mnemonic names and self-explanatory identifiers have
been used in the source code. The code is well aligned/indented according to the latest
IDE BlueJ 4.2.1 for Java Programming Language. Also, the code is well tried to be made
as compact and logically understandable as possible. Use of numerous Compound
Statements, functions and variables have been made for the ease of the reader.
Moreover, the it has been tried best to make the program graphically interactive on the
Terminal Window itself. Hope you will like it.
import java.util.Scanner;
class Mall
{
T e j a s S r i v a s t a v a ( X I - A ) 3 | 12
COMPUTER PROJECT -2019
static String
pName[]={"Apple","Bananna","Chair","Door","A.C.","Bed","Chips","Pen","Onion","Pillo
w",
"Paste","Phone","Paper","Light","Mouse","Broom","Bucket","Coat","Bottle","Book",
"Pencil","Fruits","Sugar","Flour","Soap","Gloves","Cap","Tie","Socks","Shirt"};
String name1=sc.next();
String name2=sc.nextLine();
name=name1+name2;
System.out.print ("Enter Phone Number : ");
phno=sc.next();
System.out.println("\n");
}
T e j a s S r i v a s t a v a ( X I - A ) 5 | 12
COMPUTER PROJECT -2019
int q=sc.nextInt();
if(q>stock[y])
{
System.out.println ("\n\nOUT OF STOCK!!");
Thread.sleep(2000);
continue;
}
stock[y]-=q;
T e j a s S r i v a s t a v a ( X I - A ) 6 | 12
COMPUTER PROJECT -2019
int tot=q*price[y];
System.out.println ("Total : \t\t\tRs."+tot);
sum=sum+tot;
pc[count]=Pc;
pq[count]=q;
pp[count]=price[y];
pn[count]=pName[y];
count++;
System.out.println ("\n\nPress 1 to continue\nPress 2 to exit to Billing");
exit=sc.nextInt()==2;
}while(!exit);
System.out.print ("\f");
System.out.println ("Sl.No.\tProduct\tProduct\tQuantity\tRate\tTOTAL");
System.out.println ("\tCode\tName\t\t\t(in Rs.)(in Rs.)\n");
for(int x=0;x<count;x++)
{
System.out.println((x+1)+".)\t"+pc[x]+"\t"+pn[x]+"\t"+pq[x]+"\t\t"+pp[x]+"\t"+(pp[x]*p
q[x]));
}
System.out.println
("________________________________________________________________");
System.out.println("\nName : "+name);
System.out.println("Phone Number : "+phno);
System.out.println ("\n\n--------------------------------------------------------\nTotal
Amount = Rs."+sum);
T e j a s S r i v a s t a v a ( X I - A ) 7 | 12
COMPUTER PROJECT -2019
case 1:
System.out.print ("\fEnter 1 for Stock Modification\nEnter 2 for Rate
Modification\n\n");
int o=sc.nextInt();
exit=false;
switch(o)
{
case 1:
do
{
System.out.println ("\f\t\t\t\tSTOCK MODIFICATION");
System.out.println ("Product Codes Are - 1001, 1002, 1003, ....1030");
System.out.print ("\n\nEnter the Product Code for Modification : ");
int c=sc.nextInt();
int i=search(pCode,c);
if(i==-1)
T e j a s S r i v a s t a v a ( X I - A ) 8 | 12
COMPUTER PROJECT -2019
{
System.out.println("\n\nSorry You Have Entered Wrong Product
Code\nPlease Re-Enter Code Again");
Thread.sleep(3000);
continue;
}
String nm=pName[i];
System.out.println("You Have Chosen Product - "+nm);
System.out.println("Stock - "+stock[i]);
System.out.println("Price - Rs."+price[i]);
System.out.print ("Enter Stock to be Added : ");
int s=sc.nextInt();
stock[i]+=s;
System.out.println ("\nStock UPDATED \n");
{
System.out.println("Product - "+nm);
System.out.println("New Stock - "+stock[i]);
System.out.println("Price - Rs."+price[i]);
}
System.out.println ("\n\nEnter 1 to Modify More stock\nEnter 2 to Exit");
int y=sc.nextInt();
exit=y==2;
}while(!exit);
System.out.println ("\fThankyou................");
break;
T e j a s S r i v a s t a v a ( X I - A ) 9 | 12
COMPUTER PROJECT -2019
case 2:
do
{
System.out.println ("\f\t\t\t\tPRICE MODIFICATION");
System.out.println ("Product Codes Are - 1001, 1002, 1003, ....1030");
System.out.print ("\n\nEnter the Product Code for Modification : ");
int c=sc.nextInt();
int i=search(pCode,c);
if(i==-1)
{
System.out.println("\n\nSorry You Have Entered Wrong Product
Code\nPlease Re-Enter Code Again");
Thread.sleep(3000);
continue;
}
String nm=pName[i];
System.out.println ("You Have Chosen Product - "+nm);
System.out.println("Stock - "+stock[i]);
System.out.println("Price - Rs."+price[i]);
System.out.print ("Enter new Price : ");
int s=sc.nextInt();
price[i]=s;
System.out.println ("\nPrice UPDATED \n");
{
System.out.println("Product - "+nm);
T e j a s S r i v a s t a v a ( X I - A ) 10 | 12
COMPUTER PROJECT -2019
}
System.out.println ("\n\nEnter 1 to Modofy More Rates\nEnter 2 to Exit");
int y=sc.nextInt();
exit=y==2;
}while(!exit);
System.out.println ("\fThankyou..........");
break;
}
break;
case 3:
System.out.println ("Thankyou......");
Thread.sleep(1000);
System.exit(0);
break;
default:
System.out.println ("Invalid Choice");
break;
}
}while (true);
}
{
for(int x=0;x<ar.length;x++)
{
if(ar[x]==i)
return x;
}
return -1;
}
}
T e j a s S r i v a s t a v a ( X I - A ) 12 | 12